mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-03 09:53:45 +00:00
feat(responses)!: introduce OpenAI compatible prompts to Responses API (#3942)
# What does this PR do? <!-- Provide a short summary of what this PR does and why. Link to relevant issues if applicable. --> This PR is responsible for making changes to Responses API scheme to introduce OpenAI compatible prompts there. Change to the API only, therefore currently no implementation at all. However, the follow up PR with actual implementation will be submitted after current PR lands. The need of this functionality was initiated in #3514. > Note, #3514 is divided on three separate PRs. Current PR is the second of three. <!-- If resolving an issue, uncomment and update the line below --> <!-- Closes #[issue-number] --> ## Test Plan <!-- Describe the tests you ran to verify your changes with result summaries. *Provide clear instructions so the plan can be easily re-executed.* --> CI
This commit is contained in:
parent
e5ca7e6450
commit
5598f61e12
12 changed files with 593 additions and 8 deletions
73
docs/static/llama-stack-spec.yaml
vendored
73
docs/static/llama-stack-spec.yaml
vendored
|
|
@ -4261,11 +4261,44 @@ components:
|
|||
oneOf:
|
||||
- $ref: '#/components/schemas/OpenAIResponseInputMessageContentText'
|
||||
- $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage'
|
||||
- $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile'
|
||||
discriminator:
|
||||
propertyName: type
|
||||
mapping:
|
||||
input_text: '#/components/schemas/OpenAIResponseInputMessageContentText'
|
||||
input_image: '#/components/schemas/OpenAIResponseInputMessageContentImage'
|
||||
input_file: '#/components/schemas/OpenAIResponseInputMessageContentFile'
|
||||
OpenAIResponseInputMessageContentFile:
|
||||
type: object
|
||||
properties:
|
||||
type:
|
||||
type: string
|
||||
const: input_file
|
||||
default: input_file
|
||||
description: >-
|
||||
The type of the input item. Always `input_file`.
|
||||
file_data:
|
||||
type: string
|
||||
description: >-
|
||||
The data of the file to be sent to the model.
|
||||
file_id:
|
||||
type: string
|
||||
description: >-
|
||||
(Optional) The ID of the file to be sent to the model.
|
||||
file_url:
|
||||
type: string
|
||||
description: >-
|
||||
The URL of the file to be sent to the model.
|
||||
filename:
|
||||
type: string
|
||||
description: >-
|
||||
The name of the file to be sent to the model.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- type
|
||||
title: OpenAIResponseInputMessageContentFile
|
||||
description: >-
|
||||
File content for input messages in OpenAI response format.
|
||||
OpenAIResponseInputMessageContentImage:
|
||||
type: object
|
||||
properties:
|
||||
|
|
@ -4286,6 +4319,10 @@ components:
|
|||
default: input_image
|
||||
description: >-
|
||||
Content type identifier, always "input_image"
|
||||
file_id:
|
||||
type: string
|
||||
description: >-
|
||||
(Optional) The ID of the file to be sent to the model.
|
||||
image_url:
|
||||
type: string
|
||||
description: (Optional) URL of the image content
|
||||
|
|
@ -5680,6 +5717,10 @@ components:
|
|||
type: string
|
||||
description: >-
|
||||
(Optional) ID of the previous response in a conversation
|
||||
prompt:
|
||||
$ref: '#/components/schemas/OpenAIResponsePrompt'
|
||||
description: >-
|
||||
(Optional) Reference to a prompt template and its variables.
|
||||
status:
|
||||
type: string
|
||||
description: >-
|
||||
|
|
@ -5753,6 +5794,30 @@ components:
|
|||
mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall'
|
||||
mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools'
|
||||
mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest'
|
||||
OpenAIResponsePrompt:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: Unique identifier of the prompt template
|
||||
variables:
|
||||
type: object
|
||||
additionalProperties:
|
||||
$ref: '#/components/schemas/OpenAIResponseInputMessageContent'
|
||||
description: >-
|
||||
Dictionary of variable names to OpenAIResponseInputMessageContent structure
|
||||
for template substitution. The substitution values can either be strings,
|
||||
or other Response input types like images or files.
|
||||
version:
|
||||
type: string
|
||||
description: >-
|
||||
Version number of the prompt to use (defaults to latest if not specified)
|
||||
additionalProperties: false
|
||||
required:
|
||||
- id
|
||||
title: OpenAIResponsePrompt
|
||||
description: >-
|
||||
OpenAI compatible Prompt object that is used in OpenAI responses.
|
||||
OpenAIResponseText:
|
||||
type: object
|
||||
properties:
|
||||
|
|
@ -6010,6 +6075,10 @@ components:
|
|||
model:
|
||||
type: string
|
||||
description: The underlying LLM used for completions.
|
||||
prompt:
|
||||
$ref: '#/components/schemas/OpenAIResponsePrompt'
|
||||
description: >-
|
||||
(Optional) Prompt object with ID, version, and variables.
|
||||
instructions:
|
||||
type: string
|
||||
previous_response_id:
|
||||
|
|
@ -6087,6 +6156,10 @@ components:
|
|||
type: string
|
||||
description: >-
|
||||
(Optional) ID of the previous response in a conversation
|
||||
prompt:
|
||||
$ref: '#/components/schemas/OpenAIResponsePrompt'
|
||||
description: >-
|
||||
(Optional) Reference to a prompt template and its variables.
|
||||
status:
|
||||
type: string
|
||||
description: >-
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue