working through the plan + UI/ UX
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::sync::Mutex;
|
||||
use tauri::ipc::Channel;
|
||||
|
||||
// ─── LLM Event (for streaming) ───────────────────────────────
|
||||
|
||||
@@ -16,6 +15,8 @@ pub enum LlmEvent {
|
||||
|
||||
pub struct AppState {
|
||||
pub config: Mutex<LlmConfig>,
|
||||
pub rag: crate::rag::RagStore,
|
||||
pub gen: crate::generations::GenerationStore,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
@@ -26,6 +27,10 @@ pub struct LlmConfig {
|
||||
pub temperature: f32,
|
||||
pub max_tokens: u32,
|
||||
pub top_p: f32,
|
||||
/// Ollama image-generation model (e.g. `x/flux2-klein:4b`). macOS-only via Ollama.
|
||||
pub image_model: String,
|
||||
/// Ollama embedding model for lore RAG (e.g. `nomic-embed-text`).
|
||||
pub embed_model: String,
|
||||
}
|
||||
|
||||
impl Default for LlmConfig {
|
||||
@@ -38,6 +43,8 @@ impl Default for LlmConfig {
|
||||
temperature: 0.7,
|
||||
max_tokens: 512,
|
||||
top_p: 0.9,
|
||||
image_model: "x/flux2-klein:4b".to_string(),
|
||||
embed_model: "nomic-embed-text".to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -50,6 +57,10 @@ pub struct GenerateRequest {
|
||||
pub system: Option<String>,
|
||||
pub temperature: Option<f32>,
|
||||
pub max_tokens: Option<u32>,
|
||||
/// Optional RAG query: when set, the top lore chunks for this query are
|
||||
/// retrieved and prepended to the system prompt so generation stays
|
||||
/// consistent with the user's world bible.
|
||||
pub rag_query: Option<String>,
|
||||
}
|
||||
|
||||
// ─── OpenAI-Compatible Chat Response ─────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user