Skip to content

Commit 5534b13

Browse files
localai-botmudler
andauthored
feat(swagger): update swagger (mudler#2302)
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 5b79bd0 commit 5534b13

File tree

3 files changed

+146
-24
lines changed

3 files changed

+146
-24
lines changed

swagger/docs.go

Lines changed: 54 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -269,18 +269,61 @@ const docTemplate = `{
269269
}
270270
}
271271
},
272-
"functions.Item": {
272+
"functions.FunctionProperties": {
273+
"type": "object",
274+
"properties": {
275+
"arguments": {
276+
"$ref": "#/definitions/functions.Argument"
277+
},
278+
"function": {
279+
"$ref": "#/definitions/functions.FunctionName"
280+
}
281+
}
282+
},
283+
"functions.ItemFunction": {
273284
"type": "object",
274285
"properties": {
275286
"properties": {
276-
"$ref": "#/definitions/functions.Properties"
287+
"$ref": "#/definitions/functions.FunctionProperties"
277288
},
278289
"type": {
279290
"type": "string"
280291
}
281292
}
282293
},
283-
"functions.JSONFunctionStructure": {
294+
"functions.ItemName": {
295+
"type": "object",
296+
"properties": {
297+
"properties": {
298+
"$ref": "#/definitions/functions.NameProperties"
299+
},
300+
"type": {
301+
"type": "string"
302+
}
303+
}
304+
},
305+
"functions.JSONFunctionStructureFunction": {
306+
"type": "object",
307+
"properties": {
308+
"$defs": {
309+
"type": "object",
310+
"additionalProperties": true
311+
},
312+
"anyOf": {
313+
"type": "array",
314+
"items": {
315+
"$ref": "#/definitions/functions.ItemFunction"
316+
}
317+
},
318+
"oneOf": {
319+
"type": "array",
320+
"items": {
321+
"$ref": "#/definitions/functions.ItemFunction"
322+
}
323+
}
324+
}
325+
},
326+
"functions.JSONFunctionStructureName": {
284327
"type": "object",
285328
"properties": {
286329
"$defs": {
@@ -290,24 +333,24 @@ const docTemplate = `{
290333
"anyOf": {
291334
"type": "array",
292335
"items": {
293-
"$ref": "#/definitions/functions.Item"
336+
"$ref": "#/definitions/functions.ItemName"
294337
}
295338
},
296339
"oneOf": {
297340
"type": "array",
298341
"items": {
299-
"$ref": "#/definitions/functions.Item"
342+
"$ref": "#/definitions/functions.ItemName"
300343
}
301344
}
302345
}
303346
},
304-
"functions.Properties": {
347+
"functions.NameProperties": {
305348
"type": "object",
306349
"properties": {
307350
"arguments": {
308351
"$ref": "#/definitions/functions.Argument"
309352
},
310-
"function": {
353+
"name": {
311354
"$ref": "#/definitions/functions.FunctionName"
312355
}
313356
}
@@ -572,7 +615,10 @@ const docTemplate = `{
572615
"type": "string"
573616
},
574617
"grammar_json_functions": {
575-
"$ref": "#/definitions/functions.JSONFunctionStructure"
618+
"$ref": "#/definitions/functions.JSONFunctionStructureFunction"
619+
},
620+
"grammar_json_name": {
621+
"$ref": "#/definitions/functions.JSONFunctionStructureName"
576622
},
577623
"ignore_eos": {
578624
"type": "boolean"

swagger/swagger.json

Lines changed: 54 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -262,18 +262,61 @@
262262
}
263263
}
264264
},
265-
"functions.Item": {
265+
"functions.FunctionProperties": {
266+
"type": "object",
267+
"properties": {
268+
"arguments": {
269+
"$ref": "#/definitions/functions.Argument"
270+
},
271+
"function": {
272+
"$ref": "#/definitions/functions.FunctionName"
273+
}
274+
}
275+
},
276+
"functions.ItemFunction": {
266277
"type": "object",
267278
"properties": {
268279
"properties": {
269-
"$ref": "#/definitions/functions.Properties"
280+
"$ref": "#/definitions/functions.FunctionProperties"
270281
},
271282
"type": {
272283
"type": "string"
273284
}
274285
}
275286
},
276-
"functions.JSONFunctionStructure": {
287+
"functions.ItemName": {
288+
"type": "object",
289+
"properties": {
290+
"properties": {
291+
"$ref": "#/definitions/functions.NameProperties"
292+
},
293+
"type": {
294+
"type": "string"
295+
}
296+
}
297+
},
298+
"functions.JSONFunctionStructureFunction": {
299+
"type": "object",
300+
"properties": {
301+
"$defs": {
302+
"type": "object",
303+
"additionalProperties": true
304+
},
305+
"anyOf": {
306+
"type": "array",
307+
"items": {
308+
"$ref": "#/definitions/functions.ItemFunction"
309+
}
310+
},
311+
"oneOf": {
312+
"type": "array",
313+
"items": {
314+
"$ref": "#/definitions/functions.ItemFunction"
315+
}
316+
}
317+
}
318+
},
319+
"functions.JSONFunctionStructureName": {
277320
"type": "object",
278321
"properties": {
279322
"$defs": {
@@ -283,24 +326,24 @@
283326
"anyOf": {
284327
"type": "array",
285328
"items": {
286-
"$ref": "#/definitions/functions.Item"
329+
"$ref": "#/definitions/functions.ItemName"
287330
}
288331
},
289332
"oneOf": {
290333
"type": "array",
291334
"items": {
292-
"$ref": "#/definitions/functions.Item"
335+
"$ref": "#/definitions/functions.ItemName"
293336
}
294337
}
295338
}
296339
},
297-
"functions.Properties": {
340+
"functions.NameProperties": {
298341
"type": "object",
299342
"properties": {
300343
"arguments": {
301344
"$ref": "#/definitions/functions.Argument"
302345
},
303-
"function": {
346+
"name": {
304347
"$ref": "#/definitions/functions.FunctionName"
305348
}
306349
}
@@ -565,7 +608,10 @@
565608
"type": "string"
566609
},
567610
"grammar_json_functions": {
568-
"$ref": "#/definitions/functions.JSONFunctionStructure"
611+
"$ref": "#/definitions/functions.JSONFunctionStructureFunction"
612+
},
613+
"grammar_json_name": {
614+
"$ref": "#/definitions/functions.JSONFunctionStructureName"
569615
},
570616
"ignore_eos": {
571617
"type": "boolean"

swagger/swagger.yaml

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,32 +23,60 @@ definitions:
2323
const:
2424
type: string
2525
type: object
26-
functions.Item:
26+
functions.FunctionProperties:
27+
properties:
28+
arguments:
29+
$ref: '#/definitions/functions.Argument'
30+
function:
31+
$ref: '#/definitions/functions.FunctionName'
32+
type: object
33+
functions.ItemFunction:
2734
properties:
2835
properties:
29-
$ref: '#/definitions/functions.Properties'
36+
$ref: '#/definitions/functions.FunctionProperties'
3037
type:
3138
type: string
3239
type: object
33-
functions.JSONFunctionStructure:
40+
functions.ItemName:
41+
properties:
42+
properties:
43+
$ref: '#/definitions/functions.NameProperties'
44+
type:
45+
type: string
46+
type: object
47+
functions.JSONFunctionStructureFunction:
48+
properties:
49+
$defs:
50+
additionalProperties: true
51+
type: object
52+
anyOf:
53+
items:
54+
$ref: '#/definitions/functions.ItemFunction'
55+
type: array
56+
oneOf:
57+
items:
58+
$ref: '#/definitions/functions.ItemFunction'
59+
type: array
60+
type: object
61+
functions.JSONFunctionStructureName:
3462
properties:
3563
$defs:
3664
additionalProperties: true
3765
type: object
3866
anyOf:
3967
items:
40-
$ref: '#/definitions/functions.Item'
68+
$ref: '#/definitions/functions.ItemName'
4169
type: array
4270
oneOf:
4371
items:
44-
$ref: '#/definitions/functions.Item'
72+
$ref: '#/definitions/functions.ItemName'
4573
type: array
4674
type: object
47-
functions.Properties:
75+
functions.NameProperties:
4876
properties:
4977
arguments:
5078
$ref: '#/definitions/functions.Argument'
51-
function:
79+
name:
5280
$ref: '#/definitions/functions.FunctionName'
5381
type: object
5482
functions.Tool:
@@ -227,7 +255,9 @@ definitions:
227255
description: A grammar to constrain the LLM output
228256
type: string
229257
grammar_json_functions:
230-
$ref: '#/definitions/functions.JSONFunctionStructure'
258+
$ref: '#/definitions/functions.JSONFunctionStructureFunction'
259+
grammar_json_name:
260+
$ref: '#/definitions/functions.JSONFunctionStructureName'
231261
ignore_eos:
232262
type: boolean
233263
input: {}

0 commit comments

Comments
 (0)