kaxil commented on code in PR #74201:
URL: https://github.com/apache/airflow/pull/74201#discussion_r4483787675
##########
providers/common/ai/src/airflow/providers/common/ai/decorators/agent.py:
##########
@@ -106,6 +117,19 @@ def execute(self, context: Context) -> Any:
self.prompt = self.render_template(self.prompt, context)
return AgentOperator.execute(self, context)
+ async def aexecute(self, context: Context) -> Any:
+ context_merge(context, self.op_kwargs)
+ kwargs = determine_kwargs(self.python_callable, self.op_args, context)
+
+ self.prompt = await self.python_callable(*self.op_args, **kwargs)
+
+ validate_prompt(self.prompt, decorator_name="@task.agent")
+
+ # Rendering a template can read a Variable or a Connection with a
blocking call to
+ # the supervisor, which must not happen on the event loop.
+ await asyncio.to_thread(self.render_template_fields, context)
Review Comment:
And we actually just fixed it recenrtly on main
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]