Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/API_REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ get_prompt(name, version: nil, label: nil, fallback: nil, type: nil)
| `name` | String | Yes | Prompt name |
| `version` | Integer | No | Specific version (mutually exclusive with `label`) |
| `label` | String | No | Version label (e.g., "production") |
| `fallback` | String | No | Fallback template if not found |
| `fallback` | String, Array<Hash> | No | Fallback prompt if not found (String for text, Array<Hash> for chat) |
| `type` | Symbol | Conditional | `:text` or `:chat` (required if `fallback` provided) |

**Returns:** `TextPromptClient` or `ChatPromptClient`
Expand All @@ -163,7 +163,7 @@ get_prompt(name, version: nil, label: nil, fallback: nil, type: nil)
**Examples:**

```ruby
# Latest version
# API default selection
prompt = client.get_prompt("greeting")

# Specific version
Expand Down
2 changes: 1 addition & 1 deletion docs/CACHING.md
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ config.cache_stale_while_revalidate = !Rails.env.development?

# Production: enabled for best performance
if Rails.env.production?
config.cache_stale_ttl = config.cache_ttl # Auto-set, but can customize
config.cache_stale_ttl = config.cache_ttl # Set explicitly (common default)
end
```

Expand Down
6 changes: 3 additions & 3 deletions docs/PROMPTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,13 @@ prompt = client.get_prompt("greeting", label: "production") # => version 3

### Best Practices

1. **Default to production:** Omitting `version`/`label` fetches the `production`-labeled prompt (matching JS/Python SDK behavior)
2. **Use labels in production:** Pin to `production` label for stability
1. **Be explicit in production:** Use `label: "production"` for deterministic prompt selection
2. **Treat implicit selection as API-defined:** If you omit `version` and `label`, selection behavior is determined by the Langfuse API
3. **Version for rollback:** Keep version numbers for emergency rollbacks

```ruby
# Development
prompt = client.get_prompt("greeting") # Latest version
prompt = client.get_prompt("greeting") # Uses Langfuse API default selection

# Production
prompt = client.get_prompt("greeting", label: "production") # Stable
Expand Down
Loading