Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Openai Openai python Response Text Config Param

From Leeroopedia
Knowledge Sources
Domains API_Types, Responses_API
Last Updated 2026-02-15 00:00 GMT

Overview

Concrete TypedDict for constructing text response configuration parameters when sending requests to the Responses API, provided by the openai-python SDK.

Description

ResponseTextConfigParam is a TypedDict used to build text response configuration for API requests. It has an optional format field of type ResponseFormatTextConfigParam (supporting text, json_object, or json_schema formats including Structured Outputs), and an optional verbosity field that constrains response length to "low", "medium", or "high".

Usage

Import this type when constructing the text parameter in Responses API calls to control output format and verbosity.

Code Reference

Source Location

Signature

class ResponseTextConfigParam(TypedDict, total=False):
    """Configuration options for a text response from the model."""

    format: ResponseFormatTextConfigParam
    verbosity: Optional[Literal["low", "medium", "high"]]

Import

from openai.types.responses import ResponseTextConfigParam

I/O Contract

Fields

Name Type Required Description
format ResponseFormatTextConfigParam No An object specifying the output format. Supports text, json_object, or json_schema (Structured Outputs). Defaults to {"type": "text"}.
verbosity Optional[Literal["low", "medium", "high"]] No Constrains the verbosity of the model's response.

Usage Examples

from openai.types.responses import ResponseTextConfigParam

text_config: ResponseTextConfigParam = {
    "format": {"type": "json_schema", "name": "response", "schema": {
        "type": "object",
        "properties": {"answer": {"type": "string"}},
        "required": ["answer"],
    }},
    "verbosity": "medium",
}

# Use as: client.responses.create(model="gpt-4o", input="...", text=text_config)

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment