mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-09-27 06:10:27 +03:00
feat(agent): streamline conversation flow logic in copilot
- Remove unused `llm_calls` variable and redundant logging in `should_continue` - Simplify title generation routing by eliminating unnecessary condition checks - Improve code clarity and maintainability by focusing on essential flow control
This commit is contained in:
parent
4a017b1a7f
commit
f64daa96cd
@ -345,7 +345,6 @@ def should_continue(
|
|||||||
- Otherwise → conversation is complete, go to END
|
- Otherwise → conversation is complete, go to END
|
||||||
"""
|
"""
|
||||||
last_message = state["messages"][-1]
|
last_message = state["messages"][-1]
|
||||||
llm_calls = state.get("llm_calls", 0)
|
|
||||||
current_title = state.get("conversation_title")
|
current_title = state.get("conversation_title")
|
||||||
|
|
||||||
# LLM requested one or more tool executions
|
# LLM requested one or more tool executions
|
||||||
@ -354,9 +353,6 @@ def should_continue(
|
|||||||
|
|
||||||
# First full interaction completed and title not yet generated
|
# First full interaction completed and title not yet generated
|
||||||
if current_title in [None, "New Conversation"]:
|
if current_title in [None, "New Conversation"]:
|
||||||
logger.info(
|
|
||||||
"First turn finished, no title yet → routing to 'title_generator_node'"
|
|
||||||
)
|
|
||||||
return "title_generator_node"
|
return "title_generator_node"
|
||||||
|
|
||||||
# Normal completion (multi-turn conversation or title already exists)
|
# Normal completion (multi-turn conversation or title already exists)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user