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
2 changes: 1 addition & 1 deletion packages/ai/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ result = await evals.run(
)
```

`LD_API_TOKEN` is required. Configure `LD_SDK_KEY` — or initialize your own client with `init_client(client=...)` — to emit one `$ld:ai:offline-evals:generation` event per generated row, plus one `$ld:ai:offline-evals:criterion` event per `(row, criterion)` when `criteria` are supplied, through the standard SDK event transport. The SDK reports scores; LaunchDarkly rules on them at ingest. A judge served by a different provider than `generation` needs a handler for it in `judge_handlers`. Use `LD_API_BASE_URI` for staging or local management API traffic; it is separate from the SDK delivery setting `LD_BASE_URI`. Evaluation-run links use the explicit `ui_base_uri` option or `LD_UI_BASE_URI` (for example, `https://ld-stg.launchdarkly.com` in staging), defaulting to `https://app.launchdarkly.com`. See the [core evaluations guide](../client/README.md#run-an-evaluation-from-code).
`LD_API_TOKEN` is required. Configure `LD_SDK_KEY` — or initialize your own client with `init_client(client=...)` — to emit one `$ld:ai:offline-evals:generation` event per generated row, plus one `$ld:ai:offline-evals:criterion` event per `(row, criterion)` when `criteria` are supplied, through the standard SDK event transport. The SDK reports scores; LaunchDarkly rules on them at ingest. A judge served by a different provider than `generation` needs a handler for it in `judge_handlers`. Use `LD_API_BASE_URI` for staging or local management API traffic; it is separate from the SDK delivery setting `LD_BASE_URI`. Evaluation-run links use the explicit `ui_base_uri` option or `LD_UI_BASE_URI`, defaulting to `https://app.launchdarkly.com`; set it when the project is not in production, or a run created elsewhere still links to the production app. See the [core evaluations guide](../client/README.md#run-an-evaluation-from-code).

---

Expand Down
2 changes: 1 addition & 1 deletion packages/client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ No code changes are required — `init_client()` detects the packages at runtime
| `LD_API_TOKEN` | For evaluations | API access token used by the evaluations management API |
| `LD_SDK_KEY` | For evaluations | SDK key whose event transport carries generation results to LaunchDarkly |
| `LD_API_BASE_URI` | No | Evaluations management API host override; intentionally separate from `LD_BASE_URI` |
| `LD_UI_BASE_URI` | No | LaunchDarkly application host for evaluation-run links (default: `https://app.launchdarkly.com`; staging: `https://ld-stg.launchdarkly.com`) |
| `LD_UI_BASE_URI` | No | LaunchDarkly application host for evaluation-run links (default: `https://app.launchdarkly.com`). Set it for a non-production project, or its runs still link to the production app |

### Run an evaluation from code

Expand Down
4 changes: 2 additions & 2 deletions packages/client/tests/test_evaluations.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,15 +180,15 @@ def test_ui_base_uri_precedence_and_api_base_isolation(
monkeypatch.setenv("LD_API_TOKEN", "api-token")
monkeypatch.setenv("LD_SDK_KEY", "sdk-key")
monkeypatch.setenv("LD_API_BASE_URI", "https://api.staging.example.com")
monkeypatch.setenv("LD_UI_BASE_URI", "https://ld-stg.launchdarkly.com/")
monkeypatch.setenv("LD_UI_BASE_URI", "https://ui.staging.example.com/")

from_env = init_evaluations(transport=RecordingTransport())
explicit = init_evaluations(
ui_base_uri="https://ui.example.com/", transport=RecordingTransport()
)

assert from_env.api.base_uri == "https://api.staging.example.com"
assert from_env.ui_base_uri == "https://ld-stg.launchdarkly.com"
assert from_env.ui_base_uri == "https://ui.staging.example.com"
assert explicit.ui_base_uri == "https://ui.example.com"


Expand Down
Loading