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
6 changes: 3 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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.
Expand Down Expand Up @@ -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.

Expand Down
12 changes: 6 additions & 6 deletions packages/ai/agents.md
Original file line number Diff line number Diff line change
@@ -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.

---

Expand All @@ -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 |

---

Expand All @@ -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.

---

Expand All @@ -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
```
Expand Down Expand Up @@ -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.
4 changes: 2 additions & 2 deletions packages/claude-agents/agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down
4 changes: 2 additions & 2 deletions packages/claude-messages/agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down
2 changes: 1 addition & 1 deletion packages/client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion packages/client/agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions packages/langchain-agents/agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down
4 changes: 2 additions & 2 deletions packages/langchain-messages/agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down
4 changes: 2 additions & 2 deletions packages/openai-agents/agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down
4 changes: 2 additions & 2 deletions packages/openai-messages/agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down
Loading