# Public API of launchdarkly_ai_server. Generated by `make api-report`; do not edit.
add_cached_tokens_to_input(raw_usage: dict[str, Any]) -> SpanUsage
AiConfigRep = dict[str, Any]
all_skills() -> list[Skill]  [async]
any_multimodal(turns: list[dict[str, Any]]) -> bool
build_judge_tasks(*, config: AiConfigRep, user_context: LDContext, handler: ProviderHandler, handlers: list[ProviderHandler] | None = None, llm_response: str, base_track_data: TrackData, user_input: str | None = None, trajectory: str = '') -> list[JudgeTask]  [async]
compose(a: Registry, b: Registry) -> Registry
compose_history(*, history: list[dict[str, Any]], user_input: str | None = None, config_messages: list[dict[str, Any]] | None = None) -> list[dict[str, Any]]
config(*, key: str, handler: ProviderHandler | list[ProviderHandler] | None = None, tool_handlers: dict[str, Callable[..., Any] | NativeTool] | None = None, registry: Any = None, skip_judges: bool = False) -> ConfigInstance
config_skills(key: str, context: LDContext) -> SkillSource
ConfigInstance  [class]
  __init__(key: str, handler: ProviderHandler | list[ProviderHandler] | None, tool_handlers: dict[str, Callable[..., Any] | NativeTool] | None, registry: Any, skip_judges: bool = False)
  invoke(user_input: str | None, context: LDContext, variables: dict[str, Any] | None = None, history: list[dict[str, Any]] | None = None) -> ProviderResponse[Any]  [async]
  stream(user_input: str | None, context: LDContext, variables: dict[str, Any] | None = None, history: list[dict[str, Any]] | None = None) -> AsyncGenerator[StreamEvent, None]
configure(*, options: SDKOptions) -> None
content_to_text(content: MessageContent) -> str
conversation_id(conversation: str | None) -> Iterator[None]  [@contextmanager]
ConversationIdSpanProcessor(_SpanProcessorBase)  [class]
  force_flush(timeout_millis: int | None = None) -> bool
  on_end(span: Any) -> None
  on_start(span: Span, parent_context: otel_context.Context | None = None) -> None
  shutdown() -> None
create_handler(provides_for: tuple[str, Literal['agent', 'messages']], fn: _HandlerFn, stream_fn: _StreamFn | None = None, capture_content: bool | None = None) -> ProviderHandler
create_run_usage() -> RunUsage
end_span_once(span: Any, tracker: set[int], abandoned: bool = False, cancelled: bool = False) -> None
end_unfinished_spans(*spans: Any) -> None
execute_and_stream(*, config_key: str, config: AiConfigRep, meta: VariationMeta, user_context: LDContext, handler: ProviderHandler, user_input: str | None = None, tool_handlers: dict[str, Callable[..., Any] | NativeTool] | None = None, variables: dict[str, Any] | None = None, graph_key: str | None = None, history: list[dict[str, Any]] | None = None) -> AsyncGenerator[ExecuteStreamEvent, None]  [async]
execute_and_track(*, config_key: str, config: AiConfigRep, meta: VariationMeta, user_context: LDContext, handler: ProviderHandler, user_input: str | None = None, tool_handlers: dict[str, Callable[..., Any] | NativeTool] | None = None, variables: dict[str, Any] | None = None, graph_key: str | None = None, history: list[dict[str, Any]] | None = None) -> dict[str, Any]  [async]
ExecuteStreamDoneEvent = dict[str, Any]
ExecuteStreamEvent = dict[str, Any]
extract_variation(config_key: str, context: dict[str, Any]) -> dict[str, Any]  [async]
FDv2SkillStore  [class]
  __init__(sdk_key: str, *, base_uri: str | None = None, stream_uri: str | None = None, mode: Mode = 'stream', poll_interval: float = 30.0, read_timeout: float | None = None, initial_backoff: float = 1.0, max_backoff: float = 30.0, _requester: Any = None)
  __enter__() -> FDv2SkillStore
  __exit__(*_exc: Any) -> None
  add_listener(kind: str, fn: Callable[[dict[str, Any]], Any]) -> None
  all_objects(kind: str) -> dict[str, dict[str, Any]]
  close(timeout: float = 5.0) -> None
  diagnostics: StoreDiagnostics  [property]
  failed: str | None  [property]
  get_object(kind: str, key: str, version: int | None = None) -> dict[str, Any] | None
  is_initialized() -> bool
  remove_listener(kind: str, fn: Callable[[dict[str, Any]], Any]) -> None
  start() -> FDv2SkillStore
  wait_for_skills(timeout: float = 10.0) -> bool
get_client() -> Any
get_skill(key: str, *, version: int | None = None) -> Skill | None  [async]
get_skill_result(key: str, *, version: int | None = None) -> SkillOutcome  [async]
get_skills(refs: Sequence[SkillReference | str]) -> list[Skill]  [async]
global_registry = Registry()
graph(key: str, *, handlers: list[ProviderHandler] | None = None, tool_handlers: dict[str, Callable[..., Any] | NativeTool] | None = None, registry: Any = None, graph_judge: str | None = None) -> GraphInstance
GraphArgs = dict[str, Any]
GraphDefinition  [class]
  __init__(*, key: str, enabled: bool, root: GraphNode | None, get_node: Callable[[str], GraphNode | None], get_child_nodes: Callable[[str], list[GraphNode]], get_parent_nodes: Callable[[str], list[GraphNode]], terminal_nodes: Callable[[], list[GraphNode]], is_terminal: Callable[[str], bool], edges_from: Callable[[str], list[GraphEdge]], run_node: Callable[..., Any], route: Callable[..., Any], traverse: Callable[..., Any], reverse_traverse: Callable[..., Any])
  edges_from = edges_from
  enabled = enabled
  get_child_nodes = get_child_nodes
  get_node = get_node
  get_parent_nodes = get_parent_nodes
  is_terminal = is_terminal
  key = key
  reverse_traverse = reverse_traverse
  root = root
  route = route
  run_node = run_node
  terminal_nodes = terminal_nodes
  traverse = traverse
GraphEdge  [class, @dataclass]
  __init__(key: str, source_key: str, target_key: str, handoff: dict[str, Any] | None = None)
  handoff: dict[str, Any] | None = None
  key: str
  source_key: str
  target_key: str
GraphInstance  [class]
  __init__(key: str, options: dict[str, Any])
  invoke(user_input: str | None, context: LDContext, variables: dict[str, Any] | None = None, history: list[dict[str, Any]] | None = None) -> ProviderGraphResponse  [async]
  stream(user_input: str | None, context: LDContext, variables: dict[str, Any] | None = None, history: list[dict[str, Any]] | None = None) -> AsyncGenerator[GraphStreamEvent, None]
GraphNode  [class, @dataclass]
  __init__(key: str, config: AiConfigRep, meta: VariationMeta, edges: list[GraphEdge] = list(), is_terminal: bool = False)
  config: AiConfigRep
  edges: list[GraphEdge] = field(default_factory=list)
  is_terminal: bool = False
  key: str
  meta: VariationMeta
GraphOptions = dict[str, Any]
GraphStreamEvent = dict[str, Any]
GraphTopology = dict[str, Any]
HandlerResult = dict[str, Any]
HandlerStreamEvent  [class]
has_multimodal_content(content: MessageContent) -> bool
image_block_to_url(block: dict[str, Any]) -> str
init_client(options: InitClientOptions | None = None, client: Any = None) -> Any  [async]
InitClientOptions = dict[str, Any]
InMemorySkillStore  [class]
  __init__(objects: dict[str, dict[str, Any]] | None = None)
  add_listener(kind: str, fn: Callable[[dict[str, Any]], Any]) -> None
  all_objects(kind: str) -> dict[str, dict[str, Any]]
  get_object(kind: str, key: str, version: int | None = None) -> dict[str, Any] | None
  put(raw: dict[str, Any]) -> None
  remove_listener(kind: str, fn: Callable[[dict[str, Any]], Any]) -> None
InputTokenDetails  [class, @dataclass]
  __init__(uncached: int = 0, cache_read: int = 0, cache_creation: int = 0)
  cache_creation: int = 0
  cache_read: int = 0
  uncached: int = 0
inspect_config(config_key: str, context: dict[str, Any]) -> dict[str, Any]  [async]
is_content_blocks(content: MessageContent) -> bool
JudgeResult  [class, @dataclass]
  __init__(usage: UsageDict, response: str, score: float, event_key: str | None = None)
  event_key: str | None = None
  response: str
  score: float
  usage: UsageDict
JudgeRunResult  [class, @dataclass]
  __init__(score: float, response: str, usage: UsageDict, track_data: TrackData, results: dict[str, JudgeResult] | None = None, metrics: list[dict[str, Any]] | None = None, event_key: str | None = None)
  event_key: str | None = None
  metrics: list[dict[str, Any]] | None = None
  response: str
  results: dict[str, JudgeResult] | None = None
  score: float
  track_data: TrackData
  usage: UsageDict
JudgeTask  [class, @dataclass]
  __init__(config_key: str, judge_config: AiConfigRep, judge_meta: VariationMeta, actual_output: str, user_context: LDContext, judge_provider: str | None, judge_mode: str, collapse_messages: bool, parent_track_data: TrackData, variables: dict[str, Any] | None = None, evaluation_metric_key: str | None = None, user_input: str | None = None, trajectory: str = '')
  actual_output: str
  collapse_messages: bool
  config_key: str
  evaluation_metric_key: str | None = None
  judge_config: AiConfigRep
  judge_meta: VariationMeta
  judge_mode: str
  judge_provider: str | None
  parent_track_data: TrackData
  trajectory: str = ''
  user_context: LDContext
  user_input: str | None = None
  variables: dict[str, Any] | None = None
lang_chain_content_text(content: Any) -> str
lang_chain_finish_reasons(source: Any) -> list[str] | None
lang_chain_span_messages(messages: list[Any]) -> tuple[str | None, list[SpanMessage]]
lang_chain_span_usage(usage: dict[str, Any] | None) -> SpanUsage | None
LDClientInterface  [class]
  close() -> None  [async]
  flush() -> None  [async]
  track(event_name: str, context: LDContext, data: Any = None, metric_value: float | None = None) -> None
  variation(key: str, context: LDContext, default_value: Any) -> Any  [async]
LDContext = dict[str, Any]
make_track_data(node: GraphNode, graph_key: str, run_id: str) -> dict[str, Any]
MANIFEST_FILENAME = '.launchdarkly-skills.json'
MANIFEST_VERSION = 1
Message  [class]
  content: str
  role: Literal['user', 'assistant', 'system']
model_stamps_from_meta(meta: Any) -> dict[str, Any]
NATIVE_TOOL_KEY: str = '__ld_native_tool__'
NativeTool  [class]
  __init__(tool_name: str)
  id: object = object()
  tool_name: str = tool_name
normalize_mode(mode: str | None) -> Literal['agent', 'messages']
number_or_zero(value: Any) -> int
omit_model_stamps(track_data: Mapping[str, Any]) -> dict[str, Any]
OnUnavailable = Literal['keep', 'raise']
parse_ai_config(raw: Any) -> ParseResult
parse_json_with_possible_fences(raw_text: str) -> Any | None
parse_template(template: str, variables: dict[str, Any]) -> str
parse_usage(usage: dict[str, Any]) -> dict[str, Any]
ParseFailure  [class, @dataclass]
  __init__(success: Literal[False], error: dict[str, str])
  error: dict[str, str]
  success: Literal[False]
ParseResult = ParseSuccess[Any] | ParseFailure
ParseSuccess(Generic[T])  [class, @dataclass]
  __init__(success: Literal[True], data: T)
  data: T
  success: Literal[True]
ProviderGraphResponse  [class, @dataclass]
  __init__(response: str, usage: UsageDict, judge_results: dict[str, JudgeResult] | None = None)
  judge_results: dict[str, JudgeResult] | None = None
  response: str
  usage: UsageDict
ProviderHandler  [class]
  __init__(fn: _HandlerFn, provides_for: tuple[str, Literal['agent', 'messages']] | None = None, stream_fn: _StreamFn | None = None, capture_content: bool | None = None)
  __call__(config: AiConfigRep, user_input: str | None = None, tool_handlers: dict[str, Any] | None = None, variables: dict[str, Any] | None = None, history: list[dict[str, Any]] | None = None) -> HandlerResult  [async]
  capture_content: bool  [property]
  has_stream: bool  [property]
  provides_for: tuple[str, Literal['agent', 'messages']] | None = provides_for
  stream(config: AiConfigRep, user_input: str | None = None, tool_handlers: dict[str, Any] | None = None, variables: dict[str, Any] | None = None, history: list[dict[str, Any]] | None = None) -> AsyncGenerator[dict[str, Any], None]  [async]
ProviderResponse(Generic[T])  [class, @dataclass]
  __init__(response: T, usage: UsageDict, judge_results: dict[str, JudgeResult] | None = None, judge_tasks: list[JudgeTask] | None = None, track_data: TrackData | None = None)
  judge_results: dict[str, JudgeResult] | None = None
  judge_tasks: list[JudgeTask] | None = None
  response: T
  track_data: TrackData | None = None
  usage: UsageDict
ReconcileAction  [class, @dataclass(frozen=True)]
  __init__(key: str, action: ReconcileActionKind, version: int | None = None, path: str | None = None, error: str | None = None)
  action: ReconcileActionKind
  error: str | None = None
  key: str
  path: str | None = None
  version: int | None = None
ReconcileActionKind = Literal['written', 'updated', 'skipped_current', 'removed', 'error']
ReconcileReport  [class, @dataclass(frozen=True)]
  __init__(actions: list[ReconcileAction] = list())
  actions: list[ReconcileAction] = field(default_factory=list)
  errors: list[ReconcileAction]  [property]
  ok: bool  [property]
register_ai_sdk_package(name: str, version: str) -> None
Registry  [class]
  __init__(*, handlers: list[ProviderHandler] | None = None, tools: dict[str, Callable[..., Any] | NativeTool] | None = None)
  handlers: list[ProviderHandler]  [property]
  register(*, handlers: list[ProviderHandler] | None = None, tools: dict[str, Callable[..., Any] | NativeTool] | None = None) -> None
  tools: dict[str, Callable[..., Any] | NativeTool]  [property]
report_usage(helper: str, package_name: str | None = None, package_version: str | None = None) -> None
resolve_graph(key: str, *, context: LDContext, handlers: list[ProviderHandler] | None = None, tool_handlers: dict[str, Callable[..., Any] | NativeTool] | None = None, registry: Any = None) -> GraphDefinition  [async]
resolve_handlers(registry: Registry | None, local_handlers: list[ProviderHandler] | None) -> list[ProviderHandler] | None
resolve_tools(registry: Registry | None, local_tools: dict[str, Callable[..., Any] | NativeTool] | None) -> dict[str, Callable[..., Any] | NativeTool] | None
run_judge(task: JudgeTask, handlers: list[ProviderHandler]) -> JudgeRunResult | None  [async]
run_judges(*, config: AiConfigRep, user_context: LDContext, handler: ProviderHandler, handlers: list[ProviderHandler] | None = None, user_input: str | None, llm_response: str, base_track_data: TrackData, tool_handlers: dict[str, Callable[..., Any] | NativeTool] | None = None, graph_key: str | None = None, trajectory: str = '') -> dict[str, JudgeResult]  [async]
RunUsage  [class, @dataclass]
  __init__(total: SpanUsage = SpanUsage(), _turns: int = 0)
  add(turn: SpanUsage | None) -> None
  reported: bool  [property]
  total: SpanUsage = field(default_factory=SpanUsage)
SDK_INFO_CONTEXT: LDContext = {'kind': 'ld_ai', 'key': 'ld-internal-tracking', 'anonymous': True}
SDK_INFO_EVENT = '$ld:ai:sdk:info'
SDKOptions  [class, @dataclass(frozen=True)]
  __init__(capture_content: bool = False)
  __post_init__() -> None
  capture_content: bool = False
set_conversation_id_if_absent(span: Any, conversation: str) -> None
set_input_content_attributes(span: Any, capture: bool, *, system_instructions: str | None = None, messages: list[SpanMessage] | None = None, tool_definitions: list[ToolDefinitionInput] | None = None) -> None
set_ld_span_attributes(span: Any, variables: dict[str, Any] | None) -> None
set_model_identity_attributes(span: Any, provider_name: str, request_model: str, legacy_system: str | None = None) -> None
set_output_content_attributes(span: Any, capture: bool, messages: list[SpanMessage]) -> None
set_skill_store(store: SkillStore | None) -> None
set_tool_call_content_attributes(span: Any, capture: bool, *, arguments: Any = None, result: Any = None) -> None
set_tool_definition_attributes(span: Any, capture: bool, tools: list[ToolDefinitionInput]) -> None
set_usage_span_attributes(span: Any, usage: SpanUsage) -> None
shutdown() -> None  [async]
Skill  [class, @dataclass(frozen=True)]
  __init__(key: str, version: int, content: bytes, content_hash: str, name: str | None = None, description: str | None = None)
  content: bytes
  content_hash: str
  description: str | None = None
  key: str
  name: str | None = None
  version: int
SKILL_FILENAME = 'SKILL.md'
skill_refs(config: AiConfigRep | None) -> list[SkillReference]
SkillOutcome  [class, @dataclass(frozen=True)]
  __init__(skill: Skill | None, reason: SkillOutcomeReason, detail: str | None)
  detail: str | None
  reason: SkillOutcomeReason
  skill: Skill | None
SkillOutcomeReason = Literal['absent', 'integrity_failure', 'ok', 'store_unavailable', 'wrong_version']
SkillReference  [class, @dataclass(frozen=True)]
  __init__(key: str, version: int)
  key: str
  version: int
SkillSource  [class, @dataclass(frozen=True, init=False)]
  __init__(refs: Callable[[], Sequence[SkillReference | str] | Awaitable[Sequence[SkillReference | str]]], config_keys: Sequence[str] = ())
  config_keys: tuple[str, ...]
  refs: Callable[[], Sequence[SkillReference | str] | Awaitable[Sequence[SkillReference | str]]]
SkillStore(Protocol)  [class]
  all_objects(kind: str) -> dict[str, dict[str, Any]]
  get_object(kind: str, key: str, version: int | None = None) -> dict[str, Any] | None
SkillWatcher  [class]
  __init__(request: Sequence[Skill | SkillReference | str] | str | SkillSource, root: str | os.PathLike[str], store: Any, *, prune: bool, timeout: float, on_unavailable: OnUnavailable, debounce: float, on_reconcile: Callable[[ReconcileReport], Any] | None)
  __enter__() -> SkillWatcher
  __exit__(*_exc: Any) -> None
  close(timeout: float = 15.0) -> None
  notify(_raw: Any = None) -> None
  reconciles: int  [property]
SpanMessage  [class, @dataclass]
  __init__(role: str, parts: list[SpanMessagePart] = list(), finish_reason: str | None = None)
  finish_reason: str | None = None
  parts: list[SpanMessagePart] = field(default_factory=list)
  role: str
  to_canonical() -> dict[str, Any]
  to_text() -> str
SpanMessagePart  [class, @dataclass]
  __init__(type: Literal['text', 'reasoning', 'tool_call', 'tool_call_response'], content: str | None = None, id: str | None = None, name: str | None = None, arguments: Any = None, result: Any = None)
  arguments: Any = None
  content: str | None = None
  id: str | None = None
  name: str | None = None
  result: Any = None
  to_canonical() -> dict[str, Any]
  to_text() -> str
  type: Literal['text', 'reasoning', 'tool_call', 'tool_call_response']
SpanUsage  [class, @dataclass]
  __init__(input: int = 0, output: int = 0, cache_read: int = 0, cache_creation: int = 0)
  cache_creation: int = 0
  cache_read: int = 0
  input: int = 0
  output: int = 0
StoreDiagnostics  [class, @dataclass]
  __init__(payloads_transferred: int = 0, skill_objects_received: int = 0, objects_ignored: int = 0, objects_revoked: int = 0, payloads_ignored: int = 0, hashless_objects: int = 0, connection_failures: int = 0, last_error: str | None = None)
  connection_failures: int = 0
  hashless_objects: int = 0
  last_error: str | None = None
  objects_ignored: int = 0
  objects_revoked: int = 0
  payloads_ignored: int = 0
  payloads_transferred: int = 0
  skill_objects_received: int = 0
StreamChunkEvent = dict[str, Any]
StreamDoneEvent = dict[str, Any]
StreamEvent = dict[str, Any]
text_message(role: str, content: str) -> SpanMessage
to_ld_context(client: Any, context: dict[str, Any]) -> Any
to_semconv_finish_reason(raw: str | None) -> str | None
to_usage_dict(usage: dict[str, Any]) -> UsageDict
tool_result_string(value: Any) -> str
ToolDefinitionInput  [class, @dataclass]
  __init__(name: str, description: str | None = None, parameters: Any = None)
  description: str | None = None
  name: str
  parameters: Any = None
TrackData = dict[str, Any]
UsageDict  [class, @dataclass]
  __init__(input: int = 0, output: int = 0, total: int = 0, input_details: InputTokenDetails | None = None)
  input: int = 0
  input_details: InputTokenDetails | None = None
  output: int = 0
  total: int = 0
VariationMeta = dict[str, Any]
watch_skills(skills: Sequence[Skill | SkillReference | str] | str | SkillSource, root: str | os.PathLike[str], *, prune: bool = True, timeout: float = 10.0, on_unavailable: OnUnavailable = 'keep', debounce: float = DEFAULT_DEBOUNCE_SECONDS, on_reconcile: Callable[[ReconcileReport], Any] | None = None) -> tuple[ReconcileReport, SkillWatcher]  [async]
wrap_tool_handlers(tool_handlers: dict[str, Callable[..., Any] | NativeTool] | None, user_context: LDContext, track_data: TrackData) -> dict[str, Callable[..., Any]]
write_skills(skills: Sequence[Skill | SkillReference | str] | str | SkillSource, root: str | os.PathLike[str], *, prune: bool = True, timeout: float = 10.0, on_unavailable: OnUnavailable = 'keep') -> ReconcileReport  [async]
