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
Describe the bug
The Genkit mechanism for matching up tool requests with their responses is by providing a "ref" to disambiguate. However, the current Gemini implementation does not do this. If two calls are made in parallel to the same tool, they do not have refs.
This causes problems such as #2218 when trying to run logic to match up requests and responses.
To Reproduce
constgetWeather=ai.defineInterrupt({name: "getWeather",description: "get the weather for a location",inputSchema: z.object({location: z.string()}),});const{ messages }=awaitai.generate({prompt: "Get the weather for New York and San Francisco",tools: [getWeather],});
Expected behavior
Each tool request in the returned messages has a ref on it. Instead, none.
Additional context
Gemini does not return any kind of identifiers on its tool requests - but they do appear in an ordered list. What I think we ought to do is translate the array index of the tool requests into the ref (e.g. "0", "1" etc) so that Genkit's logic can handle it.
Then, when translating a request to Gemini, pass the responses in ref order by parsing them back into integers and sorting them. If the responses don't have a ref...well, I guess just put those at the end after the ones that do?
The text was updated successfully, but these errors were encountered:
Describe the bug
The Genkit mechanism for matching up tool requests with their responses is by providing a "ref" to disambiguate. However, the current Gemini implementation does not do this. If two calls are made in parallel to the same tool, they do not have refs.
This causes problems such as #2218 when trying to run logic to match up requests and responses.
To Reproduce
Expected behavior
Each tool request in the returned messages has a
ref
on it. Instead, none.Additional context
Gemini does not return any kind of identifiers on its tool requests - but they do appear in an ordered list. What I think we ought to do is translate the array index of the tool requests into the ref (e.g.
"0"
,"1"
etc) so that Genkit's logic can handle it.Then, when translating a request to Gemini, pass the responses in ref order by parsing them back into integers and sorting them. If the responses don't have a ref...well, I guess just put those at the end after the ones that do?
The text was updated successfully, but these errors were encountered: