style: apply ruff auto-fix

- Auto-formatted code with ruff format
- Applied ruff linting fixes with --fix

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
github-actions[bot]
2026-02-23 20:23:06 +00:00
parent 044da0ff47
commit 724d7d870f
3 changed files with 14 additions and 4 deletions
+2 -2
View File
@@ -38,8 +38,8 @@ class Settings(BaseSettings):
# Portkey AI gateway settings (used when ai_provider="portkey") # Portkey AI gateway settings (used when ai_provider="portkey")
# See https://portkey.ai for setup instructions # See https://portkey.ai for setup instructions
portkey_api_key: Optional[str] = None portkey_api_key: Optional[str] = None
portkey_virtual_key: Optional[str] = None # Routes to a specific provider via Portkey vault portkey_virtual_key: Optional[str] = None # Routes to a specific provider via Portkey vault
portkey_config: Optional[str] = None # Portkey Config ID for advanced routing rules portkey_config: Optional[str] = None # Portkey Config ID for advanced routing rules
portkey_base_url: str = "https://api.portkey.ai/v1" portkey_base_url: str = "https://api.portkey.ai/v1"
# Azure OpenAI API version (used when ai_provider="azure") # Azure OpenAI API version (used when ai_provider="azure")
+12 -1
View File
@@ -19,11 +19,11 @@ from app.utils.ai_provider import (
get_ai_provider, get_ai_provider,
) )
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Helpers # Helpers
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
def _make_openai_response(content: str) -> MagicMock: def _make_openai_response(content: str) -> MagicMock:
"""Build a minimal mock that looks like an openai ChatCompletion response.""" """Build a minimal mock that looks like an openai ChatCompletion response."""
msg = SimpleNamespace(content=content) msg = SimpleNamespace(content=content)
@@ -55,6 +55,7 @@ def _make_none_content_response() -> MagicMock:
# _require_text_content helper # _require_text_content helper
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
@pytest.mark.unit @pytest.mark.unit
class TestRequireTextContent: class TestRequireTextContent:
"""Tests for the _require_text_content guard helper.""" """Tests for the _require_text_content guard helper."""
@@ -77,6 +78,7 @@ class TestRequireTextContent:
# Abstract base class # Abstract base class
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
@pytest.mark.unit @pytest.mark.unit
class TestAIProviderABC: class TestAIProviderABC:
"""Verify that AIProvider cannot be instantiated directly.""" """Verify that AIProvider cannot be instantiated directly."""
@@ -100,6 +102,7 @@ class TestAIProviderABC:
# OpenAIProvider # OpenAIProvider
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
@pytest.mark.unit @pytest.mark.unit
class TestOpenAIProvider: class TestOpenAIProvider:
"""Tests for OpenAIProvider.""" """Tests for OpenAIProvider."""
@@ -181,6 +184,7 @@ class TestOpenAIProvider:
# AzureOpenAIProvider # AzureOpenAIProvider
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
@pytest.mark.unit @pytest.mark.unit
class TestAzureOpenAIProvider: class TestAzureOpenAIProvider:
"""Tests for AzureOpenAIProvider.""" """Tests for AzureOpenAIProvider."""
@@ -222,6 +226,7 @@ class TestAzureOpenAIProvider:
# AnthropicProvider # AnthropicProvider
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
@pytest.mark.unit @pytest.mark.unit
class TestAnthropicProvider: class TestAnthropicProvider:
"""Tests for AnthropicProvider.""" """Tests for AnthropicProvider."""
@@ -274,6 +279,7 @@ class TestAnthropicProvider:
# GeminiProvider # GeminiProvider
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
@pytest.mark.unit @pytest.mark.unit
class TestGeminiProvider: class TestGeminiProvider:
"""Tests for GeminiProvider.""" """Tests for GeminiProvider."""
@@ -312,6 +318,7 @@ class TestGeminiProvider:
# OllamaProvider # OllamaProvider
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
@pytest.mark.unit @pytest.mark.unit
class TestOllamaProvider: class TestOllamaProvider:
"""Tests for OllamaProvider.""" """Tests for OllamaProvider."""
@@ -361,6 +368,7 @@ class TestOllamaProvider:
# OpenRouterProvider # OpenRouterProvider
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
@pytest.mark.unit @pytest.mark.unit
class TestOpenRouterProvider: class TestOpenRouterProvider:
"""Tests for OpenRouterProvider.""" """Tests for OpenRouterProvider."""
@@ -394,6 +402,7 @@ class TestOpenRouterProvider:
# PortkeyProvider # PortkeyProvider
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
@pytest.mark.unit @pytest.mark.unit
class TestPortkeyProvider: class TestPortkeyProvider:
"""Tests for PortkeyProvider.""" """Tests for PortkeyProvider."""
@@ -485,6 +494,7 @@ class TestPortkeyProvider:
# LiteLLMProvider # LiteLLMProvider
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
@pytest.mark.unit @pytest.mark.unit
class TestLiteLLMProvider: class TestLiteLLMProvider:
"""Tests for LiteLLMProvider.""" """Tests for LiteLLMProvider."""
@@ -566,6 +576,7 @@ class TestLiteLLMProvider:
# get_ai_provider factory function # get_ai_provider factory function
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
@pytest.mark.unit @pytest.mark.unit
class TestGetAIProvider: class TestGetAIProvider:
"""Tests for the get_ai_provider factory function.""" """Tests for the get_ai_provider factory function."""
-1
View File
@@ -12,7 +12,6 @@ from app.tasks.check_credentials import (
get_failure_state, get_failure_state,
save_failure_state, save_failure_state,
sync_test_azure_connection, sync_test_azure_connection,
sync_test_ai_provider_connection,
sync_test_openai_connection, sync_test_openai_connection,
unwrap_decorated_function, unwrap_decorated_function,
) )