feat: chat typing

This commit is contained in:
2026-04-10 21:33:52 +02:00
parent d5856557b4
commit e31cdf131f
6 changed files with 277 additions and 221 deletions
+20 -1
View File
@@ -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>,
}