basic features like streaming, stopping, simple formatting, etc.
This commit is contained in:
parent
3dbfa61c0f
commit
24990f514f
7 changed files with 887 additions and 143 deletions
12
src/types.rs
12
src/types.rs
|
|
@ -11,6 +11,8 @@ pub struct ChatRequest {
|
|||
pub model: String,
|
||||
pub messages: Vec<ChatMessage>,
|
||||
pub stream: bool,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub think: Option<bool>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
|
|
@ -20,6 +22,14 @@ pub struct ChatResponse {
|
|||
pub done: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct StreamResponse {
|
||||
pub model: String,
|
||||
pub created_at: String,
|
||||
pub message: ChatMessage,
|
||||
pub done: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct ModelInfo {
|
||||
pub name: String,
|
||||
|
|
@ -28,4 +38,4 @@ pub struct ModelInfo {
|
|||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct ModelsResponse {
|
||||
pub models: Vec<ModelInfo>,
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue