Enhance conversation history and runtime variable management
- Update ConversationRecorder to include source and nodeId metadata in transcripts for better context tracking. - Introduce optional variable handling in DynamicVariableStore, allowing for unset variables to be rendered as empty without raising errors. - Refactor WorkflowBrain to apply turn configurations and manage interaction policies dynamically, improving agent responsiveness. - Implement tests to ensure proper handling of updated session variables and workflow metadata in various scenarios.
This commit is contained in:
@@ -77,6 +77,10 @@ class ConversationRecorder:
|
||||
role = str(message.get("role") or "")
|
||||
content = str(message.get("content") or "").strip()
|
||||
event_key = f"transcript:{role}:{timestamp}:{content}"
|
||||
if message.get("source"):
|
||||
extra["source"] = str(message["source"])
|
||||
if message.get("nodeId"):
|
||||
extra["node_id"] = str(message["nodeId"])
|
||||
elif event_type == "assistant-text-end":
|
||||
role = "assistant"
|
||||
content = str(message.get("content") or "").strip()
|
||||
|
||||
Reference in New Issue
Block a user