forked from phoenix-oss/llama-stack-mirror
[inference api] modify content types so they follow a more standard structure (#841)
Some small updates to the inference types to make them more standard Specifically: - image data is now located in a "image" subkey - similarly tool call data is located in a "tool_call" subkey The pattern followed is `dict(type="foo", foo=<...>)`
This commit is contained in:
parent
caa8387dd2
commit
07b87365ab
15 changed files with 104 additions and 76 deletions
|
@ -3761,22 +3761,29 @@
|
|||
"ImageContentItem": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"url": {
|
||||
"$ref": "#/components/schemas/URL"
|
||||
},
|
||||
"data": {
|
||||
"type": "string",
|
||||
"contentEncoding": "base64"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"const": "image",
|
||||
"default": "image"
|
||||
},
|
||||
"image": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"url": {
|
||||
"$ref": "#/components/schemas/URL"
|
||||
},
|
||||
"data": {
|
||||
"type": "string",
|
||||
"contentEncoding": "base64"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"type"
|
||||
"type",
|
||||
"image"
|
||||
]
|
||||
},
|
||||
"InterleavedContent": {
|
||||
|
@ -4518,7 +4525,7 @@
|
|||
"const": "image",
|
||||
"default": "image"
|
||||
},
|
||||
"data": {
|
||||
"image": {
|
||||
"type": "string",
|
||||
"contentEncoding": "base64"
|
||||
}
|
||||
|
@ -4526,7 +4533,7 @@
|
|||
"additionalProperties": false,
|
||||
"required": [
|
||||
"type",
|
||||
"data"
|
||||
"image"
|
||||
]
|
||||
},
|
||||
"TextDelta": {
|
||||
|
@ -4570,7 +4577,7 @@
|
|||
"const": "tool_call",
|
||||
"default": "tool_call"
|
||||
},
|
||||
"content": {
|
||||
"tool_call": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "string"
|
||||
|
@ -4587,7 +4594,7 @@
|
|||
"additionalProperties": false,
|
||||
"required": [
|
||||
"type",
|
||||
"content",
|
||||
"tool_call",
|
||||
"parse_status"
|
||||
]
|
||||
},
|
||||
|
|
|
@ -926,22 +926,27 @@ components:
|
|||
ImageContentItem:
|
||||
additionalProperties: false
|
||||
properties:
|
||||
data:
|
||||
contentEncoding: base64
|
||||
type: string
|
||||
image:
|
||||
additionalProperties: false
|
||||
properties:
|
||||
data:
|
||||
contentEncoding: base64
|
||||
type: string
|
||||
url:
|
||||
$ref: '#/components/schemas/URL'
|
||||
type: object
|
||||
type:
|
||||
const: image
|
||||
default: image
|
||||
type: string
|
||||
url:
|
||||
$ref: '#/components/schemas/URL'
|
||||
required:
|
||||
- type
|
||||
- image
|
||||
type: object
|
||||
ImageDelta:
|
||||
additionalProperties: false
|
||||
properties:
|
||||
data:
|
||||
image:
|
||||
contentEncoding: base64
|
||||
type: string
|
||||
type:
|
||||
|
@ -950,7 +955,7 @@ components:
|
|||
type: string
|
||||
required:
|
||||
- type
|
||||
- data
|
||||
- image
|
||||
type: object
|
||||
InferenceStep:
|
||||
additionalProperties: false
|
||||
|
@ -2748,19 +2753,19 @@ components:
|
|||
ToolCallDelta:
|
||||
additionalProperties: false
|
||||
properties:
|
||||
content:
|
||||
parse_status:
|
||||
$ref: '#/components/schemas/ToolCallParseStatus'
|
||||
tool_call:
|
||||
oneOf:
|
||||
- type: string
|
||||
- $ref: '#/components/schemas/ToolCall'
|
||||
parse_status:
|
||||
$ref: '#/components/schemas/ToolCallParseStatus'
|
||||
type:
|
||||
const: tool_call
|
||||
default: tool_call
|
||||
type: string
|
||||
required:
|
||||
- type
|
||||
- content
|
||||
- tool_call
|
||||
- parse_status
|
||||
type: object
|
||||
ToolCallParseStatus:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue