chore: harden system settings and unify prompt usage

Validate settings updates, use typed embedding backends, and route
ingestion through DB-stored prompts so admin edits take effect.
This commit is contained in:
Per Stark
2026-05-29 11:48:13 +02:00
parent bc41a619ce
commit 125b856c49
8 changed files with 244 additions and 94 deletions
+3 -4
View File
@@ -28,9 +28,7 @@ use text_splitter::{ChunkCapacity, ChunkConfig, TextSplitter};
use super::{enrichment_result::LLMEnrichmentResult, preparation::to_text_content};
use crate::pipeline::context::{EmbeddedKnowledgeEntity, EmbeddedTextChunk};
use crate::utils::llm_instructions::{
get_ingress_analysis_schema, INGRESS_ANALYSIS_SYSTEM_MESSAGE,
};
use crate::utils::llm_instructions::get_ingress_analysis_schema;
const EMBEDDING_QUERY_CHAR_LIMIT: usize = 12_000;
#[async_trait]
@@ -121,7 +119,8 @@ impl DefaultPipelineServices {
let request = CreateChatCompletionRequestArgs::default()
.model(&settings.processing_model)
.messages([
ChatCompletionRequestSystemMessage::from(INGRESS_ANALYSIS_SYSTEM_MESSAGE).into(),
ChatCompletionRequestSystemMessage::from(settings.ingestion_system_prompt.as_str())
.into(),
ChatCompletionRequestUserMessage::from(user_message).into(),
])
.response_format(response_format)
@@ -1,8 +1,5 @@
use common::storage::types::system_prompts::DEFAULT_INGRESS_ANALYSIS_SYSTEM_PROMPT;
use serde_json::json;
pub static INGRESS_ANALYSIS_SYSTEM_MESSAGE: &str = DEFAULT_INGRESS_ANALYSIS_SYSTEM_PROMPT;
pub fn get_ingress_analysis_schema() -> serde_json::Value {
json!({
"type": "object",