-
Notifications
You must be signed in to change notification settings - Fork 122
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
[Fix] Adding default description in tools #347
base: main
Are you sure you want to change the base?
[Fix] Adding default description in tools #347
Conversation
46e5957
to
9ab7d23
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @patilvishal0597 - tested and looks good with several models that were previously failing.
if not tool["description"]: | ||
tool["description"] = tool["name"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: can simplify to
tool["description"] = tool["description"] or tool["name"]
if "description" not in tool_spec or not tool_spec["description"]: | ||
tool_spec["description"] = tool_spec["name"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: use dict.get()
tool_spec["description"] = tool_spec.get("description") or tool_spec["name"]
if "description" not in formatted or not formatted["description"]: | ||
formatted["description"] = formatted["name"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: use dict.get()
formatted["description"] = formatted.get("description") or formatted["name"]
9ab7d23
to
9575ecd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Adding tool name as default tool descriptions if description is an empty string or not passed
Fixes #336