From d80b29e4f2a0120b8a2827f24a5d6a59df4560a4 Mon Sep 17 00:00:00 2001 From: alpha-nerd-nomyo Date: Thu, 29 Jan 2026 19:59:08 +0100 Subject: [PATCH] feat: enhance code quality and documentation - Renamed Feedback class to follow PascalCase convention - Fixed candidate enumeration start index from 0 to 1 - Simplified candidate content access by removing .message.content - Updated CONFIG_PATH environment variable name to CONFIG_PATH_ARG - Bumped version from 0.5 to 0.6 - Removed unnecessary return statement and trailing newline --- enhance.py | 11 +++++------ entrypoint.sh | 2 +- router.py | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/enhance.py b/enhance.py index 9be1fef..f3200c7 100644 --- a/enhance.py +++ b/enhance.py @@ -1,6 +1,6 @@ from pydantic import BaseModel -class feedback(BaseModel): +class Feedback(BaseModel): query_id: int content: str @@ -25,13 +25,13 @@ def moe(query: str, query_id: int, response: str) -> str: def moe_select_candidate(query: str, candidates: list[str]) -> str: if not candidates: - raise ValueError("No candidates supplied") + raise ValueError("No candidates supplied") candidate_sections = "" - for i, cand in enumerate(candidates[:3], start=0): + for i, cand in enumerate(candidates[:3], start=1): candidate_sections += f""" - {cand.message.content} + {cand} """ @@ -45,5 +45,4 @@ def moe_select_candidate(query: str, candidates: list[str]) -> str: **Do NOT** mention candidate numbers, strengths, weaknesses, or any other commentary. Just give the final answer—nothing else. """ - return select_prompt.strip() - + return select_prompt.strip() \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh index 6682851..e9ccbc3 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -50,7 +50,7 @@ Options: Any arguments that remain after the options above are passed directly to uvicorn. Environment variables: - CONFIG_PATH Alternative way to specify the config path. + CONFIG_PATH_ARG Alternative way to specify the config path. NOMYO_ROUTER_CONFIG_PATH Overrides the config path (same as --config-path). UVICORN_HOST Host interface to bind to (default: 0.0.0.0). UVICORN_PORT Port to listen on (default: 12434). diff --git a/router.py b/router.py index 829b16a..2215a4e 100644 --- a/router.py +++ b/router.py @@ -2,7 +2,7 @@ title: NOMYO Router - an Ollama Proxy with Endpoint:Model aware routing author: alpha-nerd-nomyo author_url: https://github.com/nomyo-ai -version: 0.5 +version: 0.6 license: AGPL """ # -------------------------------------------------------------