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 Prompt Param

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

Overview

Concrete TypedDict for constructing prompt template references when sending requests to the Responses API, provided by the openai-python SDK.

Description

ResponsePromptParam is a TypedDict used to build a prompt template reference for API requests. It requires an id field identifying the stored prompt template, and optionally accepts a variables dictionary mapping variable names to substitution values (strings, ResponseInputTextParam, ResponseInputImageParam, or ResponseInputFileParam), and an optional version string to pin a specific template revision.

Usage

Import this type when constructing request payloads that reference reusable prompt templates with variable substitutions for the Responses API.

Code Reference

Source Location

Signature

class ResponsePromptParam(TypedDict, total=False):
    """Reference to a prompt template and its variables."""

    id: Required[str]
    variables: Optional[Dict[str, Variables]]
    version: Optional[str]

Import

from openai.types.responses import ResponsePromptParam

I/O Contract

Fields

Name Type Required Description
id str Yes The unique identifier of the prompt template to use.
variables Optional[Dict[str, Variables]] No Optional map of values to substitute for variables in the prompt. Values can be strings or input param types (text, image, file).
version Optional[str] No Optional version of the prompt template.

Usage Examples

from openai.types.responses import ResponsePromptParam

prompt: ResponsePromptParam = {
    "id": "prompt_abc123",
    "variables": {
        "user_name": "Bob",
        "topic": "machine learning",
    },
    "version": "v1",
}

Related Pages

Page Connections

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