Skip to content

Conversation

pamelafox
Copy link
Collaborator

@pamelafox pamelafox commented Aug 11, 2025

Purpose

This pull request updates the reasoning effort selection logic for chat completion requests to ensure compatibility with both the gpt-5 models (where the lowest reasoning_effort is "minimal") and previous reasoning models (where the lowest reasoning_effort is "low").

  • Added the get_lowest_reasoning_effort method to approach.py, which returns "minimal" for GPT-5 reasoning models and "low" for others, ensuring valid reasoning effort values are used.
  • Updated run_search_approach in chatreadretrieveread.py to use get_lowest_reasoning_effort for query rewriting, replacing the previous hardcoded "minimal" value. [1] [2]

Does this introduce a breaking change?

When developers merge from main and run the server, azd up, or azd deploy, will this produce an error?
If you're not sure, try it out on an old environment.

[ ] Yes
[X] No

Does this require changes to learn.microsoft.com docs?

This repository is referenced by this tutorial
which includes deployment, settings and usage instructions. If text or screenshot need to change in the tutorial,
check the box below and notify the tutorial author. A Microsoft employee can do this for you if you're an external contributor.

[ ] Yes
[X] No

Type of change

[X] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ ] Other... Please describe:

Code quality checklist

See CONTRIBUTING.md for more details.

  • The current tests all pass (python -m pytest).
  • I added tests that prove my fix is effective or that my feature works
  • I ran python -m pytest --cov to verify 100% coverage of added lines
  • I ran python -m mypy to check for type errors
  • I either used the pre-commit hooks or ran ruff and black manually on my code.

@pamelafox pamelafox requested a review from Copilot August 11, 2025 23:44
Copilot

This comment was marked as outdated.

@pamelafox pamelafox requested a review from Copilot August 11, 2025 23:58
Copy link
Contributor

@Copilot 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 pull request updates the reasoning effort selection logic to ensure compatibility between GPT-5 models (which use "minimal" as the lowest reasoning effort) and other reasoning models (which use "low" as the lowest reasoning effort).

  • Added a get_lowest_reasoning_effort method that returns the appropriate lowest reasoning effort based on model type
  • Updated hardcoded "minimal" reasoning effort values to use dynamic selection in query generation
  • Enhanced the GPTReasoningModelSupport dataclass to track which models support minimal effort levels

Reviewed Changes

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

File Description
app/backend/approaches/approach.py Added minimal_effort field to GPTReasoningModelSupport and implemented get_lowest_reasoning_effort method
app/backend/approaches/chatreadretrieveread.py Replaced hardcoded "minimal" reasoning effort with dynamic method calls
Test snapshot files Updated expected reasoning effort values from "minimal" to "low" for o3-mini model tests

@pamelafox pamelafox merged commit 397c885 into Azure-Samples:main Aug 12, 2025
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant