Skip to content

Conversation

vjain419
Copy link
Contributor

@vjain419 vjain419 commented Aug 9, 2025

Summary

  • Adds model_verbosity config (values: low, medium, high).
  • Sends text.verbosity only for GPT‑5 family models via the Responses API.
  • Updates docs and adds serialization tests.

Motivation

  • GPT‑5 introduces a verbosity control to steer output length/detail without pro
    mpt surgery.
  • Exposing it as a config knob keeps prompts stable and makes behavior explicit
    and repeatable.

Changes

  • Config:
    • Added Verbosity enum (low|medium|high).
    • Added optional model_verbosity to ConfigToml, Config, and ConfigProfi le.
  • Request wiring:
    • Extended ResponsesApiRequest with optional text object.
    • Populates text.verbosity only when model family is gpt-5; omitted otherw
      ise.
  • Tests:
    • Verifies text.verbosity serializes when set and is omitted when not set.
  • Docs:
    • Added “GPT‑5 Verbosity” section in codex-rs/README.md.
    • Added model_verbosity section to codex-rs/config.md.

Usage

  • In ~/.codex/config.toml:
    • model = "gpt-5"
    • model_verbosity = "low" (or "medium" default, "high")
  • CLI override example:
    • codex -c model="gpt-5" -c model_verbosity="high"

API Impact

  • Requests to GPT‑5 via Responses API include: text: { verbosity: "low|medium|h igh" } when configured.
  • For legacy models or Chat Completions providers, text is omitted.

Backward Compatibility

  • Default behavior unchanged when model_verbosity is not set (server default “
    medium”).

Testing

  • Added unit tests for serialization/omission of text.verbosity.
  • Ran cargo fmt and cargo test --all-features (all green).

Docs

  • README.md: new “GPT‑5 Verbosity” note under Config with example.
  • config.md: new model_verbosity section.

Out of Scope

  • No changes to temperature/top_p or other GPT‑5 parameters.
  • No changes to Chat Completions wiring.

Risks / Notes

  • If OpenAI changes the wire shape for verbosity, we may need to update Respons esApiRequest.
  • Behavior gated to gpt-5 model family to avoid unexpected effects elsewhere.

Checklist

  • Code gated to GPT‑5 family only
  • Docs updated (README.md, config.md)
  • Tests added and passing
  • Formatting applied

Release note: Add model_verbosity config to control GPT‑5 output verbosity via
the Responses API (low|medium|high).

@vjain419 vjain419 changed the title Title: feat(gpt5): add model_verbosity for GPT‑5 via Responses API feat(gpt5): add model_verbosity for GPT‑5 via Responses API Aug 9, 2025
Copy link
Collaborator

@dylan-hurd-oai dylan-hurd-oai left a comment

Choose a reason for hiding this comment

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

2 small comments but LGTM otherwise!

- improve code readability by removing unnecessary line breaks and indentation
- maintain existing behavior while making the code more concise and consistent
…o streamline documentation and avoid confusion
@vjain419 vjain419 force-pushed the feat/gpt5-verbosity-opt branch from 8b68120 to 2da6343 Compare August 18, 2025 19:40
@pap-openai pap-openai added the codex-rust-review Perform a detailed review of Rust changes. label Aug 21, 2025
@dylan-hurd-oai dylan-hurd-oai removed the codex-rust-review Perform a detailed review of Rust changes. label Aug 22, 2025
Copy link
Collaborator

@dylan-hurd-oai dylan-hurd-oai left a comment

Choose a reason for hiding this comment

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

Tested locally - confirmed this works. Thanks for adding!

@dylan-hurd-oai dylan-hurd-oai merged commit 80b00a1 into openai:main Aug 22, 2025
15 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Aug 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants