diff --git a/AGENTS.md b/AGENTS.md index 179a297..861b24c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -85,7 +85,7 @@ graph TD newHandler["launchdarkly-ai-new-provider\n(future)"] end subgraph tier0 ["Tier 0 — Core"] - ai["launchdarkly-ai\n(convenience barrel)"] + ai["launchdarkly-ai-python\n(convenience barrel)"] client["launchdarkly-ai-server"] end @@ -104,9 +104,9 @@ graph TD ### Tiers - **Tier 0 — Core** (`launchdarkly-ai-server`): The foundation. Owns all LaunchDarkly integration, telemetry orchestration, shared data types, and the primary entry points (`config()`, `graph()`, `resolve_graph()`). Has no dependency on any other `launchdarkly-ai-*` package. -- **Tier 0 — Convenience barrel** (`launchdarkly-ai`): A pure re-export package that makes all of `launchdarkly-ai-server` available under a shorter install name. No new logic — intended as the default install for most Python applications. +- **Tier 0 — Convenience barrel** (`launchdarkly-ai-python`): A pure re-export package that makes all of `launchdarkly-ai-server` available under a shorter install name. No new logic — intended as the default install for most Python applications. - **Tier 1 — Handler packages** (`launchdarkly-ai-claude-agents`, `launchdarkly-ai-claude-messages`, `launchdarkly-ai-openai-agents`, `launchdarkly-ai-openai-messages`, `launchdarkly-ai-langchain-agents`, `launchdarkly-ai-langchain-messages`, …): Each wraps a specific AI provider SDK. Depends on `launchdarkly-ai-server` for shared types and utilities. Must not depend on other Tier 1 packages. -- **Tier 2 — Consumer applications** (e.g. `main.py`, downstream projects): Imports from one or more handler packages and either `launchdarkly-ai` or `launchdarkly-ai-server`. Owns tool implementations and orchestration logic. No `launchdarkly-ai-*` package should ever depend on Tier 2 code. +- **Tier 2 — Consumer applications** (e.g. `main.py`, downstream projects): Imports from one or more handler packages and either `launchdarkly-ai-python` or `launchdarkly-ai-server`. Owns tool implementations and orchestration logic. No `launchdarkly-ai-*` package should ever depend on Tier 2 code. ### Rules diff --git a/README.md b/README.md index 4c34a29..ea94a87 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ Tier 0 — Core Client (launchdarkly-ai-server) | Package | Description | | --- | --- | | [`launchdarkly-ai-server`](packages/client/README.md) | Core client — LaunchDarkly lifecycle, telemetry, shared types, `config()`, `graph()` | -| [`launchdarkly-ai`](packages/ai/README.md) | Convenience barrel — re-exports all of `launchdarkly-ai-server`. Install this for the simplest setup. | +| [`launchdarkly-ai-python`](packages/ai/README.md) | Convenience barrel — re-exports all of `launchdarkly-ai-server`. Install this for the simplest setup. | ### Handler Packages @@ -98,12 +98,12 @@ Tier 0 — Core Client (launchdarkly-ai-server) pip install launchdarkly-ai-python launchdarkly-ai-openai-messages ``` -`launchdarkly-ai` is a thin barrel that re-exports all of `launchdarkly-ai-server`. `init_client()` auto-discovers `launchdarkly-server-sdk` at runtime — no extra setup required. +`launchdarkly-ai-python` is a thin barrel that re-exports all of `launchdarkly-ai-server`. `init_client()` auto-discovers `launchdarkly-server-sdk` at runtime — no extra setup required. **With telemetry** (recommended for production) — traces export to the LaunchDarkly Observability dashboard: ```bash -pip install "launchdarkly-ai[otel]" launchdarkly-ai-openai-messages +pip install "launchdarkly-ai-python[otel]" launchdarkly-ai-openai-messages ``` No code changes are needed — `init_client()` detects whether the OTel packages are present at runtime and configures the tracer provider automatically. If they are absent, the SDK logs a one-time warning and continues normally. @@ -492,7 +492,7 @@ When running inside `graph()`, every node's events carry the graph key, tool inv The OpenTelemetry SDK packages are **optional** — detected at runtime via `importlib`. The LaunchDarkly server SDK (`launchdarkly-server-sdk`) is also an optional dependency; pass a pre-initialized client to `init_client(client=...)` if you bring your own. -**OTel packages** (installed via `pip install "launchdarkly-ai[otel]"` or `pip install "launchdarkly-ai-server[otel]"`): +**OTel packages** (installed via `pip install "launchdarkly-ai-python[otel]"` or `pip install "launchdarkly-ai-server[otel]"`): - **If installed:** `init_client()` sets up a `TracerProvider` with a GZIP-compressed OTLP HTTP exporter and W3C trace-context/baggage propagators — no code changes needed. - **If not installed:** `init_client()` logs a warning and continues. Feature flags and AI calls work normally; spans become no-ops. diff --git a/packages/ai/agents.md b/packages/ai/agents.md index 6bdc0d1..b962edc 100644 --- a/packages/ai/agents.md +++ b/packages/ai/agents.md @@ -1,6 +1,6 @@ -# Agent Guide — `launchdarkly-ai` (Convenience Wrapper) +# Agent Guide — `launchdarkly-ai-python` (Convenience Wrapper) -This document describes the role, structure, and constraints of the `launchdarkly-ai` package for AI agents and contributors. +This document describes the role, structure, and constraints of the `launchdarkly-ai-python` package for AI agents and contributors. --- @@ -18,7 +18,7 @@ Its purpose: Python application developers install this single package and get b | File | Responsibility | |---|---| -| `src/launchdarkly_ai/__init__.py` | Single `from launchdarkly_ai_server import *` — the entire public barrel | +| `src/launchdarkly_ai_python/__init__.py` | Single `from launchdarkly_ai_server import *` — the entire public barrel | --- @@ -30,7 +30,7 @@ This package re-exports everything from `launchdarkly-ai-server` and nothing els from launchdarkly_ai_server import * ``` -Every symbol available from `launchdarkly-ai-server` is available from `launchdarkly-ai` under the same name. No additional symbols are added. When `launchdarkly-ai-server` gains a new export, this package automatically picks it up. +Every symbol available from `launchdarkly-ai-server` is available from `launchdarkly-ai-python` under the same name. No additional symbols are added. When `launchdarkly-ai-server` gains a new export, this package automatically picks it up. --- @@ -49,7 +49,7 @@ This package itself emits no spans. OTel is initialized and configured by `launc Install the OTel packages alongside this package: ```sh -pip install "launchdarkly-ai[otel]" +pip install "launchdarkly-ai-python[otel]" # or: pip install launchdarkly-ai-python opentelemetry-sdk opentelemetry-exporter-otlp-proto-http ``` @@ -84,4 +84,4 @@ This package must remain a pure re-export barrel. Any new utility, type, or help ### 2. Do not import from both packages in the same application -Importing from both `launchdarkly-ai` and `launchdarkly-ai-server` in the same app can produce subtle issues if the dependency graph deduplication fails. Pick one: use `launchdarkly-ai` for standard Python apps, `launchdarkly-ai-server` for custom runtimes where you manage the SDK client yourself. The `get_client()` singleton is process-wide and shared regardless of which package path you import through. +Importing from both `launchdarkly-ai-python` and `launchdarkly-ai-server` in the same app can produce subtle issues if the dependency graph deduplication fails. Pick one: use `launchdarkly-ai-python` for standard Python apps, `launchdarkly-ai-server` for custom runtimes where you manage the SDK client yourself. The `get_client()` singleton is process-wide and shared regardless of which package path you import through. diff --git a/packages/claude-agents/agents.md b/packages/claude-agents/agents.md index 45f64c0..1f43d91 100644 --- a/packages/claude-agents/agents.md +++ b/packages/claude-agents/agents.md @@ -134,11 +134,11 @@ On error: `span.record_exception(exc)`, status set to ERROR, span ended, error r ## OTel Setup -This package emits one span per invocation using `opentelemetry-api`. **No OTel configuration is needed in this package** — the tracer provider is registered by `init_client()` in `launchdarkly-ai-server` (or `launchdarkly-ai`). +This package emits one span per invocation using `opentelemetry-api`. **No OTel configuration is needed in this package** — the tracer provider is registered by `init_client()` in `launchdarkly-ai-server` (or `launchdarkly-ai-python`). To receive spans, install the OTel SDK in your application: ```sh -pip install "launchdarkly-ai[otel]" +pip install "launchdarkly-ai-python[otel]" # or: pip install opentelemetry-sdk opentelemetry-exporter-otlp-proto-http ``` diff --git a/packages/claude-messages/agents.md b/packages/claude-messages/agents.md index 801a760..c640c2b 100644 --- a/packages/claude-messages/agents.md +++ b/packages/claude-messages/agents.md @@ -116,11 +116,11 @@ On error: `span.record_exception(exc)`, status ERROR, span ended, error re-raise ## OTel Setup -This package emits one span per invocation using `opentelemetry-api`. **No OTel configuration is needed in this package** — the tracer provider is registered by `init_client()` in `launchdarkly-ai-server` (or `launchdarkly-ai`). +This package emits one span per invocation using `opentelemetry-api`. **No OTel configuration is needed in this package** — the tracer provider is registered by `init_client()` in `launchdarkly-ai-server` (or `launchdarkly-ai-python`). To receive spans, install the OTel SDK in your application: ```sh -pip install "launchdarkly-ai[otel]" +pip install "launchdarkly-ai-python[otel]" # or: pip install opentelemetry-sdk opentelemetry-exporter-otlp-proto-http ``` diff --git a/packages/client/README.md b/packages/client/README.md index 8691bab..62b473c 100644 --- a/packages/client/README.md +++ b/packages/client/README.md @@ -4,7 +4,7 @@ The core package for the LaunchDarkly AI Python SDK. It owns the LaunchDarkly cl All handler packages (`launchdarkly-ai-*`) depend on this package. -> **Tip:** for the simplest install, use [`launchdarkly-ai`](../ai/README.md) instead. It re-exports this package's full API and is the recommended default for most applications. +> **Tip:** for the simplest install, use [`launchdarkly-ai-python`](../ai/README.md) instead. It re-exports this package's full API and is the recommended default for most applications. ## Installation diff --git a/packages/client/agents.md b/packages/client/agents.md index 9780296..a0fd5f3 100644 --- a/packages/client/agents.md +++ b/packages/client/agents.md @@ -133,7 +133,7 @@ The core client owns all OTel initialization. `init_client()` configures a `Trac pip install opentelemetry-sdk opentelemetry-exporter-otlp-proto-http \ opentelemetry-propagator-b3 # or via the extras: -pip install "launchdarkly-ai[otel]" +pip install "launchdarkly-ai-python[otel]" ``` **OTLP endpoint configuration** — the exporter uses the standard `OTEL_EXPORTER_OTLP_ENDPOINT` env var. The default (when not set) points to LaunchDarkly's hosted OTel collector. diff --git a/packages/langchain-agents/agents.md b/packages/langchain-agents/agents.md index c27997c..90693e9 100644 --- a/packages/langchain-agents/agents.md +++ b/packages/langchain-agents/agents.md @@ -139,11 +139,11 @@ Key implementation detail: `WorkflowState` is a `TypedDict` with an `Annotated[l ## OTel Setup -This package emits one span per invocation using `opentelemetry-api`. **No OTel configuration is needed in this package** — the tracer provider is registered by `init_client()` in `launchdarkly-ai-server` (or `launchdarkly-ai`). +This package emits one span per invocation using `opentelemetry-api`. **No OTel configuration is needed in this package** — the tracer provider is registered by `init_client()` in `launchdarkly-ai-server` (or `launchdarkly-ai-python`). To receive spans, install the OTel SDK in your application: ```sh -pip install "launchdarkly-ai[otel]" +pip install "launchdarkly-ai-python[otel]" # or: pip install opentelemetry-sdk opentelemetry-exporter-otlp-proto-http ``` diff --git a/packages/langchain-messages/agents.md b/packages/langchain-messages/agents.md index 1100c24..0b1f2be 100644 --- a/packages/langchain-messages/agents.md +++ b/packages/langchain-messages/agents.md @@ -126,11 +126,11 @@ On error: `span.record_exception(exc)`, status ERROR, span ended, error re-raise ## OTel Setup -This package emits one span per invocation using `opentelemetry-api`. **No OTel configuration is needed in this package** — the tracer provider is registered by `init_client()` in `launchdarkly-ai-server` (or `launchdarkly-ai`). +This package emits one span per invocation using `opentelemetry-api`. **No OTel configuration is needed in this package** — the tracer provider is registered by `init_client()` in `launchdarkly-ai-server` (or `launchdarkly-ai-python`). To receive spans, install the OTel SDK in your application: ```sh -pip install "launchdarkly-ai[otel]" +pip install "launchdarkly-ai-python[otel]" # or: pip install opentelemetry-sdk opentelemetry-exporter-otlp-proto-http ``` diff --git a/packages/openai-agents/agents.md b/packages/openai-agents/agents.md index 1af937a..4fd851c 100644 --- a/packages/openai-agents/agents.md +++ b/packages/openai-agents/agents.md @@ -126,11 +126,11 @@ On error: `span.record_exception(exc)`, status ERROR, span ended, error re-raise ## OTel Setup -This package emits one span per invocation using `opentelemetry-api`. **No OTel configuration is needed in this package** — the tracer provider is registered by `init_client()` in `launchdarkly-ai-server` (or `launchdarkly-ai`). +This package emits one span per invocation using `opentelemetry-api`. **No OTel configuration is needed in this package** — the tracer provider is registered by `init_client()` in `launchdarkly-ai-server` (or `launchdarkly-ai-python`). To receive spans, install the OTel SDK in your application: ```sh -pip install "launchdarkly-ai[otel]" +pip install "launchdarkly-ai-python[otel]" # or: pip install opentelemetry-sdk opentelemetry-exporter-otlp-proto-http ``` diff --git a/packages/openai-messages/agents.md b/packages/openai-messages/agents.md index cd00791..fc8fc82 100644 --- a/packages/openai-messages/agents.md +++ b/packages/openai-messages/agents.md @@ -114,11 +114,11 @@ On error: `span.record_exception(exc)`, status ERROR, span ended, error re-raise ## OTel Setup -This package emits one span per invocation using `opentelemetry-api`. **No OTel configuration is needed in this package** — the tracer provider is registered by `init_client()` in `launchdarkly-ai-server` (or `launchdarkly-ai`). +This package emits one span per invocation using `opentelemetry-api`. **No OTel configuration is needed in this package** — the tracer provider is registered by `init_client()` in `launchdarkly-ai-server` (or `launchdarkly-ai-python`). To receive spans, install the OTel SDK in your application: ```sh -pip install "launchdarkly-ai[otel]" +pip install "launchdarkly-ai-python[otel]" # or: pip install opentelemetry-sdk opentelemetry-exporter-otlp-proto-http ```