fix: restore accidentally deleted type definitions

Add back PipelineType enum, ProcessorType::pipeline() method, and
OLLAMA_URL/EMBED_URL/LLM_HEALTH_URL config constants — all of
which were deleted in commits 78923a89 and 0856b92e while the
referencing code was left intact, causing 5 compilation errors.
This commit is contained in:
Accusys
2026-05-25 08:50:53 +08:00
parent d7f89a962b
commit de88fd4e44
2 changed files with 41 additions and 0 deletions

View File

@@ -276,6 +276,22 @@ pub mod llm {
});
}
/// Ollama embedding endpoint (vector embeddings for text sync).
pub static OLLAMA_URL: Lazy<String> =
Lazy::new(|| env::var("MOMENTRY_OLLAMA_URL").unwrap_or_else(|_| "http://127.0.0.1:11434".to_string()));
/// Text embedding server (comic-embed or alternative).
pub static EMBED_URL: Lazy<String> =
Lazy::new(|| env::var("MOMENTRY_EMBED_URL").unwrap_or_else(|_| "http://127.0.0.1:11436".to_string()));
/// LLM health endpoint.
pub static LLM_HEALTH_URL: Lazy<String> = Lazy::new(|| {
env::var("MOMENTRY_LLM_HEALTH_URL").unwrap_or_else(|_| {
let chat = llm::CHAT_URL.clone();
chat.trim_end_matches("/v1/chat/completions").to_string() + "/health"
})
});
pub static SFTPGO_BASE_URL: Lazy<String> = Lazy::new(|| {
env::var("SFTPGO_BASE_URL").unwrap_or_else(|_| "http://127.0.0.1:8080".to_string())
});

View File

@@ -395,6 +395,14 @@ pub struct MonitorJobStats {
pub failed: i32,
}
#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq, Hash)]
#[serde(rename_all = "snake_case")]
pub enum PipelineType {
Frame,
Time,
Cross,
}
#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq, Hash)]
#[serde(rename_all = "snake_case")]
pub enum ProcessorType {
@@ -559,6 +567,23 @@ impl ProcessorType {
ProcessorType::FiveW1H,
]
}
pub fn pipeline(&self) -> PipelineType {
match self {
ProcessorType::Yolo
| ProcessorType::Ocr
| ProcessorType::Face
| ProcessorType::Pose
| ProcessorType::VisualChunk => PipelineType::Frame,
ProcessorType::Asr
| ProcessorType::Cut
| ProcessorType::Asrx
| ProcessorType::Scene
| ProcessorType::Story
| ProcessorType::FiveW1H => PipelineType::Time,
}
}
}
#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq)]