Skip to content

Commit

Permalink
Merge branch 'fix/chore-fix' into dev/plugin-deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
Yeuoly committed Dec 30, 2024
2 parents 7330a4a + 63665a5 commit db1ad3c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion api/core/workflow/nodes/agent/agent_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from core.plugin.manager.exc import PluginDaemonClientSideError
from core.workflow.entities.node_entities import NodeRunResult
from core.workflow.entities.variable_pool import VariablePool
from core.workflow.enums import SystemVariableKey
from core.workflow.nodes.agent.entities import AgentNodeData
from core.workflow.nodes.enums import NodeType
from core.workflow.nodes.event.event import RunCompletedEvent
Expand Down Expand Up @@ -59,12 +60,15 @@ def _run(self) -> Generator:
for_log=True,
)

# get conversation id
conversation_id = self.graph_runtime_state.variable_pool.get(["sys", SystemVariableKey.CONVERSATION_ID])

try:
message_stream = strategy.invoke(
params=parameters,
user_id=self.user_id,
app_id=self.app_id,
# TODO: conversation id and message id
conversation_id=conversation_id.text if conversation_id else None,
)
except Exception as e:
yield RunCompletedEvent(
Expand Down
5 changes: 4 additions & 1 deletion api/core/workflow/nodes/tool/tool_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ def _run(self) -> Generator:
for_log=True,
)

# get conversation id
conversation_id = self.graph_runtime_state.variable_pool.get(["sys", SystemVariableKey.CONVERSATION_ID])

try:
message_stream = ToolEngine.generic_invoke(
tool=tool_runtime,
Expand All @@ -97,7 +100,7 @@ def _run(self) -> Generator:
workflow_call_depth=self.workflow_call_depth,
thread_pool_id=self.thread_pool_id,
app_id=self.app_id,
# TODO: conversation id and message id
conversation_id=conversation_id.text if conversation_id else None,
)
except ToolNodeError as e:
yield RunCompletedEvent(
Expand Down

0 comments on commit db1ad3c

Please sign in to comment.