-
Notifications
You must be signed in to change notification settings - Fork 594
Closed
Labels
Description
resp, err := genkit.Generate(ctx, g,
ai.WithModelName("googleai/gemini-2.5-flash"),
ai.WithMessages(h...),
ai.WithTools(convertTemperatureTool),
ai.WithStreaming(cb),
)when I say: "convert 20 c to f" I get chunks:
data: {"message": {"content":[{"toolRequest":{"input":{"from":"celsius","temperature":20,"to":"fahrenheit"},"name":"convertTemperature"}}]}}
data: {"message": {"content":[{"toolResponse":{"name":"convertTemperature","output":68}}],"role":"tool"}}
data: {"message": {"content":[{"text":"20 degrees Celsius is 68 degrees Fahrenheit."}]}}
but expect it to be the same as in JS, something like:
data: {"message":{"role":"model","index":0,"content":[{"toolRequest":{"name":"temperatureConverter","input":{"to":"F","from":"C","temperature":20},"ref":"0"}}]}}
data: {"message":{"role":"tool","index":1,"content":[{"toolResponse":{"name":"temperatureConverter","ref":"0","output":68}}]}}
data: {"message":{"role":"model","index":2,"content":[{"text":"2"}]}}
data: {"message":{"role":"model","index":2,"content":[{"text":"0 degrees Celsius is 68 degrees Fahrenheit."}]}}
Note the changing index.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done