@@ -143,7 +143,7 @@ def __init__(
143143 self .concurrency__limit_strategy = concurrency__limit_strategy
144144
145145
146- class RegisteredStep (Step [R ]):
146+ class RegisteredStep (Generic [R ]):
147147 def __init__ (
148148 self ,
149149 workflow : "BaseWorkflow" ,
@@ -153,27 +153,33 @@ def __init__(
153153 self .step = step
154154
155155 def call (self , ctx : Context ) -> R :
156- if self .is_async_function :
157- raise TypeError (f"{ self .name } is not a sync function. Use `acall` instead." )
156+ if self .step .is_async_function :
157+ raise TypeError (
158+ f"{ self .step .name } is not a sync function. Use `acall` instead."
159+ )
158160
159- sync_fn = self .fn
161+ sync_fn = self .step . fn
160162 if is_sync_fn (sync_fn ):
161163 return sync_fn (self .workflow , ctx )
162164
163- raise TypeError (f"{ self .name } is not a sync function. Use `acall` instead." )
165+ raise TypeError (
166+ f"{ self .step .name } is not a sync function. Use `acall` instead."
167+ )
164168
165169 async def acall (self , ctx : Context ) -> R :
166- if not self .is_async_function :
170+ if not self .step . is_async_function :
167171 raise TypeError (
168- f"{ self .name } is not an async function. Use `call` instead."
172+ f"{ self .step . name } is not an async function. Use `call` instead."
169173 )
170174
171- async_fn = self .fn
175+ async_fn = self .step . fn
172176
173177 if is_async_fn (async_fn ):
174178 return await async_fn (self .workflow , ctx )
175179
176- raise TypeError (f"{ self .name } is not an async function. Use `call` instead." )
180+ raise TypeError (
181+ f"{ self .step .name } is not an async function. Use `call` instead."
182+ )
177183
178184
179185class WorkflowDeclaration (Generic [TWorkflowInput ]):
0 commit comments