Metadata-Version: 2.5
Name: launchdarkly-ai-typesafe
Version: 0.1.1
Summary: TypeSafe Jev handler for LaunchDarkly AI SDK judges
Project-URL: Homepage, https://github.com/launchdarkly/python-ai-sdk
Project-URL: Repository, https://github.com/launchdarkly/python-ai-sdk
Project-URL: Bug Tracker, https://github.com/launchdarkly/python-ai-sdk/issues
Author-email: LaunchDarkly <team@launchdarkly.com>
License-Expression: Apache-2.0
Keywords: ai,jev,launchdarkly,typesafe
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.12
Requires-Dist: launchdarkly-ai-server
Requires-Dist: opentelemetry-api>=1.25
Requires-Dist: typesafe-sdk>=0.6
Description-Content-Type: text/markdown

# `launchdarkly-ai-typesafe`

Judge handler for TypeSafe Jev. A judge AI Config whose provider is `TypeSafe` is routed here. Judge mode already normalizes to `messages`, so the handler registers as `("TypeSafe", "messages")`.

Jev does not return the `{score, reasoning}` JSON other judges use. The questions are the variation's `classifiers` list, sent as Jev `noul`, `choice`, and `score` questions. `extract_typesafe_questions` is the only reader of that list.

Each label becomes its own `judge_results` entry, keyed `judge_key.label_key`, and carries that label's `event_key`. The entry's `response` is the selected label value. Every entry carries the full token usage of the one Jev call. LaunchDarkly token telemetry is recorded once for that call. Each label is tracked on its own `eventKey`.

The client reads `TYPESAFE_API_KEY` from the environment.

```python
from launchdarkly_ai_typesafe import create_typesafe_handler
from launchdarkly_ai_server import config

result = await config(
    key="my-config",
    handler=create_typesafe_handler(),
).invoke(user_input, context)
```
