fix(py): improve tool call usage in docs - #320
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates several documentation files to simplify the @ai.tool decorator by removing explicit name and description arguments, letting them default to the function name and docstring instead. The review feedback correctly identifies that changing the tool name from camelCase (getWeather) to snake_case (get_weather) in tool-calling.mdx introduces inconsistencies, as subsequent code examples in the same file still reference the old name and will fail at runtime.
|
@gemini review |
There was a problem hiding this comment.
Code Review
This pull request updates the documentation examples to define tools using the @ai.tool() decorator without explicit name and description arguments, defaulting instead to the function name and docstring. A review comment correctly identifies a missed reference in src/content/docs/docs/tool-calling.mdx where webSearch needs to be updated to web_search to prevent a NameError in the example code.
|
Added a note in |
|
@gemini review |
|
Updated |
There was a problem hiding this comment.
Code Review
This pull request updates the documentation across multiple files to demonstrate the simplified @ai.tool() decorator syntax, where the tool name defaults to the function name and the description is retrieved from the function's docstring. References to tool names have been updated from camelCase to snake_case to match this new behavior. There are no review comments, so I have no additional feedback to provide.
Show default tool usage (defaulting to function name / docstring) rather than showing off name/description overrides, which is a secondary use case.