mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-10 15:56:03 +00:00
feat(plugin): expose KB UUIDs in query variables and pass session context to retrieve API
Extract knowledge base UUID list into query.variables['_knowledge_base_uuids'] in PreProcessor so plugins can modify it during PromptPreProcessing. Runner now reads from variables instead of pipeline_config. Also pass session_name, bot_uuid, and sender_id to kb.retrieve() in the RETRIEVE_KNOWLEDGE_BASE handler so knowledge engines receive proper session context. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -675,11 +675,15 @@ class RuntimeConnectionHandler(handler.Handler):
|
||||
)
|
||||
|
||||
try:
|
||||
session_name = f'{query.session.launcher_type.value}_{query.session.launcher_id}'
|
||||
entries = await kb.retrieve(
|
||||
query_text,
|
||||
settings={
|
||||
'top_k': top_k,
|
||||
'filters': filters,
|
||||
'session_name': session_name,
|
||||
'bot_uuid': query.bot_uuid or '',
|
||||
'sender_id': str(query.sender_id),
|
||||
},
|
||||
)
|
||||
results = [entry.model_dump(mode='json') for entry in entries]
|
||||
|
||||
Reference in New Issue
Block a user