Skip to content

Add support for OpenAI verbosity parameter in Responses API #2493

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ryx2
Copy link

@ryx2 ryx2 commented Aug 10, 2025

Summary

  • Implements the openai_text_verbosity setting for OpenAI Responses API models
  • Allows users to control response verbosity with 'low', 'medium', or 'high' values
  • Adds proper integration with the OpenAI Responses API text configuration

Test plan

  • Added unit test for verbosity parameter functionality
  • Verified syntax and basic functionality with test script
  • Follows existing code patterns and conventions from the codebase

Implementation Details

  • Added openai_text_verbosity: Literal['low', 'medium', 'high'] to OpenAIResponsesModelSettings
  • Modified _responses_create method to include verbosity in text config when specified
  • Added comprehensive test case to verify the feature works correctly

This addresses issue #2478 and provides the functionality requested in the GitHub issue with proper error handling and documentation.

🤖 Generated with Claude Code

Implements the `openai_text_verbosity` setting for OpenAI Responses API models,
allowing users to control response verbosity with 'low', 'medium', or 'high' values.

The verbosity parameter is added to the text configuration when making requests
to the OpenAI Responses API, providing better control over response length.

Fixes pydantic#2478

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@medaminezghal
Copy link
Contributor

@ryx2 Could I use your PR to enhance this PR?

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.

2 participants