Reformat Python files for new black version

This commit is contained in:
Spherrrical 2026-03-31 13:12:36 -07:00
parent 297e7e30ee
commit 043942b88c
12 changed files with 37 additions and 33 deletions

View file

@ -19,7 +19,6 @@ from planoai.docker_cli import (
stream_gateway_logs,
)
log = getLogger(__name__)

View file

@ -189,26 +189,26 @@ def get_function_parameters(node: ast.FunctionDef, tree: ast.AST) -> list:
if isinstance(
arg.annotation.value, ast.Name
) and arg.annotation.value.id in ["list", "tuple", "set", "dict"]:
param_info[
"type"
] = f"{arg.annotation.value.id}" # e.g., "List", "Tuple", etc.
param_info["type"] = (
f"{arg.annotation.value.id}" # e.g., "List", "Tuple", etc.
)
else:
param_info["type"] = "[UNKNOWN - PLEASE FIX]"
# Default for unknown types
else:
param_info[
"type"
] = "[UNKNOWN - PLEASE FIX]" # If unable to detect type
param_info["type"] = (
"[UNKNOWN - PLEASE FIX]" # If unable to detect type
)
# Handle default values
if default is not None:
if isinstance(default, ast.Constant) or isinstance(
default, ast.NameConstant
):
param_info[
"default"
] = default.value # Use the default value directly
param_info["default"] = (
default.value
) # Use the default value directly
else:
param_info["default"] = "[UNKNOWN DEFAULT]" # Unknown default type
param_info["required"] = False # Optional since it has a default value

View file

@ -6,7 +6,6 @@ import yaml
import logging
from planoai.consts import PLANO_DOCKER_NAME
# Standard env var for log level across all Plano components
LOG_LEVEL_ENV = "LOG_LEVEL"

View file

@ -287,12 +287,16 @@ async def fetch_flights(
"flight_number": flight.get("ident_iata") or flight.get("ident"),
"departure_time": flight.get("scheduled_out"),
"arrival_time": flight.get("scheduled_in"),
"origin": flight["origin"].get("code_iata")
if isinstance(flight.get("origin"), dict)
else None,
"destination": flight["destination"].get("code_iata")
if isinstance(flight.get("destination"), dict)
else None,
"origin": (
flight["origin"].get("code_iata")
if isinstance(flight.get("origin"), dict)
else None
),
"destination": (
flight["destination"].get("code_iata")
if isinstance(flight.get("destination"), dict)
else None
),
"aircraft_type": flight.get("aircraft_type"),
"status": flight.get("status"),
"terminal_origin": flight.get("terminal_origin"),

View file

@ -197,12 +197,16 @@ async def fetch_flights(
"flight_number": flight.get("ident_iata") or flight.get("ident"),
"departure_time": flight.get("scheduled_out"),
"arrival_time": flight.get("scheduled_in"),
"origin": flight["origin"].get("code_iata")
if isinstance(flight.get("origin"), dict)
else None,
"destination": flight["destination"].get("code_iata")
if isinstance(flight.get("destination"), dict)
else None,
"origin": (
flight["origin"].get("code_iata")
if isinstance(flight.get("origin"), dict)
else None
),
"destination": (
flight["destination"].get("code_iata")
if isinstance(flight.get("destination"), dict)
else None
),
"aircraft_type": flight.get("aircraft_type"),
"status": flight.get("status"),
"terminal_origin": flight.get("terminal_origin"),

View file

@ -12,7 +12,6 @@ from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExport
from opentelemetry.sdk.trace.export import BatchSpanProcessor
from opentelemetry.sdk.resources import Resource
resource = Resource.create(
{
"service.name": "weather-forecast-service",

View file

@ -5,6 +5,7 @@ Exposes two endpoints:
GET /metrics Prometheus text format, P95 latency per model (scraped by Prometheus)
GET /costs JSON cost data per model, compatible with cost_metrics source
"""
import json
from http.server import HTTPServer, BaseHTTPRequestHandler

View file

@ -1,6 +1,5 @@
import json
ARCH_STATE_HEADER = "x-arch-state"

View file

@ -1,4 +1,5 @@
"""Sphinx extension to copy provider_models.yaml to build output."""
from __future__ import annotations
from pathlib import Path

View file

@ -230,12 +230,12 @@ async def get_weather_data(request: Request, messages: list, days: int = 1):
"day_name": date_obj.strftime("%A"),
"temperature_c": round(temp_c, 1) if temp_c is not None else None,
"temperature_f": celsius_to_fahrenheit(temp_c),
"temperature_max_c": round(temp_max, 1)
if temp_max is not None
else None,
"temperature_min_c": round(temp_min, 1)
if temp_min is not None
else None,
"temperature_max_c": (
round(temp_max, 1) if temp_max is not None else None
),
"temperature_min_c": (
round(temp_min, 1) if temp_min is not None else None
),
"weather_code": weather_code,
"sunrise": sunrise.split("T")[1] if sunrise else None,
"sunset": sunset.split("T")[1] if sunset else None,

View file

@ -1,7 +1,6 @@
import json
import os
PROMPT_GATEWAY_ENDPOINT = os.getenv(
"PROMPT_GATEWAY_ENDPOINT", "http://localhost:10000/v1/chat/completions"
)

View file

@ -1,7 +1,6 @@
import json
import os
PROMPT_GATEWAY_ENDPOINT = os.getenv(
"PROMPT_GATEWAY_ENDPOINT", "http://localhost:10000/v1/chat/completions"
)