Skip to content

Commit 57fa178

Browse files
localai-botmudler
andauthored
feat(swagger): update swagger (#9824)
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: mudler <2420543+mudler@users.noreply.github.com>
1 parent 745473c commit 57fa178

3 files changed

Lines changed: 62 additions & 3 deletions

File tree

swagger/docs.go

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5347,6 +5347,14 @@ const docTemplate = `{
53475347
"stream": {
53485348
"type": "boolean"
53495349
},
5350+
"stream_options": {
5351+
"description": "StreamOptions opts into OpenAI streaming extensions, e.g. include_usage.",
5352+
"allOf": [
5353+
{
5354+
"$ref": "#/definitions/schema.StreamOptions"
5355+
}
5356+
]
5357+
},
53505358
"temperature": {
53515359
"type": "number"
53525360
},
@@ -5412,7 +5420,12 @@ const docTemplate = `{
54125420
"type": "string"
54135421
},
54145422
"usage": {
5415-
"$ref": "#/definitions/schema.OpenAIUsage"
5423+
"description": "Usage is intentionally a pointer with omitempty: per the OpenAI\nchat-completion streaming spec, intermediate chunks must not carry\na ` + "`" + `usage` + "`" + ` field. Marshalling a value-typed usage would emit\n` + "`" + `\"usage\":{\"prompt_tokens\":0,...}` + "`" + ` on every chunk and break\nOpenAI-SDK consumers that filter on a truthy ` + "`" + `result.usage` + "`" + `\n(continuedev/continue, Kilo Code, Roo Code, etc.).",
5424+
"allOf": [
5425+
{
5426+
"$ref": "#/definitions/schema.OpenAIUsage"
5427+
}
5428+
]
54165429
}
54175430
}
54185431
},
@@ -5578,6 +5591,14 @@ const docTemplate = `{
55785591
}
55795592
}
55805593
},
5594+
"schema.StreamOptions": {
5595+
"type": "object",
5596+
"properties": {
5597+
"include_usage": {
5598+
"type": "boolean"
5599+
}
5600+
}
5601+
},
55815602
"schema.SysInfoModel": {
55825603
"type": "object",
55835604
"properties": {

swagger/swagger.json

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5344,6 +5344,14 @@
53445344
"stream": {
53455345
"type": "boolean"
53465346
},
5347+
"stream_options": {
5348+
"description": "StreamOptions opts into OpenAI streaming extensions, e.g. include_usage.",
5349+
"allOf": [
5350+
{
5351+
"$ref": "#/definitions/schema.StreamOptions"
5352+
}
5353+
]
5354+
},
53475355
"temperature": {
53485356
"type": "number"
53495357
},
@@ -5409,7 +5417,12 @@
54095417
"type": "string"
54105418
},
54115419
"usage": {
5412-
"$ref": "#/definitions/schema.OpenAIUsage"
5420+
"description": "Usage is intentionally a pointer with omitempty: per the OpenAI\nchat-completion streaming spec, intermediate chunks must not carry\na `usage` field. Marshalling a value-typed usage would emit\n`\"usage\":{\"prompt_tokens\":0,...}` on every chunk and break\nOpenAI-SDK consumers that filter on a truthy `result.usage`\n(continuedev/continue, Kilo Code, Roo Code, etc.).",
5421+
"allOf": [
5422+
{
5423+
"$ref": "#/definitions/schema.OpenAIUsage"
5424+
}
5425+
]
54135426
}
54145427
}
54155428
},
@@ -5575,6 +5588,14 @@
55755588
}
55765589
}
55775590
},
5591+
"schema.StreamOptions": {
5592+
"type": "object",
5593+
"properties": {
5594+
"include_usage": {
5595+
"type": "boolean"
5596+
}
5597+
}
5598+
},
55785599
"schema.SysInfoModel": {
55795600
"type": "object",
55805601
"properties": {

swagger/swagger.yaml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1650,6 +1650,10 @@ definitions:
16501650
stop: {}
16511651
stream:
16521652
type: boolean
1653+
stream_options:
1654+
allOf:
1655+
- $ref: '#/definitions/schema.StreamOptions'
1656+
description: StreamOptions opts into OpenAI streaming extensions, e.g. include_usage.
16531657
temperature:
16541658
type: number
16551659
tfz:
@@ -1698,7 +1702,15 @@ definitions:
16981702
object:
16991703
type: string
17001704
usage:
1701-
$ref: '#/definitions/schema.OpenAIUsage'
1705+
allOf:
1706+
- $ref: '#/definitions/schema.OpenAIUsage'
1707+
description: |-
1708+
Usage is intentionally a pointer with omitempty: per the OpenAI
1709+
chat-completion streaming spec, intermediate chunks must not carry
1710+
a `usage` field. Marshalling a value-typed usage would emit
1711+
`"usage":{"prompt_tokens":0,...}` on every chunk and break
1712+
OpenAI-SDK consumers that filter on a truthy `result.usage`
1713+
(continuedev/continue, Kilo Code, Roo Code, etc.).
17021714
type: object
17031715
schema.OpenAIUsage:
17041716
properties:
@@ -1813,6 +1825,11 @@ definitions:
18131825
$ref: '#/definitions/schema.NodeData'
18141826
type: array
18151827
type: object
1828+
schema.StreamOptions:
1829+
properties:
1830+
include_usage:
1831+
type: boolean
1832+
type: object
18161833
schema.SysInfoModel:
18171834
properties:
18181835
id:

0 commit comments

Comments
 (0)