Skip to content

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

@ssbushi

Description

@ssbushi

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):

  • OS: Linux Debian

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggo

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions