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
This commit is contained in:
Alpha Nerd 2026-01-29 19:59:08 +01:00
parent 0ebfa7c519
commit d80b29e4f2
3 changed files with 7 additions and 8 deletions

View file

@ -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"""
<candidate_{i}>
{cand.message.content}
{cand}
</candidate_{i}>
"""
@ -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 answernothing else.
"""
return select_prompt.strip()
return select_prompt.strip()