AI models shared registry + Code cleanup + Better async handling + Some fixes, etc
This commit is contained in:
parent
a8ff3442ff
commit
520b98143f
62 changed files with 1683 additions and 1239 deletions
38
crates/jarvis-core/src/models/structs.rs
Normal file
38
crates/jarvis-core/src/models/structs.rs
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
use std::path::PathBuf;
|
||||
use serde::{Serialize, Deserialize};
|
||||
|
||||
// tasks that components can request a backend for
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum Task {
|
||||
Intent,
|
||||
Slots,
|
||||
Vad,
|
||||
NoiseSuppression,
|
||||
Stt,
|
||||
}
|
||||
|
||||
// metadata about a model, parsed from model.toml on disk
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct ModelDef {
|
||||
pub id: String,
|
||||
pub name: String,
|
||||
pub tasks: Vec<Task>,
|
||||
|
||||
#[serde(default)]
|
||||
pub description: String,
|
||||
|
||||
// set at runtime after scanning the folder
|
||||
#[serde(skip)]
|
||||
pub path: PathBuf,
|
||||
}
|
||||
|
||||
// a selectable option for a task (shown in UI / stored in settings)
|
||||
#[derive(Debug, Clone, Serialize)]
|
||||
pub struct BackendOption {
|
||||
pub id: String,
|
||||
pub name: String,
|
||||
// if Some, this option uses a model from the registry.
|
||||
// if None, it's a code-only backend (like energy VAD) or disabled.
|
||||
pub model_id: Option<String>,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue