@@ -94,12 +94,6 @@ class AtomicAgent[InputSchema: BaseIOSchema, OutputSchema: BaseIOSchema]:
94
94
- Use this for parameters like 'temperature', 'max_tokens', etc.
95
95
"""
96
96
97
- def __init_subclass__ (cls , ** kwargs ):
98
- """
99
- Hook called when a class is subclassed.
100
- """
101
- super ().__init_subclass__ (** kwargs )
102
-
103
97
def __init__ (self , config : AgentConfig ):
104
98
"""
105
99
Initializes the AtomicAgent.
@@ -124,33 +118,21 @@ def reset_history(self):
124
118
125
119
@property
126
120
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
- """
133
121
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
139
127
140
128
@property
141
129
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
- """
148
130
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
154
136
155
137
def _prepare_messages (self ):
156
138
if self .system_role is None :
0 commit comments