Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Examples

Each directory contains a standalone main.go demonstrating a specific use case.

Provider middlewares

Directory Description Required env vars
openai OpenAI chat completions + streaming OPENAI_API_KEY
anthropic Anthropic Messages API + streaming ANTHROPIC_API_KEY
gemini Google Gemini GenerateContent + streaming GEMINI_API_KEY
xai xAI (Grok) chat completions + streaming XAI_API_KEY

Advanced

Directory Description Required env vars
custom-middleware Build your own middleware using http.RoundTripper OPENAI_API_KEY
read-api Query traces, observations, scores, sessions, datasets, prompts --

All examples require LANGFUSE_PUBLIC_KEY and LANGFUSE_SECRET_KEY to be set.

Running

export LANGFUSE_PUBLIC_KEY="pk-lf-..."
export LANGFUSE_SECRET_KEY="sk-lf-..."
export OPENAI_API_KEY="sk-..."

go run ./examples/openai