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

[Fix] Adding default description in tools #347

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

patilvishal0597
Copy link
Contributor

Adding tool name as default tool descriptions if description is an empty string or not passed

Fixes #336

@patilvishal0597 patilvishal0597 changed the title Issue 336 default description in tools [Fix] Adding default description in tools Feb 4, 2025
@patilvishal0597 patilvishal0597 force-pushed the issue-336-default-description-in-tools branch from 46e5957 to 9ab7d23 Compare February 4, 2025 23:57
Copy link
Collaborator

@michaelnchin michaelnchin left a 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.

Comment on lines 214 to 215
if not tool["description"]:
tool["description"] = tool["name"]
Copy link
Collaborator

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"]

Comment on lines 1035 to 1036
if "description" not in tool_spec or not tool_spec["description"]:
tool_spec["description"] = tool_spec["name"]
Copy link
Collaborator

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"]

Comment on lines 219 to 220
if "description" not in formatted or not formatted["description"]:
formatted["description"] = formatted["name"]
Copy link
Collaborator

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"]

@patilvishal0597 patilvishal0597 force-pushed the issue-336-default-description-in-tools branch from 9ab7d23 to 9575ecd Compare February 6, 2025 22:17
Copy link
Collaborator

@michaelnchin michaelnchin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

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

Successfully merging this pull request may close these issues.

tools require a filled description
2 participants