Skip to content

Commit

Permalink
revert positional handling for now
Browse files Browse the repository at this point in the history
  • Loading branch information
zzstoatzz committed Oct 26, 2024
1 parent 41954d2 commit 77114d5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/controlflow/agents/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ class Agent(ControlFlowModel, abc.ABC):

_cm_stack: list[AbstractContextManager] = PrivateAttr(default_factory=list)

@model_validator(mode="before")
def handle_positional_arg(cls, v):
if isinstance(v, str):
return {"instructions": v}
return v
def __init__(self, instructions: Optional[str] = None, **kwargs):
if instructions is not None:
kwargs["instructions"] = instructions

super().__init__(**kwargs)

@model_validator(mode="before")
@classmethod
Expand Down

0 comments on commit 77114d5

Please sign in to comment.