-
Notifications
You must be signed in to change notification settings - Fork 475
Open
Labels
Description
Describe the bug
If we define a prompt with both ai.WithOutputType
and ai.WithTool
, the generated "toolRequest" result fail with the error:
model failed to generate output matching expected schema: data is not valid JSON: unexpected end of JSON input.
Without ai.WithOutputType
, the "toolRequest" is handled correctly.
To Reproduce
tool := genkit.DefineTool(....)
prompt := genkit.DefinePrompt(
g,
"prompt",
ai.WithPrompt("my prompt"),
ai.WithInputType(Input{}),
ai.WithOutputType(Output{}),
ai.WithTools(tool),
)
prompt.Execute(ctx, ai.WithInput(in))
Expected behavior
"toolRequests" should be handled correctly when used in combination with ai.WithOutputType
Screenshots
If applicable, add screenshots to help explain your problem.
Runtime (please complete the following information):
- OS: MacOS
- Version 15.7
** Go version
- 1.25.1
Additional context
Add any other context about the problem here.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
No status