add analytics

This commit is contained in:
Louis Dureuil 2024-09-02 14:04:24 +02:00
parent ed19b7c3c3
commit 18a2c13e4e
No known key found for this signature in database

View File

@ -636,11 +636,19 @@ fn embedder_analytics(
.any(|config| config.document_template.set().is_some()) .any(|config| config.document_template.set().is_some())
}); });
let document_template_max_bytes = setting.as_ref().and_then(|map| {
map.values()
.filter_map(|config| config.clone().set())
.filter_map(|config| config.document_template_max_bytes.set())
.max()
});
json!( json!(
{ {
"total": setting.as_ref().map(|s| s.len()), "total": setting.as_ref().map(|s| s.len()),
"sources": sources, "sources": sources,
"document_template_used": document_template_used, "document_template_used": document_template_used,
"document_template_max_bytes": document_template_max_bytes
} }
) )
} }