-
Notifications
You must be signed in to change notification settings - Fork 657
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[UPDATE] clearify "to_string()" #127
Comments
+1 |
I made the same remark, see #124 ;) |
finally got it, but frankly, Langchain tool definition is more graceful.simply define the function does't work, we need to define the class. class Tool:
calculator_tool = Tool( calculator_tool.to_string() OR import inspect def tool(func):
@tool print(calculator.to_string()) |
The last line,
print(calculator.to_string())
, is causing confusion because it results in anAttributeError: 'function' object has no attribute 'to_string'
. It seems like the intention was to demonstrate a conversion to a string format, such as "Tool Name: calculator, Description: Multiply two integers., Arguments: a: int, b: int, Outputs: int". However, this is not clearly communicated in the code.In contrast, the second example, which introduces a decorator that implements the
to_string
method, is much clearer and makes more sense.Could you clarify the purpose of the
to_string()
call in the first example or remove it to avoid confusion?Thank you!
The text was updated successfully, but these errors were encountered: