Files
crewAI/lib
Devin AI 128552a5fa fix: use async LLM calls in converter for async workflows (issue #5230)
When using akickoff() (async workflow), the _export_output method and
_ainvoke_guardrail_function were calling synchronous llm.call() through
the converter module, which blocks the event loop.

Changes:
- Add ato_pydantic() and ato_json() async methods to Converter class
  that use llm.acall() instead of llm.call()
- Add async utility functions: aconvert_to_model(), ahandle_partial_json(),
  aconvert_with_instructions()
- Add _aexport_output() async method to Task class
- Wire _aexport_output into _aexecute_core and _ainvoke_guardrail_function
  replacing the sync _export_output calls in async paths
- Add comprehensive async tests covering all new async converter paths

Fixes #5230

Co-Authored-By: João <joao@crewai.com>
2026-04-02 12:39:01 +00:00
..