mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
fix(backend): update message object shape
This commit is contained in:
@@ -14,7 +14,7 @@ from redis.lock import Lock as RedisLock
|
||||
|
||||
from backend.data.notifications import (
|
||||
AgentRunData,
|
||||
NotificationEventModel,
|
||||
NotificationEventDTO,
|
||||
NotificationType,
|
||||
)
|
||||
|
||||
@@ -226,20 +226,21 @@ def execute_node(
|
||||
|
||||
# Update execution status and spend credits
|
||||
update_execution(ExecutionStatus.COMPLETED)
|
||||
notification_service.queue_notification(
|
||||
NotificationEventModel(
|
||||
user_id=user_id,
|
||||
type=NotificationType.AGENT_RUN,
|
||||
data=AgentRunData(
|
||||
agent_name=node_block.name,
|
||||
credits_used=cost,
|
||||
execution_time=0,
|
||||
graph_id=graph_id,
|
||||
node_count=1,
|
||||
),
|
||||
)
|
||||
event = NotificationEventDTO(
|
||||
user_id=user_id,
|
||||
type=NotificationType.AGENT_RUN,
|
||||
data=AgentRunData(
|
||||
agent_name=node_block.name,
|
||||
credits_used=cost,
|
||||
execution_time=0,
|
||||
graph_id=graph_id,
|
||||
node_count=1,
|
||||
).model_dump(),
|
||||
)
|
||||
|
||||
logger.info(f"Sending notification for {event}")
|
||||
notification_service.queue_notification(event)
|
||||
|
||||
except Exception as e:
|
||||
error_msg = str(e)
|
||||
db_client.upsert_execution_output(node_exec_id, "error", error_msg)
|
||||
|
||||
Reference in New Issue
Block a user