mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-19 12:49:04 +08:00
feat: add label to agent log
This commit is contained in:
parent
6357450a7a
commit
93c3699128
@ -301,6 +301,7 @@ class WorkflowBasedAppRunner(AppRunner):
|
||||
self._publish_event(
|
||||
QueueAgentLogEvent(
|
||||
id=event.id,
|
||||
label=event.label,
|
||||
node_execution_id=event.node_execution_id,
|
||||
parent_id=event.parent_id,
|
||||
error=event.error,
|
||||
|
@ -308,6 +308,7 @@ class QueueAgentLogEvent(AppQueueEvent):
|
||||
|
||||
event: QueueEvent = QueueEvent.AGENT_LOG
|
||||
id: str
|
||||
label: str
|
||||
node_execution_id: str
|
||||
parent_id: str | None
|
||||
error: str | None
|
||||
|
@ -640,6 +640,7 @@ class AgentLogStreamResponse(StreamResponse):
|
||||
|
||||
node_execution_id: str
|
||||
id: str
|
||||
label: str
|
||||
parent_id: str | None
|
||||
error: str | None
|
||||
status: str
|
||||
|
@ -796,6 +796,7 @@ class WorkflowCycleManage:
|
||||
error=event.error,
|
||||
status=event.status,
|
||||
data=event.data,
|
||||
label=event.label,
|
||||
)
|
||||
)
|
||||
|
||||
@ -807,6 +808,7 @@ class WorkflowCycleManage:
|
||||
node_execution_id=node_execution_id,
|
||||
id=event.id,
|
||||
parent_id=event.parent_id,
|
||||
label=event.label,
|
||||
error=event.error,
|
||||
status=event.status,
|
||||
data=event.data,
|
||||
|
@ -160,6 +160,7 @@ class ToolInvokeMessage(BaseModel):
|
||||
SUCCESS = "success"
|
||||
|
||||
id: str
|
||||
label: str = Field(..., description="The label of the log")
|
||||
parent_id: Optional[str] = Field(default=None, description="Leave empty for root log")
|
||||
error: Optional[str] = Field(default=None, description="The error message")
|
||||
status: LogStatus = Field(..., description="The status of the log")
|
||||
|
@ -181,6 +181,7 @@ class BaseAgentEvent(GraphEngineEvent):
|
||||
|
||||
class AgentLogEvent(BaseAgentEvent):
|
||||
id: str = Field(..., description="id")
|
||||
label: str = Field(..., description="label")
|
||||
node_execution_id: str = Field(..., description="node execution id")
|
||||
parent_id: str | None = Field(..., description="parent id")
|
||||
error: str | None = Field(..., description="error")
|
||||
|
@ -287,6 +287,7 @@ class ToolNode(BaseNode[ToolNodeData]):
|
||||
error=message.message.error,
|
||||
status=message.message.status.value,
|
||||
data=message.message.data,
|
||||
label=message.message.label,
|
||||
)
|
||||
|
||||
yield RunCompletedEvent(
|
||||
|
Loading…
x
Reference in New Issue
Block a user