genkit icon indicating copy to clipboard operation
genkit copied to clipboard

[JS] Create a middleware to stringify data parts when ingesting, apply to Gemini plugins

Open mbleigh opened this issue 1 year ago • 0 comments

Describe the bug From a Discord thread, if Gemini returns data (JSON mode) it chokes on followup messages.

To Reproduce

  1. Generate structured output with JSON mode Gemini
  2. Pass that back into history

Expected behavior It works.

Suggested Fix Create a new model middleware that will automatically map through input data parts and convert them to text parts using JSON.stringify.

mbleigh avatar Sep 06 '24 17:09 mbleigh