Expand description
OpenAI Chat Completions client implementing klieo_core::LlmClient.
Wraps OpenAI’s /v1/chat/completions and /v1/embeddings endpoints.
Capability declaration (tool_calling, streaming, structured_output,
embeddings, max_context_tokens) is computed at construction time from
the configured chat-model name; see capabilities::model_capabilities.
Sibling to klieo_llm_ollama — the two crates implement the same
LlmClient trait so a Box<dyn LlmClient> consumer can swap between
them without other code changes.
§Example
use klieo_llm_openai::OpenAiClient;
let client = OpenAiClient::new("sk-...", "gpt-4o-mini");§Limitations
- Vision input is not supported (the
visioncapability is alwaysfalse);gpt-4o’s image messages require aMessage::contentchange inklieo-corefirst. - Azure OpenAI and OpenRouter are not yet first-class targets;
override the base URL via
OpenAiClient::with_base_urlfor now.
Re-exports§
pub use capabilities::model_capabilities;pub use client::OpenAiClient;
Modules§
- capabilities
- Static lookup of
klieo_core::Capabilitiesby OpenAI model name. - client
OpenAiClient—LlmClientimpl over OpenAI’s HTTP API.