refactor: address code review feedback on MCP tool calling
This commit is contained in:
committed by
GitHub
parent
76c6086db3
commit
51188fe3bd
@@ -371,7 +371,7 @@ async def message_handler(update: Update, context: ContextTypes.DEFAULT_TYPE) ->
|
||||
if tool_client is not None:
|
||||
reply = await llm.chat_with_tools(text, tool_client, history=call_history)
|
||||
else:
|
||||
reply = await llm.chat(text, history=call_history) # type: ignore[arg-type]
|
||||
reply = await llm.chat(text, history=call_history)
|
||||
history.append({"role": "user", "content": text})
|
||||
history.append({"role": "assistant", "content": reply})
|
||||
else:
|
||||
@@ -381,7 +381,7 @@ async def message_handler(update: Update, context: ContextTypes.DEFAULT_TYPE) ->
|
||||
if tool_client is not None:
|
||||
reply = await llm.chat_with_tools(text, tool_client, history=call_history)
|
||||
else:
|
||||
reply = await llm.chat(text, history=call_history) # type: ignore[arg-type]
|
||||
reply = await llm.chat(text, history=call_history)
|
||||
user_history.append({"role": "user", "content": text})
|
||||
user_history.append({"role": "assistant", "content": reply})
|
||||
if len(user_history) > _MAX_HISTORY * 2:
|
||||
|
||||
Reference in New Issue
Block a user