You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If `client` is omitted, an `AsyncOpenAI` client is created using `OPENAI_API_KEY` from the environment.
73
160
74
-
-`create(ai_config: AIConfigKind, logger: Optional[Any] = None) -> OpenAIProvider` - Factory method to create a provider from an AI config
75
-
-`get_ai_metrics_from_response(response: Any) -> LDAIMetrics` - Extract metrics from an OpenAI response
161
+
#### Methods
76
162
77
-
#### Instance Methods
163
+
-`create_model(config) -> OpenAIModelRunner` — Create a runner for chat completions from an AI config.
164
+
-`create_agent(config, tools=None) -> OpenAIAgentRunner` — Create a runner for an OpenAI agent (experimental).
165
+
-`get_client() -> AsyncOpenAI` — Return the underlying `AsyncOpenAI` client.
78
166
79
-
-`invoke_model(messages: List[LDMessage]) -> ChatResponse` - Invoke the model with messages
80
-
-`invoke_structured_model(messages: List[LDMessage], response_structure: Dict[str, Any]) -> StructuredResponse` - Invoke the model with structured output
81
-
-`get_client() -> OpenAI` - Get the underlying OpenAI client
167
+
### OpenAIModelRunner
168
+
169
+
`OpenAIModelRunner` implements the `Runner` protocol for OpenAI chat completions.
-`run(input, output_type=None) -> RunnerResult` — Run the model with a string prompt or list of `LDMessage` objects. Pass `output_type` (JSON schema dict) for structured output.
180
+
181
+
### OpenAIAgentRunner
182
+
183
+
> [!CAUTION]
184
+
> This feature is experimental and should NOT be considered ready for production use.
185
+
> It may change or be removed without notice.
186
+
187
+
`OpenAIAgentRunner` implements the `Runner` protocol using the OpenAI Agents SDK
-`run(input, output_type=None) -> RunnerResult` — Run the agent with the given input. The tool-calling loop is handled internally. Returns `RunnerResult` with `content`, `metrics` (including `tool_calls`), and `raw`.
193
+
194
+
## Documentation
195
+
196
+
For full documentation, please refer to the [LaunchDarkly AI SDK documentation](https://docs.launchdarkly.com/sdk/ai/python).
197
+
198
+
## Contributing
199
+
200
+
See [CONTRIBUTING.md](../../../CONTRIBUTING.md) in the repository root.
0 commit comments