You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a simple tool that returns some data from a database. It does not need an argument. As a result of not having an argument, it fails in ways that are hard to debug.
When invoking the tool directly in the dev ui, it works appropriately.
However, when used in a flow. the tool (with no input schema) errors with:
INVALID_ARGUMENT: Schema validation failed. Parse Errors: - tools.2.inputSchema: must be object
with z.object({}), it errors in the flow and direct invocation with:
flow: [GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash-latest:generateContent: [400 Bad Request] * GenerateContentRequest.tools[0].function_declarations[2].parameters.properties: should be non-empty for OBJECT type
Yorkemartin
changed the title
[Tooling] Tools fail with input schemas undefined, defined as empty objects, or as z.any().
[Tooling] Tools fail if defined without arguments
Aug 22, 2024
This has been fixed in #822, but it's currently in our branch for the next major release of Genkit so it may be a little time before it hits a release.
Describe the bug
I have a simple tool that returns some data from a database. It does not need an argument. As a result of not having an argument, it fails in ways that are hard to debug.
When invoking the tool directly in the dev ui, it works appropriately.
However, when used in a flow. the tool (with no input schema) errors with:
INVALID_ARGUMENT: Schema validation failed. Parse Errors: - tools.2.inputSchema: must be object
with z.object({}), it errors in the flow and direct invocation with:
flow:
[GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash-latest:generateContent: [400 Bad Request] * GenerateContentRequest.tools[0].function_declarations[2].parameters.properties: should be non-empty for OBJECT type
tool:
`TRPCClientError: INVALID_ARGUMENT: Schema validation failed. Parse Errors:
(root): must be object`
with z.any() the tool works, and returns a populated object, but the flow errors with
Cannot read properties of undefined (reading 'toUpperCase') TypeError: Cannot read properties of undefined (reading 'toUpperCase') at convertSchemaProperty (/Users/connor/fora-echo/node_modules/@genkit-ai/googleai/lib/gemini.js:234:78)
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: