♻️ refactor(代码): 优化主函数中的参数配置

- 启用历史消息记录以增强聊天功能
- 修改响应打印的调用以改善代码可读性
This commit is contained in:
2025-03-31 03:55:38 +08:00
parent 46efa8d9ed
commit 214daadc59

View File

@@ -106,9 +106,9 @@ async def main():
create_session_summary=True, create_session_summary=True,
), ),
# Set add_history_to_messages=true to add the previous chat history to the messages sent to the Model. # Set add_history_to_messages=true to add the previous chat history to the messages sent to the Model.
#add_history_to_messages=True, add_history_to_messages=True,
# Number of historical responses to add to the messages. # Number of historical responses to add to the messages.
#num_history_responses=3, num_history_responses=3,
markdown=True, markdown=True,
knowledge=knowledge_base, knowledge=knowledge_base,
search_knowledge=True, search_knowledge=True,
@@ -118,7 +118,8 @@ async def main():
# Enable the agent to read the chat history # Enable the agent to read the chat history
read_chat_history=True, read_chat_history=True,
) )
await agent.aprint_response("我现在想要记录用户对智能体和课程的使用权限及使用情况,需要如何设计表结构", stream=True) # await agent.aprint_response("我现在想要记录用户对智能体和课程的使用权限及使用情况,需要如何设计表结构", stream=True)
await agent.aprint_response("调用get_chat_history", stream=True)
# await agent.aprint_response("帮我分析一下aq.public数据库,并给出优化建议", stream=True) # await agent.aprint_response("帮我分析一下aq.public数据库,并给出优化建议", stream=True)
# await agent.aprint_response("阅读下 https://www.lucidchart.com/blog/database-design-best-practices 这篇文章", stream=True) # await agent.aprint_response("阅读下 https://www.lucidchart.com/blog/database-design-best-practices 这篇文章", stream=True)