Skip to content

Commit

Permalink
feat(orfix(orchestrator): OrchestratorError to serialize Exception
Browse files Browse the repository at this point in the history
…as `str`
  • Loading branch information
teocns committed Nov 2, 2024
1 parent ae59a63 commit f328387
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/controlflow/events/orchestrator_events.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
from typing import Literal
from dataclasses import Field
from typing import Annotated, Literal

from pydantic.functional_serializers import PlainSerializer

from controlflow.agents.agent import Agent
from controlflow.events.base import UnpersistedEvent
Expand All @@ -21,7 +24,7 @@ class OrchestratorError(UnpersistedEvent):
event: Literal["orchestrator-error"] = "orchestrator-error"
persist: bool = False
orchestrator: Orchestrator
error: Exception
error: Annotated[Exception, PlainSerializer(lambda x: str(x), return_type=str)]


class AgentTurnStart(UnpersistedEvent):
Expand Down

0 comments on commit f328387

Please sign in to comment.