firebase / genkit

An open source framework for building AI-powered apps with familiar code-centric patterns. Genkit makes it easy to integrate, test, and deploy sophisticated AI features to Firebase or Google Cloud.
Apache License 2.0
368 stars 45 forks source link

[Go] Flow server API payload does not match the JS API #259

Open ssbushi opened 1 month ago

ssbushi commented 1 month ago

Describe the bug The way to trigger flows in Go vs JS is not consistent at the moment.

Go: curl -d '{"customerName": "Stimpy"}' http://localhost:3400/testAllCoffeeFlows JS: curl -d '{"data": {"modelName": "vertexai/gemini-1.0-pro", "subject": "banana"}}' http://localhost:3400/jokeFlow -H "Content-Type: application/json"

Notice that the payload has to be wrapped in data field for JS.

To Reproduce Go: Run the coffee-shop sample (go run .) and trigger a flow using the above command. JS: Add startFlowServer() to the flow-simple-ai sample, start the genkit server (genkit start) and trigger a flow using the above command.

Expected behavior Both Go and JS have similar APIs (require the "data" wrapper field).

Runtime (please complete the following information):

Go version go version go1.23-20240419-RC02 cl/626470163 +7f76c00fc5 X:fieldtrack,boringcrypto linux/amd64

i14h commented 4 days ago

@ssbushi is this fixed?