Skip to content

Commit 1660935

Browse files
committed
feat(responses)!: add Prompts API to Responses API
1 parent f205ab6 commit 1660935

32 files changed

+1597
-34
lines changed

docs/static/deprecated-llama-stack-spec.html

Lines changed: 118 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8593,16 +8593,53 @@
85938593
},
85948594
{
85958595
"$ref": "#/components/schemas/OpenAIResponseInputMessageContentImage"
8596+
},
8597+
{
8598+
"$ref": "#/components/schemas/OpenAIResponseInputMessageContentFile"
85968599
}
85978600
],
85988601
"discriminator": {
85998602
"propertyName": "type",
86008603
"mapping": {
86018604
"input_text": "#/components/schemas/OpenAIResponseInputMessageContentText",
8602-
"input_image": "#/components/schemas/OpenAIResponseInputMessageContentImage"
8605+
"input_image": "#/components/schemas/OpenAIResponseInputMessageContentImage",
8606+
"input_file": "#/components/schemas/OpenAIResponseInputMessageContentFile"
86038607
}
86048608
}
86058609
},
8610+
"OpenAIResponseInputMessageContentFile": {
8611+
"type": "object",
8612+
"properties": {
8613+
"type": {
8614+
"type": "string",
8615+
"const": "input_file",
8616+
"default": "input_file",
8617+
"description": "The type of the input item. Always `input_file`."
8618+
},
8619+
"file_data": {
8620+
"type": "string",
8621+
"description": "The data of the file to be sent to the model."
8622+
},
8623+
"file_id": {
8624+
"type": "string",
8625+
"description": "(Optional) The ID of the file to be sent to the model."
8626+
},
8627+
"file_url": {
8628+
"type": "string",
8629+
"description": "The URL of the file to be sent to the model."
8630+
},
8631+
"filename": {
8632+
"type": "string",
8633+
"description": "The name of the file to be sent to the model."
8634+
}
8635+
},
8636+
"additionalProperties": false,
8637+
"required": [
8638+
"type"
8639+
],
8640+
"title": "OpenAIResponseInputMessageContentFile",
8641+
"description": "File content for input messages in OpenAI response format."
8642+
},
86068643
"OpenAIResponseInputMessageContentImage": {
86078644
"type": "object",
86088645
"properties": {
@@ -8630,6 +8667,10 @@
86308667
"default": "input_image",
86318668
"description": "Content type identifier, always \"input_image\""
86328669
},
8670+
"file_id": {
8671+
"type": "string",
8672+
"description": "(Optional) The ID of the file to be sent to the model."
8673+
},
86338674
"image_url": {
86348675
"type": "string",
86358676
"description": "(Optional) URL of the image content"
@@ -8993,6 +9034,10 @@
89939034
"type": "string",
89949035
"description": "(Optional) ID of the previous response in a conversation"
89959036
},
9037+
"prompt": {
9038+
"$ref": "#/components/schemas/Prompt",
9039+
"description": "(Optional) Prompt object with ID, version, and variables"
9040+
},
89969041
"status": {
89979042
"type": "string",
89989043
"description": "Current status of the response generation"
@@ -9606,6 +9651,44 @@
96069651
"title": "OpenAIResponseUsage",
96079652
"description": "Usage information for OpenAI response."
96089653
},
9654+
"Prompt": {
9655+
"type": "object",
9656+
"properties": {
9657+
"prompt": {
9658+
"type": "string",
9659+
"description": "The system prompt text with variable placeholders. Variables are only supported when using the Responses API."
9660+
},
9661+
"version": {
9662+
"type": "integer",
9663+
"description": "Version (integer starting at 1, incremented on save)"
9664+
},
9665+
"prompt_id": {
9666+
"type": "string",
9667+
"description": "Unique identifier formatted as 'pmpt_<48-digit-hash>'"
9668+
},
9669+
"variables": {
9670+
"type": "array",
9671+
"items": {
9672+
"type": "string"
9673+
},
9674+
"description": "List of prompt variable names that can be used in the prompt template"
9675+
},
9676+
"is_default": {
9677+
"type": "boolean",
9678+
"default": false,
9679+
"description": "Boolean indicating whether this version is the default version for this prompt"
9680+
}
9681+
},
9682+
"additionalProperties": false,
9683+
"required": [
9684+
"version",
9685+
"prompt_id",
9686+
"variables",
9687+
"is_default"
9688+
],
9689+
"title": "Prompt",
9690+
"description": "A prompt resource representing a stored OpenAI Compatible prompt template in Llama Stack."
9691+
},
96099692
"ResponseGuardrailSpec": {
96109693
"type": "object",
96119694
"properties": {
@@ -9762,6 +9845,32 @@
97629845
"title": "OpenAIResponseInputToolMCP",
97639846
"description": "Model Context Protocol (MCP) tool configuration for OpenAI response inputs."
97649847
},
9848+
"OpenAIResponsePromptParam": {
9849+
"type": "object",
9850+
"properties": {
9851+
"id": {
9852+
"type": "string",
9853+
"description": "Unique identifier of the prompt template"
9854+
},
9855+
"variables": {
9856+
"type": "object",
9857+
"additionalProperties": {
9858+
"$ref": "#/components/schemas/OpenAIResponseInputMessageContent"
9859+
},
9860+
"description": "Dictionary of variable names to OpenAIResponseInputMessageContent structure for template substitution"
9861+
},
9862+
"version": {
9863+
"type": "string",
9864+
"description": "Version number of the prompt to use (defaults to latest if not specified)"
9865+
}
9866+
},
9867+
"additionalProperties": false,
9868+
"required": [
9869+
"id"
9870+
],
9871+
"title": "OpenAIResponsePromptParam",
9872+
"description": "Prompt object that is used for OpenAI responses."
9873+
},
97659874
"CreateOpenaiResponseRequest": {
97669875
"type": "object",
97679876
"properties": {
@@ -9783,6 +9892,10 @@
97839892
"type": "string",
97849893
"description": "The underlying LLM used for completions."
97859894
},
9895+
"prompt": {
9896+
"$ref": "#/components/schemas/OpenAIResponsePromptParam",
9897+
"description": "Prompt object with ID, version, and variables."
9898+
},
97869899
"instructions": {
97879900
"type": "string"
97889901
},
@@ -9871,6 +9984,10 @@
98719984
"type": "string",
98729985
"description": "(Optional) ID of the previous response in a conversation"
98739986
},
9987+
"prompt": {
9988+
"$ref": "#/components/schemas/Prompt",
9989+
"description": "(Optional) Prompt object with ID, version, and variables"
9990+
},
98749991
"status": {
98759992
"type": "string",
98769993
"description": "Current status of the response generation"

docs/static/deprecated-llama-stack-spec.yaml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6409,11 +6409,44 @@ components:
64096409
oneOf:
64106410
- $ref: '#/components/schemas/OpenAIResponseInputMessageContentText'
64116411
- $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage'
6412+
- $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile'
64126413
discriminator:
64136414
propertyName: type
64146415
mapping:
64156416
input_text: '#/components/schemas/OpenAIResponseInputMessageContentText'
64166417
input_image: '#/components/schemas/OpenAIResponseInputMessageContentImage'
6418+
input_file: '#/components/schemas/OpenAIResponseInputMessageContentFile'
6419+
OpenAIResponseInputMessageContentFile:
6420+
type: object
6421+
properties:
6422+
type:
6423+
type: string
6424+
const: input_file
6425+
default: input_file
6426+
description: >-
6427+
The type of the input item. Always `input_file`.
6428+
file_data:
6429+
type: string
6430+
description: >-
6431+
The data of the file to be sent to the model.
6432+
file_id:
6433+
type: string
6434+
description: >-
6435+
(Optional) The ID of the file to be sent to the model.
6436+
file_url:
6437+
type: string
6438+
description: >-
6439+
The URL of the file to be sent to the model.
6440+
filename:
6441+
type: string
6442+
description: >-
6443+
The name of the file to be sent to the model.
6444+
additionalProperties: false
6445+
required:
6446+
- type
6447+
title: OpenAIResponseInputMessageContentFile
6448+
description: >-
6449+
File content for input messages in OpenAI response format.
64176450
OpenAIResponseInputMessageContentImage:
64186451
type: object
64196452
properties:
@@ -6434,6 +6467,10 @@ components:
64346467
default: input_image
64356468
description: >-
64366469
Content type identifier, always "input_image"
6470+
file_id:
6471+
type: string
6472+
description: >-
6473+
(Optional) The ID of the file to be sent to the model.
64376474
image_url:
64386475
type: string
64396476
description: (Optional) URL of the image content
@@ -6704,6 +6741,10 @@ components:
67046741
type: string
67056742
description: >-
67066743
(Optional) ID of the previous response in a conversation
6744+
prompt:
6745+
$ref: '#/components/schemas/Prompt'
6746+
description: >-
6747+
(Optional) Prompt object with ID, version, and variables
67076748
status:
67086749
type: string
67096750
description: >-
@@ -7177,6 +7218,44 @@ components:
71777218
- total_tokens
71787219
title: OpenAIResponseUsage
71797220
description: Usage information for OpenAI response.
7221+
Prompt:
7222+
type: object
7223+
properties:
7224+
prompt:
7225+
type: string
7226+
description: >-
7227+
The system prompt text with variable placeholders. Variables are only
7228+
supported when using the Responses API.
7229+
version:
7230+
type: integer
7231+
description: >-
7232+
Version (integer starting at 1, incremented on save)
7233+
prompt_id:
7234+
type: string
7235+
description: >-
7236+
Unique identifier formatted as 'pmpt_<48-digit-hash>'
7237+
variables:
7238+
type: array
7239+
items:
7240+
type: string
7241+
description: >-
7242+
List of prompt variable names that can be used in the prompt template
7243+
is_default:
7244+
type: boolean
7245+
default: false
7246+
description: >-
7247+
Boolean indicating whether this version is the default version for this
7248+
prompt
7249+
additionalProperties: false
7250+
required:
7251+
- version
7252+
- prompt_id
7253+
- variables
7254+
- is_default
7255+
title: Prompt
7256+
description: >-
7257+
A prompt resource representing a stored OpenAI Compatible prompt template
7258+
in Llama Stack.
71807259
ResponseGuardrailSpec:
71817260
type: object
71827261
properties:
@@ -7283,6 +7362,29 @@ components:
72837362
title: OpenAIResponseInputToolMCP
72847363
description: >-
72857364
Model Context Protocol (MCP) tool configuration for OpenAI response inputs.
7365+
OpenAIResponsePromptParam:
7366+
type: object
7367+
properties:
7368+
id:
7369+
type: string
7370+
description: Unique identifier of the prompt template
7371+
variables:
7372+
type: object
7373+
additionalProperties:
7374+
$ref: '#/components/schemas/OpenAIResponseInputMessageContent'
7375+
description: >-
7376+
Dictionary of variable names to OpenAIResponseInputMessageContent structure
7377+
for template substitution
7378+
version:
7379+
type: string
7380+
description: >-
7381+
Version number of the prompt to use (defaults to latest if not specified)
7382+
additionalProperties: false
7383+
required:
7384+
- id
7385+
title: OpenAIResponsePromptParam
7386+
description: >-
7387+
Prompt object that is used for OpenAI responses.
72867388
CreateOpenaiResponseRequest:
72877389
type: object
72887390
properties:
@@ -7296,6 +7398,10 @@ components:
72967398
model:
72977399
type: string
72987400
description: The underlying LLM used for completions.
7401+
prompt:
7402+
$ref: '#/components/schemas/OpenAIResponsePromptParam'
7403+
description: >-
7404+
Prompt object with ID, version, and variables.
72997405
instructions:
73007406
type: string
73017407
previous_response_id:
@@ -7373,6 +7479,10 @@ components:
73737479
type: string
73747480
description: >-
73757481
(Optional) ID of the previous response in a conversation
7482+
prompt:
7483+
$ref: '#/components/schemas/Prompt'
7484+
description: >-
7485+
(Optional) Prompt object with ID, version, and variables
73767486
status:
73777487
type: string
73787488
description: >-

0 commit comments

Comments
 (0)