launchdarkly-ai-python
Convenience barrel package for the LaunchDarkly AI Python SDK. Re-exports the complete public API of launchdarkly-ai-server — install this instead of launchdarkly-ai-server for the simplest setup.
Installation
pip install launchdarkly-ai-python launchdarkly-ai-openai-messages
To enable trace export to the LaunchDarkly Observability dashboard, install the otel extras group:
pip install "launchdarkly-ai-python[otel]"
init_client() detects the OTel packages at runtime and configures tracing automatically. If the extras are not installed, a single warning is logged and all AI calls continue normally with no-op spans.
Usage
Import everything from launchdarkly_ai_python instead of launchdarkly_ai_server:
import asyncio
from launchdarkly_ai_python import config, graph, resolve_graph
from launchdarkly_ai_python import init_client, shutdown, global_registry
from launchdarkly_ai_openai_messages import create_openai_messages_handler
async def main():
result = await config(
key="my-ai-config-flag",
handler=create_openai_messages_handler(),
).invoke("What is feature flagging?", {"kind": "user", "key": "user-123"})
print(result.response)
await shutdown()
asyncio.run(main())
inspect_config(key, context)
Reads an AI Config flag variation without invoking any AI provider. Re-exported from launchdarkly-ai-server — see the full reference there.
from launchdarkly_ai_python import inspect_config
result = await inspect_config("my-ai-config-flag", {"kind": "user", "key": "user-123"})
if result["enabled"]:
print(result["config"]["model"]["name"])
Never raises. Returns {"enabled": bool, "config": dict | None, "meta": dict | None}.
All exports, types, and behaviors are identical to launchdarkly-ai-server. See the core client README for the full API reference.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file launchdarkly_ai_python-0.1.3.tar.gz.
File metadata
- Download URL: launchdarkly_ai_python-0.1.3.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c2552fd97e25a5e72833e2b0d604ed11a716041128ce65ea97dca078663a30b
|
|
| MD5 |
53521f13f82972fc0cd962e0f1c776e6
|
|
| BLAKE2b-256 |
6d14122995b87010859a01a519b1df638b846a581d3378af99cde3bb1ff04b74
|
File details
Details for the file launchdarkly_ai_python-0.1.3-py3-none-any.whl.
File metadata
- Download URL: launchdarkly_ai_python-0.1.3-py3-none-any.whl
- Upload date:
- Size: 2.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
87c48278272f0311cb5b02b0ff9aee8cb21aeb59fb3904842e8e28aa211d2c1e
|
|
| MD5 |
8eb12bd6a06a8aa0ebe7e443c352eb9d
|
|
| BLAKE2b-256 |
0e0628893430bb5c2528f331054f53ff6d3de05c30491ca776b8a3f079b8764e
|