Skip to content

Commit 5bb885a

Browse files
revert atomic agent file
1 parent a8bdb58 commit 5bb885a

File tree

1 file changed

+10
-28
lines changed

1 file changed

+10
-28
lines changed

atomic-agents/atomic_agents/agents/atomic_agent.py

Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,6 @@ class AtomicAgent[InputSchema: BaseIOSchema, OutputSchema: BaseIOSchema]:
9494
- Use this for parameters like 'temperature', 'max_tokens', etc.
9595
"""
9696

97-
def __init_subclass__(cls, **kwargs):
98-
"""
99-
Hook called when a class is subclassed.
100-
"""
101-
super().__init_subclass__(**kwargs)
102-
10397
def __init__(self, config: AgentConfig):
10498
"""
10599
Initializes the AtomicAgent.
@@ -124,33 +118,21 @@ def reset_history(self):
124118

125119
@property
126120
def input_schema(self) -> Type[BaseIOSchema]:
127-
"""
128-
Returns the input schema class for the agent.
129-
130-
Returns:
131-
Type[BaseIOSchema]: The input schema class.
132-
"""
133121
if hasattr(self, "__orig_class__"):
134-
from typing import get_args
135-
args = get_args(self.__orig_class__)
136-
if len(args) >= 1:
137-
return args[0]
138-
return BasicChatInputSchema
122+
TI, _ = get_args(self.__orig_class__)
123+
else:
124+
TI = BasicChatInputSchema
125+
126+
return TI
139127

140128
@property
141129
def output_schema(self) -> Type[BaseIOSchema]:
142-
"""
143-
Returns the output schema class for the agent.
144-
145-
Returns:
146-
Type[BaseIOSchema]: The output schema class.
147-
"""
148130
if hasattr(self, "__orig_class__"):
149-
from typing import get_args
150-
args = get_args(self.__orig_class__)
151-
if len(args) >= 2:
152-
return args[1]
153-
return BasicChatOutputSchema
131+
_, TO = get_args(self.__orig_class__)
132+
else:
133+
TO = BasicChatOutputSchema
134+
135+
return TO
154136

155137
def _prepare_messages(self):
156138
if self.system_role is None:

0 commit comments

Comments
 (0)