firebase / genkit

An open source framework for building AI-powered apps with familiar code-centric patterns. Genkit makes it easy to develop, integrate, and test AI features with observability and evaluations. Genkit works with various models and platforms.
Apache License 2.0
735 stars 107 forks source link

[Tooling] The prompt playground does not shows the output when it is a JSON format #221

Closed Jacquesjh closed 3 months ago

Jacquesjh commented 5 months ago

Describe the bug When experimenting in the prompt playground, the model response will not appear if the output is a JSON. The only way to see the output is viewing it's trace. When the output is text it works fine.

Screenshots image image

MichaelDoyle commented 5 months ago

Would it be possible to provide a representative output from the model and/or trace? Also, which model?

MichaelDoyle commented 5 months ago

Any additional info you can provide on this one? We're happy to look into it. @Jacquesjh

shrutip90 commented 3 months ago

I tried to test this out. One of our samples (js/testapps/flow-simple-ai) has a prompt with json output. It seems to be displaying the output in the prompt playground fine:

image

I am going to close this one for now as there was no information provided by the user. Please reopen if you have a specific use case with the issue and provide more details about it. Thanks!

MichaelDoyle commented 3 months ago

@shrutip90 Maybe one thing to double check; in the screenshot the schema is not an object, but an array. Does that have any impact?

shrutip90 commented 3 months ago

@shrutip90 Maybe one thing to double check; in the screenshot the schema is not an object, but an array. Does that have any impact?

Thanks @MichaelDoyle. Tested that out too. I changed the sample to output an array of reasonings:

model: vertexai/gemini-1.0-pro input: schema: question: string output: format: json schema: answer: string, the answer to the question id: string, the selected id of the saying reasoning(array): string, why the saying applies to the question

and it still works: image