aeat.adapters.outbound.llm._providers.openai module¶
OpenAI provider adapter for the LLM outbound subpackage.
Speaks the OpenAI /v1/chat/completions HTTP API and adapts its response
into the
ProviderCompletion
contract.
- class OpenAIAdapter(api_key, timeout_s)[source]¶
Bases:
_ProviderAdapterProvider adapter that invokes the OpenAI Chat Completions API.
A non-empty
api_keyis mandatory; the adapter refuses to construct without one because the underlying API rejects unauthenticated calls.-
provider:
LLMProvider¶
- async complete(request)[source]¶
Execute a Chat Completions request against the OpenAI API.
- Parameters:
request (
ProviderRequest) – Normalized provider request.- Return type:
- Returns:
A
ProviderCompletionwith the first choice’s trimmed text and reported token counts.- Raises:
LLMProviderError – When the API returns a 4xx or 5xx HTTP error status.
-
provider: