From c246df3cb27783435cfffaddff6065bd9ff96e6f Mon Sep 17 00:00:00 2001 From: Greyson LaLonde Date: Thu, 4 Sep 2025 23:02:13 -0400 Subject: [PATCH] fix: add type annotations to converter instance variables --- .../openai_agents/structured_output_converter.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/crewai/agents/agent_adapters/openai_agents/structured_output_converter.py b/src/crewai/agents/agent_adapters/openai_agents/structured_output_converter.py index 5a9798030..c0db69fd8 100644 --- a/src/crewai/agents/agent_adapters/openai_agents/structured_output_converter.py +++ b/src/crewai/agents/agent_adapters/openai_agents/structured_output_converter.py @@ -22,10 +22,11 @@ class OpenAIConverterAdapter(BaseConverterAdapter): def __init__(self, agent_adapter: Any) -> None: """Initialize the converter adapter with a reference to the agent adapter""" + super().__init__(agent_adapter) # type: ignore self.agent_adapter = agent_adapter - self._output_format = None - self._schema = None - self._output_model = None + self._output_format: str | None = None + self._schema: str | None = None + self._output_model: Any = None def configure_structured_output(self, task: Any) -> None: """ @@ -76,7 +77,7 @@ class OpenAIConverterAdapter(BaseConverterAdapter): return f"{base_prompt}\n\n{output_schema}" - def post_process_result(self, result: str) -> str: + def post_process_result(self, result: str) -> Any: """ Post-process the result to ensure it matches the expected format.