working through the plan + UI/ UX

This commit is contained in:
itsamejms
2026-07-12 22:13:43 +01:00
parent 5b256242be
commit a24f3615e0
38 changed files with 5295 additions and 328 deletions
+12 -1
View File
@@ -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 ─────────────────────────