Skip to content

Commit

Permalink
📝 Add or update documentation: update structured output example
Browse files Browse the repository at this point in the history
  • Loading branch information
k33g committed Feb 8, 2025
1 parent 961eeaa commit 3afa6ee
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions examples/66-structured-outputs/.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# if working from a container
OLLAMA_HOST=http://host.docker.internal:11434
#OLLAMA_HOST=http://localhost:11434
#OLLAMA_HOST=http://host.docker.internal:11434
OLLAMA_HOST=http://localhost:11434
LLM=qwen2.5:1.5b

11 changes: 9 additions & 2 deletions examples/66-structured-outputs/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,19 @@ func main() {
if err != nil {
log.Fatalln("😡:", err)
}

ollamaUrl := os.Getenv("OLLAMA_HOST")
model := os.Getenv("LLM")
if ollamaUrl == "" {
ollamaUrl = "http://localhost:11434"
}

model := os.Getenv("LLM_CHAT")
if model == "" {
model = "qwen2.5:0.5b"
}

options := llm.SetOptions(map[string]interface{}{
option.Temperature: 0.0,
option.Temperature: 1.5,
})

// define schema for a structured output
Expand Down

0 comments on commit 3afa6ee

Please sign in to comment.