mirror of
https://github.com/mii443/rust-genai.git
synced 2025-08-22 16:25:27 +00:00
25 lines
471 B
Rust
25 lines
471 B
Rust
// region: --- Modules
|
|
|
|
mod openai;
|
|
|
|
pub use openai::*;
|
|
|
|
// endregion: --- Modules
|
|
|
|
use crate::{ChatReq, ChatRes, ChatResStream, GenReq, GenRes, GenResStream, Result};
|
|
use async_trait::async_trait;
|
|
|
|
pub enum ClientKind {
|
|
Ollama,
|
|
Openai,
|
|
}
|
|
|
|
#[async_trait]
|
|
pub trait Client {
|
|
async fn list_models(&self) -> Result<Vec<String>>;
|
|
|
|
async fn exec_chat(&self, req: ChatReq) -> Result<ChatRes>;
|
|
|
|
async fn exec_chat_stream(&self, req: ChatReq) -> Result<ChatResStream>;
|
|
}
|