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 commits78923a89and0856b92ewhile the referencing code was left intact, causing 5 compilation errors.
This commit is contained in:
@@ -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(|| {
|
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())
|
env::var("SFTPGO_BASE_URL").unwrap_or_else(|_| "http://127.0.0.1:8080".to_string())
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -395,6 +395,14 @@ pub struct MonitorJobStats {
|
|||||||
pub failed: i32,
|
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)]
|
#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq, Hash)]
|
||||||
#[serde(rename_all = "snake_case")]
|
#[serde(rename_all = "snake_case")]
|
||||||
pub enum ProcessorType {
|
pub enum ProcessorType {
|
||||||
@@ -559,6 +567,23 @@ impl ProcessorType {
|
|||||||
ProcessorType::FiveW1H,
|
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)]
|
#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq)]
|
||||||
|
|||||||
Reference in New Issue
Block a user