自定义agent #3433
Replies: 1 comment
-
Sure, I can guide you through the process of calling a specific knowledge base in your custom agent's response. In Langchain-Chatchat, you can use the # Assuming 'my_knowledge_base' is the name of your knowledge base
knowledge_base_name = 'my_knowledge_base'
# Retrieve the knowledge base service
kb_service = KBServiceFactory.get_service_by_name(knowledge_base_name)
if kb_service is not None:
# Perform operations with kb_service, for example, list files
files_list = kb_service.list_files()
print(files_list)
else:
print(f"Knowledge base '{knowledge_base_name}' not found") In this example, The The For more details, you can refer to the source code: I hope this helps! If you have any more questions or need further clarification, feel free to ask. Sources
|
Beta Was this translation helpful? Give feedback.
-
自定义agent在回答时怎么调用具体某个我自己创建的知识库中搜索答案
Beta Was this translation helpful? Give feedback.
All reactions