From 69f86910244d7a68d707bd8ca3a4a718cd59323a Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Mon, 1 Jun 2026 06:14:10 +0000 Subject: [PATCH] style: apply ruff formatting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: João --- .../providers/openai_compatible/completion.py | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/lib/crewai/src/crewai/llms/providers/openai_compatible/completion.py b/lib/crewai/src/crewai/llms/providers/openai_compatible/completion.py index 37b33cedb..b5771a52b 100644 --- a/lib/crewai/src/crewai/llms/providers/openai_compatible/completion.py +++ b/lib/crewai/src/crewai/llms/providers/openai_compatible/completion.py @@ -298,7 +298,10 @@ class OpenAICompatibleCompletion(OpenAICompletion): if msg.get("role") == "system": msg["content"] = (msg.get("content") or "") + instruction return - params["messages"] = [{"role": "system", "content": instruction.lstrip()}, *msgs] + params["messages"] = [ + {"role": "system", "content": instruction.lstrip()}, + *msgs, + ] @staticmethod def _extract_json_from_text(text: str) -> str: @@ -386,7 +389,9 @@ class OpenAICompatibleCompletion(OpenAICompletion): ) return parsed except Exception as e: - logging.warning(f"Structured output parsing failed, returning raw content: {e}") + logging.warning( + f"Structured output parsing failed, returning raw content: {e}" + ) content = self._apply_stop_words(content) self._emit_call_completed_event( @@ -433,7 +438,9 @@ class OpenAICompatibleCompletion(OpenAICompletion): self._inject_schema_instructions(modified_params, schema_dict) - response = await self._get_async_client().chat.completions.create(**modified_params) + response = await self._get_async_client().chat.completions.create( + **modified_params + ) usage = self._extract_openai_token_usage(response) self._track_token_usage_internal(usage) @@ -466,7 +473,9 @@ class OpenAICompatibleCompletion(OpenAICompletion): ) return parsed except Exception as e: - logging.warning(f"Structured output parsing failed, returning raw content: {e}") + logging.warning( + f"Structured output parsing failed, returning raw content: {e}" + ) content = self._apply_stop_words(content) self._emit_call_completed_event( @@ -516,7 +525,9 @@ class OpenAICompatibleCompletion(OpenAICompletion): full_response = "" usage_data: dict[str, Any] | None = None - completion_stream = self._get_sync_client().chat.completions.create(**modified_params) + completion_stream = self._get_sync_client().chat.completions.create( + **modified_params + ) for chunk in completion_stream: response_id_stream = chunk.id if hasattr(chunk, "id") else None