-
Notifications
You must be signed in to change notification settings - Fork 161
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 no args function call #16
Conversation
jzaldi
commented
Feb 19, 2024
- Fixed Key Error 'required' when defining a tool with no arguments.
- Added unit test for function utils
@@ -54,7 +54,7 @@ def _format_tool_to_vertex_function(tool: BaseTool) -> FunctionDescription: | |||
} | |||
for k, v in schema["properties"].items() | |||
}, | |||
"required": schema["required"], | |||
"required": schema.get("required", []), |
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.
nits: should we maybe just remove requried
arg if it's empty? it looks like it's not a required one
@@ -54,7 +54,7 @@ def _format_tool_to_vertex_function(tool: BaseTool) -> FunctionDescription: | |||
} | |||
for k, v in schema["properties"].items() | |||
}, | |||
"required": schema["required"], | |||
"required": schema.get("required", []), |
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.
should we update line #34 too?
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.
Wraped both blocks into a function, as it was duplicated code and make it so that if there is no required there's no key