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 no args function call #16

Merged
merged 4 commits into from
Feb 21, 2024

Conversation

jzaldi
Copy link
Contributor

@jzaldi 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", []),
Copy link
Collaborator

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", []),
Copy link
Collaborator

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?

Copy link
Contributor Author

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

@lkuligin lkuligin merged commit 2689bd3 into langchain-ai:main Feb 21, 2024
12 checks passed
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.

2 participants