chore: improve html-router auth, caching, and analytics while centralizing search labels in common.

small fix
This commit is contained in:
Per Stark
2026-05-29 14:42:20 +02:00
parent 920d7b5efb
commit ec80a4e540
27 changed files with 510 additions and 344 deletions
+2
View File
@@ -338,6 +338,8 @@ pub fn get_config() -> Result<AppConfig, ConfigError> {
#[cfg(test)]
mod tests {
#![allow(clippy::expect_used)]
use super::{ParseRetrievalStrategyError, RetrievalStrategy};
#[test]
fn retrieval_strategy_defaults_to_default() {
+3
View File
@@ -15,6 +15,7 @@ use crate::{
utils::config::AppConfig,
};
#[allow(clippy::module_name_repetitions)]
pub use crate::utils::config::{EmbeddingBackend, ParseEmbeddingBackendError};
/// Wrapper around the chosen embedding backend.
@@ -431,6 +432,8 @@ pub async fn generate_embedding_with_params(
#[cfg(test)]
mod tests {
#![allow(clippy::expect_used)]
use super::{EmbeddingBackend, ParseEmbeddingBackendError};
use crate::storage::types::system_settings::SystemSettings;
use serde_json::json;
+4 -1
View File
@@ -29,7 +29,10 @@ pub fn validate_ingest_input(
category: &str,
file_count: usize,
) -> Result<(), IngestValidationError> {
let text_field_bytes = content.map(str::len).unwrap_or(0) + ctx.len() + category.len();
let content_bytes = content.map_or(0, str::len);
let text_field_bytes = content_bytes
.saturating_add(ctx.len())
.saturating_add(category.len());
if text_field_bytes > config.ingest_max_body_bytes {
return Err(IngestValidationError::PayloadTooLarge(format!(
"request text fields exceed maximum allowed body size of {} bytes",