basic-prompts

command
v1.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 6, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

This sample demonstrates prompts using both inline code definitions and .prompt files (Dotprompt). It shows simple prompts, structured output with typed schemas, and complex prompts with Handlebars conditionals.

To run:

go run .

In another terminal, test a simple joke flow:

curl -N -X POST http://localhost:8080/simpleJokePromptFlow \
  -H "Content-Type: application/json" \
  -d '{"data": "bananas"}'

Test a structured joke flow (returns JSON):

curl -N -X POST http://localhost:8080/structuredJokePromptFlow \
  -H "Content-Type: application/json" \
  -d '{"data": {"topic": "bananas"}}'

Test a recipe flow:

curl -N -X POST http://localhost:8080/recipePromptFlow \
  -H "Content-Type: application/json" \
  -d '{"data": {"dish": "tacos", "cuisine": "Mexican", "servingSize": 4}}'

Test an assistant flow (with all middleware: retry, fallback, filesystem, skills):

curl -N -X POST http://localhost:8080/assistantPromptFlow \
  -H "Content-Type: application/json" \
  -d '{"data": "what files are in my current directory?"}'

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL