mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-10-01 16:20:13 +03:00
docs: update node name from generate_title to title_generator_node
Updated references to the title generation node in both documentation and code: - Changed node name from `generate_title` to `title_generator_node` in API design documentation - Updated filtering logic in agent service to exclude `title_generator_node` from LLM call statistics, token counting, and frontend streaming events - Maintains same functionality while using more descriptive node name for clarity
This commit is contained in:
parent
a7bc68d6e1
commit
aaba2d6181
@ -221,7 +221,7 @@ await conn.execute("CREATE INDEX IF NOT EXISTS idx_pinned_updated ON chat_sessio
|
|||||||
|
|
||||||
### Title 自动同步
|
### Title 自动同步
|
||||||
|
|
||||||
会话标题由 `generate_title` 节点自动生成,保存在 LangGraph checkpoint 的 `conversation_title` 字段中。
|
会话标题由 `title_generator_node` 节点自动生成,保存在 LangGraph checkpoint 的 `conversation_title` 字段中。
|
||||||
|
|
||||||
**同步机制**:
|
**同步机制**:
|
||||||
1. 流式 Chat 完成后,从 checkpoint 读取最终 state
|
1. 流式 Chat 完成后,从 checkpoint 读取最终 state
|
||||||
|
|||||||
@ -308,19 +308,19 @@ class AgentService:
|
|||||||
|
|
||||||
# Track LLM calls and tokens
|
# Track LLM calls and tokens
|
||||||
if event_type == "on_chat_model_start":
|
if event_type == "on_chat_model_start":
|
||||||
# Filter out generate_title node from statistics
|
# Filter out title_generator_node from statistics
|
||||||
langgraph_node = event.get("metadata", {}).get("langgraph_node", "")
|
langgraph_node = event.get("metadata", {}).get("langgraph_node", "")
|
||||||
if langgraph_node != "generate_title":
|
if langgraph_node != "title_generator_node":
|
||||||
llm_calls_count += 1
|
llm_calls_count += 1
|
||||||
log.debug("LLM call started, count=%d", llm_calls_count)
|
log.debug("LLM call started, count=%d", llm_calls_count)
|
||||||
else:
|
else:
|
||||||
log.debug("Skipping LLM call count for internal node: generate_title")
|
log.debug("Skipping LLM call count for internal node: title_generator_node")
|
||||||
|
|
||||||
elif event_type == "on_chat_model_end":
|
elif event_type == "on_chat_model_end":
|
||||||
# Filter out generate_title node from token counting
|
# Filter out title_generator_node from token counting
|
||||||
langgraph_node = event.get("metadata", {}).get("langgraph_node", "")
|
langgraph_node = event.get("metadata", {}).get("langgraph_node", "")
|
||||||
if langgraph_node == "generate_title":
|
if langgraph_node == "title_generator_node":
|
||||||
log.debug("Skipping token counting for internal node: generate_title")
|
log.debug("Skipping token counting for internal node: title_generator_node")
|
||||||
else:
|
else:
|
||||||
# Extract token usage from response metadata
|
# Extract token usage from response metadata
|
||||||
# Try multiple possible locations where token usage might be stored
|
# Try multiple possible locations where token usage might be stored
|
||||||
@ -368,11 +368,11 @@ class AgentService:
|
|||||||
# Convert event to chunk for SSE streaming
|
# Convert event to chunk for SSE streaming
|
||||||
# Use accumulator for on_chat_model_stream events to handle progressive tool calls
|
# Use accumulator for on_chat_model_stream events to handle progressive tool calls
|
||||||
|
|
||||||
# Filter out internal nodes (generate_title) from streaming to frontend
|
# Filter out internal nodes (title_generator_node) from streaming to frontend
|
||||||
langgraph_node = event.get("metadata", {}).get("langgraph_node", "")
|
langgraph_node = event.get("metadata", {}).get("langgraph_node", "")
|
||||||
if langgraph_node == "generate_title":
|
if langgraph_node == "title_generator_node":
|
||||||
# Skip all events from the generate_title node (internal use only)
|
# Skip all events from the title_generator_node (internal use only)
|
||||||
log.debug("Skipping event from internal node: generate_title")
|
log.debug("Skipping event from internal node: title_generator_node")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if event_type == "on_chat_model_stream":
|
if event_type == "on_chat_model_stream":
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user