Skip to content

Commit

Permalink
fix(go/samples):
Browse files Browse the repository at this point in the history
* fix the curl script demo in comments
* bugfix: nil as opts param cause panic

Signed-off-by: herodot <[email protected]>
  • Loading branch information
bitsark committed Jan 21, 2025
1 parent 3a30f31 commit ee094d1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions go/samples/coffee-shop/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
//
// Tell it to run a flow:
//
// curl -d '{"key":"/flow/simpleGreeting/simpleGreeting", "input":{"start": {"input":{"customerName": "John Doe"}}}}' http://localhost:3100/api/runAction
// curl -d '{"data":{"key":"/flow/simpleGreeting/simpleGreeting", "input":{"start": {"input":{"customerName": "John Doe"}}}}}' http://localhost:3100/api/runAction
//
// In production mode (GENKIT_ENV missing or set to "prod"):
// Start the server listening on port 3400:
Expand All @@ -30,7 +30,7 @@
//
// Tell it to run a flow:
//
// curl -d '{"customerName": "Stimpy"}' http://localhost:3400/simpleGreeting
// curl -d '{"data":{"customerName": "Stimpy"}}' http://localhost:3400/simpleGreeting

package main

Expand Down
2 changes: 1 addition & 1 deletion go/samples/flow-sample1/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
//
// Tell it to run a flow:
//
// curl -d '{"key":"/flow/parent/parent", "input":{"start": {"input":null}}}' http://localhost:3100/api/runAction
// curl -d '{"data":{"key":"/flow/parent/parent", "input":{"start": {"input":null}}}}' http://localhost:3100/api/runAction
//
// In production mode (GENKIT_ENV missing or set to "prod"):
// Start the server listening on port 3400:
Expand Down
2 changes: 1 addition & 1 deletion go/samples/pgvector/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
//
// Ask a question:
//
// curl -d '{"Show": "Best Friends", "Question": "Who does Alice love?"}' http://localhost:3400/askQuestion
// curl -d '{"data":{"Show": "Best Friends", "Question": "Who does Alice love?"}}' http://localhost:3400/askQuestion
package main

import (
Expand Down
5 changes: 2 additions & 3 deletions go/samples/rag/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
//
// Tell it to run a flow:
//
// curl -d '{"key":"/flow/simpleQaFlow/simpleQaFlow", "input":{"start": {"input":{"question": "What is the capital of UK?"}}}}' http://localhost:3100/api/runAction
// curl -d '{"data":{"key":"/flow/simpleQaFlow/simpleQaFlow", "input":{"start": {"input":{"question": "What is the capital of UK?"}}}}}' http://localhost:3100/api/runAction
//
// In production mode (GENKIT_ENV missing or set to "prod"):
// Start the server listening on port 3400:
Expand All @@ -30,7 +30,7 @@
//
// Tell it to run a flow:
//
// curl -d '{"question": "What is the capital of UK?"}' http://localhost:3400/simpleQaFlow
// curl -d '{"data":{"question": "What is the capital of UK?"}}' http://localhost:3400/simpleQaFlow

package main

Expand Down Expand Up @@ -123,7 +123,6 @@ func main() {

resp, err := simpleQaPrompt.Generate(ctx, g,
dotprompt.WithInput(promptInput),
nil,
)
if err != nil {
return "", err
Expand Down

0 comments on commit ee094d1

Please sign in to comment.