Skip to main content

Crate klieo_llm_openai

Crate klieo_llm_openai 

Source
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 vision capability is always false); gpt-4o’s image messages require a Message::content change in klieo-core first.
  • Azure OpenAI and OpenRouter are not yet first-class targets; override the base URL via OpenAiClient::with_base_url for now.

Re-exports§

pub use capabilities::model_capabilities;
pub use client::OpenAiClient;

Modules§

capabilities
Static lookup of klieo_core::Capabilities by OpenAI model name.
client
OpenAiClientLlmClient impl over OpenAI’s HTTP API.