Expand description
§agent-framework-openai
An OpenAI (and OpenAI-compatible) ChatClient for agent-framework-rs.
Works against the OpenAI Chat Completions API and any compatible endpoint (Azure OpenAI, Ollama, together.ai, local servers, …) by overriding the base URL.
use agent_framework_openai::OpenAIChatCompletionClient;
use agent_framework_core::prelude::*;
let client = OpenAIChatCompletionClient::new("sk-...", "gpt-4o-mini");
let agent = Agent::builder(client)
.instructions("You are concise.")
.build();
let reply = agent.run_once("Say hi").await?;
println!("{}", reply.text());Re-exports§
pub use embeddings::OpenAIEmbeddingClient;pub use responses::OpenAIChatClient;
Modules§
- embeddings
- OpenAI embeddings client.
- responses
OpenAIChatClient: aChatClientfor the OpenAI Responses API (POST /v1/responses).
Structs§
- OpenAI
Chat Completion Client - An OpenAI (or OpenAI-compatible) chat client.
Functions§
- classify_
service_ error - Classify a non-success OpenAI-wire (Chat Completions / Responses) HTTP
response into a granular
Error.