From 5db33a071e01d68987f81913cd1f4ac906d84033 Mon Sep 17 00:00:00 2001 From: kadekillary Date: Mon, 6 Apr 2026 07:04:07 -0600 Subject: [PATCH] [ML-931] docs: align docs with implementation --- docs/API_REFERENCE.md | 4 ++-- docs/CACHING.md | 2 +- docs/PROMPTS.md | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/API_REFERENCE.md b/docs/API_REFERENCE.md index 1cd8be3..9d14e20 100644 --- a/docs/API_REFERENCE.md +++ b/docs/API_REFERENCE.md @@ -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 | No | Fallback prompt if not found (String for text, Array for chat) | | `type` | Symbol | Conditional | `:text` or `:chat` (required if `fallback` provided) | **Returns:** `TextPromptClient` or `ChatPromptClient` @@ -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 diff --git a/docs/CACHING.md b/docs/CACHING.md index 2d4ff76..af480a4 100644 --- a/docs/CACHING.md +++ b/docs/CACHING.md @@ -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 ``` diff --git a/docs/PROMPTS.md b/docs/PROMPTS.md index df1060d..cfc2876 100644 --- a/docs/PROMPTS.md +++ b/docs/PROMPTS.md @@ -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