Support reasoning summary models in AzureOpenAIEvalClient#216
Support reasoning summary models in AzureOpenAIEvalClient#216
Conversation
|
bugbot run |
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for OpenAI's reasoning summary feature to the OpenAI evaluation clients, along with enhanced error logging using traceback for better debugging. The changes introduce new parameters to enable reasoning summaries and refactor the API dispatch logic to support both the Chat Completions API and the Responses API.
Key changes:
- Added reasoning summary parameters (
use_reasoning_summary,reasoning_effort,reasoning_summary) toOpenAIEvalClientandAzureOpenAIEvalClient - Introduced a new
_dispatchmethod to handle routing between Chat Completions API and Responses API - Enhanced exception handling with
traceback.print_exception()calls in multiple places - Updated response processing logic to extract and format reasoning summaries
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/langcheck/metrics/eval_clients/_openai.py | Added reasoning summary support with new parameters, refactored API dispatch logic, enhanced error logging with traceback |
| src/langcheck/metrics/eval_clients/_litellm.py | Added traceback printing for better error debugging |
Comments suppressed due to low confidence (3)
src/langcheck/metrics/eval_clients/_openai.py:554
- Corrected spelling of 'Intialize' to 'Initialize'.
Intialize the Azure OpenAI evaluation client.
src/langcheck/metrics/eval_clients/_openai.py:56
- The docstring is missing documentation for the newly added parameters:
use_reasoning_summary,reasoning_effort, andreasoning_summary. These should be documented to explain their purpose and usage.
openai_client (Optional): The OpenAI client to use.
openai_args (Optional): dict of additional args to pass in to the
`client.chat.completions.create` function.
use_async: If True, the async client will be used. Defaults to
False.
system_prompt (Optional): The system prompt to use. If not provided,
no system prompt will be used.
extractor (Optional): The extractor to use. If not provided, the
default extractor will be used.
src/langcheck/metrics/eval_clients/_openai.py:572
- The docstring is missing documentation for the newly added parameters:
use_reasoning_summary,reasoning_effort, andreasoning_summary. These should be documented to explain their purpose and usage.
text_model_name (Optional): The text model name you want to use with
the Azure OpenAI API. The name is used as
`{ "model": text_model_name }` parameter when calling the Azure
OpenAI API for text models.
embedding_model_name (Optional): The text model name you want to
use with the Azure OpenAI API. The name is used as
`{ "model": embedding_model_name }` parameter when calling the
Azure OpenAI API for embedding models.
azure_openai_client (Optional): The Azure OpenAI client to use.
openai_args (Optional): dict of additional args to pass in to the
`client.chat.completions.create` function.
use_async (Optional): If True, the async client will be used.
system_prompt (Optional): The system prompt to use. If not provided,
no system prompt will be used.
extractor (Optional): The extractor to use. If not provided, the
default extractor will be used.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| } | ||
|
|
||
| # seed and logprobs are not supported in responses API. | ||
| return self._client.responses.create( |
There was a problem hiding this comment.
Ah nice, I was wondering if we set this properly to avoid logging prompts
Co-authored-by: Kenny Song <kenny.ysong@gmail.com>
| @@ -2,12 +2,14 @@ | |||
|
|
|||
There was a problem hiding this comment.
Let's also bump the version in this PR!
https://langcheck.readthedocs.io/en/latest/contributing.html#publishing
7a75374 to
422884c
Compare
|
LGTM after bumping the version! |
|
Thanks for your quick review! |
LiteLLMEvalClientalready supports Responses API, butlitellm.responsesis still in beta, so this PR supports Responses API inAzureOpenAIEvalClienttoo.Note
Adds Responses API-based reasoning summary to OpenAI and Azure eval clients, adjusts outputs/logprobs behavior, improves error logging, and bumps version.
use_reasoning_summary,reasoning_effort,reasoning_summary)._dispatchto switch between Chat Completions and Responses API.get_text_responses, extract content and append reasoning summaries when enabled.__version__and project version to0.10.0.dev12.Written by Cursor Bugbot for commit d98842e. This will update automatically on new commits. Configure here.