feat: chat typing
This commit is contained in:
+20
-1
@@ -1,5 +1,6 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
use utoipa::ToSchema;
|
||||
|
||||
use crate::dto::api;
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct OllamaModels {
|
||||
@@ -59,3 +60,21 @@ pub struct OllamaGenerateResponse {
|
||||
pub prompt_eval_count: Option<u32>,
|
||||
pub eval_count: Option<u32>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
pub struct OllamaChatRequest<'a> {
|
||||
pub model: &'a str,
|
||||
pub messages: &'a [api::Message],
|
||||
pub stream: bool,
|
||||
pub options: OllamaOptions,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
pub struct OllamaChatResponse {
|
||||
pub model: String,
|
||||
pub message: api::Message,
|
||||
pub done: bool,
|
||||
|
||||
pub prompt_eval_count: Option<u32>,
|
||||
pub eval_count: Option<u32>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user