From b11dd0ab26f35745ceb46c7aa658f4aaae435049 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 25 Apr 2026 20:30:46 +0000 Subject: [PATCH 1/2] build(deps-dev): bump black from 24.10.0 to 26.3.1 Bumps [black](https://github.com/psf/black) from 24.10.0 to 26.3.1. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/24.10.0...26.3.1) --- updated-dependencies: - dependency-name: black dependency-version: 26.3.1 dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c4a4b70..3826ff8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,7 @@ dependencies = [ [project.optional-dependencies] dev = [ - "black==24.10.0", + "black==26.3.1", "flake8==7.1.1", "pre-commit==4.0.1", "mypy==1.13.0", From deafb693808929ac1ddc1a4d56e19aa5ea4dd69f Mon Sep 17 00:00:00 2001 From: HC-ONLINE Date: Sat, 25 Apr 2026 16:05:42 -0500 Subject: [PATCH 2/2] style: arregla formato para Black 26.3.1 --- api/metrics.py | 1 - scripts/client_fetch.py | 9 +++++++-- scripts/client_stream.py | 13 ++++++++++--- scripts/test.py | 3 ++- 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/api/metrics.py b/api/metrics.py index 8edb5ae..b71050b 100644 --- a/api/metrics.py +++ b/api/metrics.py @@ -11,7 +11,6 @@ ) from fastapi import Response - # ========== Contadores ========== # Requests totales por endpoint y método diff --git a/scripts/client_fetch.py b/scripts/client_fetch.py index 531065c..19c5425 100644 --- a/scripts/client_fetch.py +++ b/scripts/client_fetch.py @@ -7,6 +7,7 @@ Uso: python scripts/client_fetch.py --message "Hola" --max-tokens 150 """ + import argparse import json import os @@ -29,9 +30,13 @@ def load_api_key() -> str: def main() -> None: parser = argparse.ArgumentParser(description="Prueba cliente fetch contra /chat") - parser.add_argument("--message", "-m", default="Explica qué es Redis", help="Mensaje del usuario") + parser.add_argument( + "--message", "-m", default="Explica qué es Redis", help="Mensaje del usuario" + ) parser.add_argument("--max-tokens", "-n", type=int, default=150, help="Max tokens") - parser.add_argument("--url", "-u", default="http://localhost:8000/chat", help="URL del endpoint") + parser.add_argument( + "--url", "-u", default="http://localhost:8000/chat", help="URL del endpoint" + ) args = parser.parse_args() api_key = load_api_key() diff --git a/scripts/client_stream.py b/scripts/client_stream.py index ce7369d..bbc2293 100644 --- a/scripts/client_stream.py +++ b/scripts/client_stream.py @@ -8,6 +8,7 @@ Uso: python scripts/client_stream.py --message "Hola" --max-tokens 150 """ + import argparse import asyncio import json @@ -42,7 +43,9 @@ async def stream_request(url: str, api_key: str, message: str, max_tokens: int) async with httpx.AsyncClient() as client: try: - async with client.stream("POST", url, headers=headers, json=payload, timeout=60.0) as resp: + async with client.stream( + "POST", url, headers=headers, json=payload, timeout=60.0 + ) as resp: print(f"HTTP {resp.status_code}") async for line in resp.aiter_lines(): @@ -67,9 +70,13 @@ async def stream_request(url: str, api_key: str, message: str, max_tokens: int) def main() -> None: parser = argparse.ArgumentParser(description="Cliente streaming contra /stream") - parser.add_argument("--message", "-m", default="Explica qué es Redis", help="Mensaje del usuario") + parser.add_argument( + "--message", "-m", default="Explica qué es Redis", help="Mensaje del usuario" + ) parser.add_argument("--max-tokens", "-n", type=int, default=200, help="Max tokens") - parser.add_argument("--url", "-u", default="http://localhost:8000/stream", help="URL del endpoint") + parser.add_argument( + "--url", "-u", default="http://localhost:8000/stream", help="URL del endpoint" + ) args = parser.parse_args() api_key = load_api_key() diff --git a/scripts/test.py b/scripts/test.py index 982f88e..336dda9 100644 --- a/scripts/test.py +++ b/scripts/test.py @@ -1,6 +1,7 @@ """ Script de utilidad para ejecutar tests localmente con configuración adecuada. """ + import subprocess import sys @@ -14,7 +15,7 @@ def run_tests(): "-v", "--cov=api", "--cov-report=html", - "--cov-report=term-missing" + "--cov-report=term-missing", ] result = subprocess.run(cmd)