Skip to content
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] Tools - Example Python code in unit 1 can't run #124

Open
Anto59290 opened this issue Feb 13, 2025 · 1 comment
Open

[UPDATE] Tools - Example Python code in unit 1 can't run #124

Anto59290 opened this issue Feb 13, 2025 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@Anto59290
Copy link

Anto59290 commented Feb 13, 2025

In unit one, there is this sample code:

def calculator(a: int, b: int) -> int:
    """Multiply two integers."""
    return a * b

print(calculator.to_string())

I am not sure why the last line is there, and I found it confusing:

  • Using this code as is won't run (AttributeError: 'function' object has no attribute 'to_string')
  • I found it unclear why some kind of conversion to string would be needed. It looks like the idea is that we can convert this code to a string object like Tool Name: calculator, Description: Multiply two integers., Arguments: a: int, b: int, Outputs: int but IMHO it lacks clarity.

The second example makes more sense, as it introduces the decorator, which (I guess) implements the to_string method.

@Anto59290 Anto59290 added the documentation Improvements or additions to documentation label Feb 13, 2025
@Jofthomas
Copy link
Collaborator

The to_string version is is the decorator and is need to give the model a notion about which tool does it have access to. Indeed without the decorator the to_string() can't work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants