Skip to content

Conversation

@jamesbraza
Copy link
Collaborator

ProblemPrompt.get_prompt is typed to return a str, and in a few cases it returns XMLAnswerPrompts variants.

XMLAnswerPrompts.REASONING_ANSWER is a StrEnum, which for all normal usage works fine. Actually the existing TestChatArguments and the newly added test_problem_prompt work both before and after this PR, and also note mypy passes too.

However, I felt it weird that ProblemPrompt.get_prompt would return a StrEnum in some cases, so this PR updates that.

@jamesbraza jamesbraza self-assigned this Jun 9, 2025
Copilot AI review requested due to automatic review settings June 9, 2025 18:09
@jamesbraza jamesbraza added the bug Something isn't working label Jun 9, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR ensures that ProblemPrompt.get_prompt consistently returns a plain str by extracting the .value from any StrEnum cases and adds tests to validate this behavior.

  • Returned .value for THINK_ANSWER and ANSWER cases instead of the enum members
  • Introduced test_problem_prompt to assert string outputs for each ProblemPrompt variant

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tests/test_model_prompts.py Added test_problem_prompt to verify get_prompt returns a str and contains expected keywords
src/ether0/model_prompts.py Updated get_prompt to use .value on XMLAnswerPrompts variants

@jamesbraza jamesbraza merged commit 218962b into main Jun 9, 2025
3 checks passed
@jamesbraza jamesbraza deleted the fixing-type-mismatch branch June 9, 2025 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants