Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/app/endpoints/health.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,14 @@ async def get_providers_health_statuses() -> list[ProviderHealthStatus]:
providers = await client.providers.list()
logger.debug("Found %d providers", len(providers))

health_results = [
return [
ProviderHealthStatus(
provider_id=provider.provider_id,
status=str(provider.health.get("status", "unknown")),
message=str(provider.health.get("message", "")),
)
for provider in providers
]
return health_results

except APIConnectionError as e:
logger.error("Failed to check providers health: %s", e)
Expand Down
3 changes: 1 addition & 2 deletions src/app/endpoints/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def parse_llama_stack_model(model: Any) -> dict[str, Any]:
if k not in ("provider_id", "provider_resource_id", "model_type")
}

legacy_model = {
return {
"identifier": getattr(model, "id", ""),
"metadata": metadata,
"api_model_type": model_type,
Expand All @@ -58,7 +58,6 @@ def parse_llama_stack_model(model: Any) -> dict[str, Any]:
"provider_resource_id": str(custom_metadata.get("provider_resource_id", "")),
"model_type": model_type,
}
return legacy_model


models_responses: dict[int | str, dict[str, Any]] = {
Expand Down
3 changes: 1 addition & 2 deletions src/authorization/resolvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,7 @@ def _get_claims(auth: AuthTuple) -> dict[str, Any]:
# No claims for guests
return {}

jwt_claims = unsafe_get_claims(token)
return jwt_claims
return unsafe_get_claims(token)

@staticmethod
def _evaluate_operator(
Expand Down
3 changes: 1 addition & 2 deletions src/models/requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,8 +503,7 @@ def validate_categories(
if len(value) == 0:
return None # Convert empty list to None for consistency

unique_categories = list(dict.fromkeys(value)) # don't lose ordering
return unique_categories
return list(dict.fromkeys(value)) # don't lose ordering

@model_validator(mode="after")
def check_feedback_provided(self) -> Self:
Expand Down
3 changes: 1 addition & 2 deletions src/utils/responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -997,8 +997,7 @@ async def select_model_for_responses(
and user_conversation.last_used_model
and user_conversation.last_used_provider
):
model_id = f"{user_conversation.last_used_provider}/{user_conversation.last_used_model}"
return model_id
return f"{user_conversation.last_used_provider}/{user_conversation.last_used_model}"

# 2. Select default model from configuration
if configuration.inference is not None:
Expand Down
4 changes: 1 addition & 3 deletions src/utils/tool_formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def format_tool_response(tool_dict: dict[str, Any]) -> dict[str, Any]:
description = clean_description

# Extract only the required fields
formatted_tool = {
return {
"identifier": tool_dict.get("identifier", ""),
"description": description,
"parameters": tool_dict.get("parameters", []),
Expand All @@ -46,8 +46,6 @@ def format_tool_response(tool_dict: dict[str, Any]) -> dict[str, Any]:
"type": tool_dict.get("type", ""),
}

return formatted_tool


def extract_clean_description(description: str) -> str:
"""
Expand Down
3 changes: 1 addition & 2 deletions tests/benchmarks/data_generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,5 +155,4 @@ def generate_topic_summary() -> str:
],
]

summary = " ".join([random.choice(yap) for yap in yaps]) + "."
return summary
return " ".join([random.choice(yap) for yap in yaps]) + "."
3 changes: 1 addition & 2 deletions tests/e2e/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,5 +287,4 @@ def replace_placeholders(context: Context, text: str) -> str:
"""
result = text.replace("{MODEL}", context.default_model)
result = result.replace("{PROVIDER}", context.default_provider)
result = result.replace("{VECTOR_STORE_ID}", context.faiss_vector_store_id)
return result
return result.replace("{VECTOR_STORE_ID}", context.faiss_vector_store_id)
3 changes: 1 addition & 2 deletions tests/unit/app/endpoints/test_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ def create_dummy_request() -> Request:
request (fastapi.Request): A Request constructed with a bare HTTP scope
(type "http") for use in tests.
"""
req = Request(scope={"type": "http", "headers": []})
return req
return Request(scope={"type": "http", "headers": []})


@pytest.fixture(name="setup_configuration")
Expand Down
3 changes: 1 addition & 2 deletions tests/unit/utils/test_responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,7 @@ def make_output_item(
Returns:
MockOutputItem: Mock object with type, role, and content attributes
"""
mock_item = MockOutputItem(item_type=item_type, role=role, content=content)
return mock_item
return MockOutputItem(item_type=item_type, role=role, content=content)


def make_content_part(
Expand Down
Loading