Skip to content

Commit 59169bf

Browse files
committed
feat(responses)!: add support for OpenAI compatible Prompts in Responses API
1 parent bd3c473 commit 59169bf

33 files changed

+1667
-34
lines changed

client-sdks/stainless/openapi.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5574,11 +5574,44 @@ components:
55745574
oneOf:
55755575
- $ref: '#/components/schemas/OpenAIResponseInputMessageContentText'
55765576
- $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage'
5577+
- $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile'
55775578
discriminator:
55785579
propertyName: type
55795580
mapping:
55805581
input_text: '#/components/schemas/OpenAIResponseInputMessageContentText'
55815582
input_image: '#/components/schemas/OpenAIResponseInputMessageContentImage'
5583+
input_file: '#/components/schemas/OpenAIResponseInputMessageContentFile'
5584+
OpenAIResponseInputMessageContentFile:
5585+
type: object
5586+
properties:
5587+
type:
5588+
type: string
5589+
const: input_file
5590+
default: input_file
5591+
description: >-
5592+
The type of the input item. Always `input_file`.
5593+
file_data:
5594+
type: string
5595+
description: >-
5596+
The data of the file to be sent to the model.
5597+
file_id:
5598+
type: string
5599+
description: >-
5600+
(Optional) The ID of the file to be sent to the model.
5601+
file_url:
5602+
type: string
5603+
description: >-
5604+
The URL of the file to be sent to the model.
5605+
filename:
5606+
type: string
5607+
description: >-
5608+
The name of the file to be sent to the model.
5609+
additionalProperties: false
5610+
required:
5611+
- type
5612+
title: OpenAIResponseInputMessageContentFile
5613+
description: >-
5614+
File content for input messages in OpenAI response format.
55825615
OpenAIResponseInputMessageContentImage:
55835616
type: object
55845617
properties:
@@ -5599,6 +5632,10 @@ components:
55995632
default: input_image
56005633
description: >-
56015634
Content type identifier, always "input_image"
5635+
file_id:
5636+
type: string
5637+
description: >-
5638+
(Optional) The ID of the file to be sent to the model.
56025639
image_url:
56035640
type: string
56045641
description: (Optional) URL of the image content
@@ -6998,6 +7035,10 @@ components:
69987035
type: string
69997036
description: >-
70007037
(Optional) ID of the previous response in a conversation
7038+
prompt:
7039+
$ref: '#/components/schemas/Prompt'
7040+
description: >-
7041+
(Optional) Prompt object with ID, version, and variables
70017042
status:
70027043
type: string
70037044
description: >-
@@ -7315,6 +7356,29 @@ components:
73157356
title: OpenAIResponseInputToolMCP
73167357
description: >-
73177358
Model Context Protocol (MCP) tool configuration for OpenAI response inputs.
7359+
OpenAIResponsePromptParam:
7360+
type: object
7361+
properties:
7362+
id:
7363+
type: string
7364+
description: Unique identifier of the prompt template
7365+
variables:
7366+
type: object
7367+
additionalProperties:
7368+
$ref: '#/components/schemas/OpenAIResponseInputMessageContent'
7369+
description: >-
7370+
Dictionary of variable names to OpenAIResponseInputMessageContent structure
7371+
for template substitution
7372+
version:
7373+
type: string
7374+
description: >-
7375+
Version number of the prompt to use (defaults to latest if not specified)
7376+
additionalProperties: false
7377+
required:
7378+
- id
7379+
title: OpenAIResponsePromptParam
7380+
description: >-
7381+
Prompt object that is used for OpenAI responses.
73187382
CreateOpenaiResponseRequest:
73197383
type: object
73207384
properties:
@@ -7328,6 +7392,10 @@ components:
73287392
model:
73297393
type: string
73307394
description: The underlying LLM used for completions.
7395+
prompt:
7396+
$ref: '#/components/schemas/OpenAIResponsePromptParam'
7397+
description: >-
7398+
Prompt object with ID, version, and variables.
73317399
instructions:
73327400
type: string
73337401
previous_response_id:
@@ -7405,6 +7473,10 @@ components:
74057473
type: string
74067474
description: >-
74077475
(Optional) ID of the previous response in a conversation
7476+
prompt:
7477+
$ref: '#/components/schemas/Prompt'
7478+
description: >-
7479+
(Optional) Prompt object with ID, version, and variables
74087480
status:
74097481
type: string
74107482
description: >-

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"
@@ -9610,6 +9655,44 @@
96109655
"title": "OpenAIResponseUsage",
96119656
"description": "Usage information for OpenAI response."
96129657
},
9658+
"Prompt": {
9659+
"type": "object",
9660+
"properties": {
9661+
"prompt": {
9662+
"type": "string",
9663+
"description": "The system prompt text with variable placeholders. Variables are only supported when using the Responses API."
9664+
},
9665+
"version": {
9666+
"type": "integer",
9667+
"description": "Version (integer starting at 1, incremented on save)"
9668+
},
9669+
"prompt_id": {
9670+
"type": "string",
9671+
"description": "Unique identifier formatted as 'pmpt_<48-digit-hash>'"
9672+
},
9673+
"variables": {
9674+
"type": "array",
9675+
"items": {
9676+
"type": "string"
9677+
},
9678+
"description": "List of prompt variable names that can be used in the prompt template"
9679+
},
9680+
"is_default": {
9681+
"type": "boolean",
9682+
"default": false,
9683+
"description": "Boolean indicating whether this version is the default version for this prompt"
9684+
}
9685+
},
9686+
"additionalProperties": false,
9687+
"required": [
9688+
"version",
9689+
"prompt_id",
9690+
"variables",
9691+
"is_default"
9692+
],
9693+
"title": "Prompt",
9694+
"description": "A prompt resource representing a stored OpenAI Compatible prompt template in Llama Stack."
9695+
},
96139696
"ResponseGuardrailSpec": {
96149697
"type": "object",
96159698
"properties": {
@@ -9766,6 +9849,32 @@
97669849
"title": "OpenAIResponseInputToolMCP",
97679850
"description": "Model Context Protocol (MCP) tool configuration for OpenAI response inputs."
97689851
},
9852+
"OpenAIResponsePromptParam": {
9853+
"type": "object",
9854+
"properties": {
9855+
"id": {
9856+
"type": "string",
9857+
"description": "Unique identifier of the prompt template"
9858+
},
9859+
"variables": {
9860+
"type": "object",
9861+
"additionalProperties": {
9862+
"$ref": "#/components/schemas/OpenAIResponseInputMessageContent"
9863+
},
9864+
"description": "Dictionary of variable names to OpenAIResponseInputMessageContent structure for template substitution"
9865+
},
9866+
"version": {
9867+
"type": "string",
9868+
"description": "Version number of the prompt to use (defaults to latest if not specified)"
9869+
}
9870+
},
9871+
"additionalProperties": false,
9872+
"required": [
9873+
"id"
9874+
],
9875+
"title": "OpenAIResponsePromptParam",
9876+
"description": "Prompt object that is used for OpenAI responses."
9877+
},
97699878
"CreateOpenaiResponseRequest": {
97709879
"type": "object",
97719880
"properties": {
@@ -9787,6 +9896,10 @@
97879896
"type": "string",
97889897
"description": "The underlying LLM used for completions."
97899898
},
9899+
"prompt": {
9900+
"$ref": "#/components/schemas/OpenAIResponsePromptParam",
9901+
"description": "Prompt object with ID, version, and variables."
9902+
},
97909903
"instructions": {
97919904
"type": "string"
97929905
},
@@ -9875,6 +9988,10 @@
98759988
"type": "string",
98769989
"description": "(Optional) ID of the previous response in a conversation"
98779990
},
9991+
"prompt": {
9992+
"$ref": "#/components/schemas/Prompt",
9993+
"description": "(Optional) Prompt object with ID, version, and variables"
9994+
},
98789995
"status": {
98799996
"type": "string",
98809997
"description": "Current status of the response generation"

0 commit comments

Comments
 (0)