Fix KB search: remove score threshold to improve results
All checks were successful
BotServer CI/CD / build (push) Successful in 2m54s
All checks were successful
BotServer CI/CD / build (push) Successful in 2m54s
This commit is contained in:
parent
dd699db19e
commit
148ad0cc7c
3 changed files with 4 additions and 4 deletions
|
|
@ -456,8 +456,8 @@ impl KbContextManager {
|
||||||
context_parts.push("\n--- End Knowledge Base Context ---\n".to_string());
|
context_parts.push("\n--- End Knowledge Base Context ---\n".to_string());
|
||||||
let full_context = context_parts.join("\n");
|
let full_context = context_parts.join("\n");
|
||||||
|
|
||||||
// Truncate KB context to fit within token limits (max 400 tokens for KB context)
|
// Truncate KB context to fit within token limits (max 8000 tokens for KB context)
|
||||||
crate::core::shared::utils::truncate_text_for_model(&full_context, "local", 400)
|
crate::core::shared::utils::truncate_text_for_model(&full_context, "local", 8000)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_active_tools(&self, session_id: Uuid) -> Result<Vec<String>> {
|
pub fn get_active_tools(&self, session_id: Uuid) -> Result<Vec<String>> {
|
||||||
|
|
|
||||||
|
|
@ -809,7 +809,7 @@ impl BotOrchestrator {
|
||||||
bot_name: &bot_name_for_context,
|
bot_name: &bot_name_for_context,
|
||||||
user_query: &message_content,
|
user_query: &message_content,
|
||||||
messages: &mut messages,
|
messages: &mut messages,
|
||||||
max_context_tokens: 8000,
|
max_context_tokens: 16000,
|
||||||
};
|
};
|
||||||
if let Err(e) = inject_kb_context(
|
if let Err(e) = inject_kb_context(
|
||||||
kb_manager.clone(),
|
kb_manager.clone(),
|
||||||
|
|
|
||||||
|
|
@ -744,7 +744,7 @@ impl KbIndexer {
|
||||||
vector: search_vector,
|
vector: search_vector,
|
||||||
limit,
|
limit,
|
||||||
with_payload: true,
|
with_payload: true,
|
||||||
score_threshold: Some(0.3),
|
score_threshold: None,
|
||||||
filter: None,
|
filter: None,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue