1 unstable release
| 0.1.2 | Nov 22, 2025 |
|---|
#2659 in Asynchronous
146 downloads per month
42KB
626 lines
OpenAI GPT SDK for Miyabi LLM
This crate provides OpenAI GPT API integration for the Miyabi LLM framework.
It implements the LlmClient and LlmStreamingClient traits from miyabi-llm-core.
Features
- GPT-4o, GPT-4o-mini, GPT-4 Turbo support
- Tool/function calling
- Streaming responses via SSE
- Environment variable configuration
Example
use miyabi_llm_openai::OpenAIClient;
use miyabi_llm_core::{LlmClient, Message};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = OpenAIClient::from_env()?;
let messages = vec![Message::user("Hello!")];
let response = client.chat(messages).await?;
println!("Response: {}", response);
Ok(())
}
miyabi-llm-openai
Part of the Miyabi LLM ecosystem - Unified LLM interface for Rust.
Installation
cargo add miyabi-llm-openai
License
MIT
Dependencies
~8–23MB
~252K SLoC