Files
rust-genai/src/client/mod.rs
Jeremy Chone 27f91b1554 . initial
2024-06-01 12:14:47 -07:00

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>;
}