Skip to content

Commit 1ad5b59

Browse files
localai-botmudler
andauthored
feat(swagger): update swagger (#9643)
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 18e039f commit 1ad5b59

3 files changed

Lines changed: 387 additions & 0 deletions

File tree

swagger/docs.go

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,101 @@ const docTemplate = `{
613613
}
614614
}
615615
},
616+
"/api/branding": {
617+
"get": {
618+
"description": "Returns the configured instance name, tagline, and asset URLs. Public — no authentication required.",
619+
"produces": [
620+
"application/json"
621+
],
622+
"tags": [
623+
"branding"
624+
],
625+
"summary": "Get instance branding",
626+
"responses": {
627+
"200": {
628+
"description": "OK",
629+
"schema": {
630+
"$ref": "#/definitions/localai.BrandingResponse"
631+
}
632+
}
633+
}
634+
}
635+
},
636+
"/api/branding/asset/{kind}": {
637+
"post": {
638+
"description": "Upload a custom logo, horizontal logo, or favicon. The file replaces any previous override for that kind.",
639+
"consumes": [
640+
"multipart/form-data"
641+
],
642+
"produces": [
643+
"application/json"
644+
],
645+
"tags": [
646+
"branding"
647+
],
648+
"summary": "Upload a branding asset",
649+
"parameters": [
650+
{
651+
"type": "string",
652+
"description": "Asset kind: logo, logo_horizontal, or favicon",
653+
"name": "kind",
654+
"in": "path",
655+
"required": true
656+
},
657+
{
658+
"type": "file",
659+
"description": "Image file (png, jpeg, svg, webp, ico — up to 5MiB)",
660+
"name": "file",
661+
"in": "formData",
662+
"required": true
663+
}
664+
],
665+
"responses": {
666+
"200": {
667+
"description": "OK",
668+
"schema": {
669+
"$ref": "#/definitions/localai.BrandingResponse"
670+
}
671+
},
672+
"400": {
673+
"description": "Bad Request",
674+
"schema": {
675+
"type": "object",
676+
"additionalProperties": {
677+
"type": "string"
678+
}
679+
}
680+
}
681+
}
682+
},
683+
"delete": {
684+
"description": "Remove a custom branding asset; the UI falls back to the bundled LocalAI default.",
685+
"produces": [
686+
"application/json"
687+
],
688+
"tags": [
689+
"branding"
690+
],
691+
"summary": "Reset a branding asset to default",
692+
"parameters": [
693+
{
694+
"type": "string",
695+
"description": "Asset kind: logo, logo_horizontal, or favicon",
696+
"name": "kind",
697+
"in": "path",
698+
"required": true
699+
}
700+
],
701+
"responses": {
702+
"200": {
703+
"description": "OK",
704+
"schema": {
705+
"$ref": "#/definitions/localai.BrandingResponse"
706+
}
707+
}
708+
}
709+
}
710+
},
616711
"/api/instructions": {
617712
"get": {
618713
"description": "Returns a compact list of instruction areas with descriptions and URLs for detailed guides",
@@ -1332,6 +1427,35 @@ const docTemplate = `{
13321427
}
13331428
}
13341429
},
1430+
"/branding/asset/{kind}": {
1431+
"get": {
1432+
"description": "Serves the admin-uploaded logo, horizontal logo, or favicon. 404 when no override is set.",
1433+
"produces": [
1434+
"image/*"
1435+
],
1436+
"tags": [
1437+
"branding"
1438+
],
1439+
"summary": "Serve a custom branding asset",
1440+
"parameters": [
1441+
{
1442+
"type": "string",
1443+
"description": "Asset kind: logo, logo_horizontal, or favicon",
1444+
"name": "kind",
1445+
"in": "path",
1446+
"required": true
1447+
}
1448+
],
1449+
"responses": {
1450+
"200": {
1451+
"description": "OK"
1452+
},
1453+
"404": {
1454+
"description": "Not Found"
1455+
}
1456+
}
1457+
}
1458+
},
13351459
"/metrics": {
13361460
"get": {
13371461
"produces": [
@@ -2931,6 +3055,26 @@ const docTemplate = `{
29313055
}
29323056
}
29333057
},
3058+
"localai.BrandingResponse": {
3059+
"type": "object",
3060+
"properties": {
3061+
"favicon_url": {
3062+
"type": "string"
3063+
},
3064+
"instance_name": {
3065+
"type": "string"
3066+
},
3067+
"instance_tagline": {
3068+
"type": "string"
3069+
},
3070+
"logo_horizontal_url": {
3071+
"type": "string"
3072+
},
3073+
"logo_url": {
3074+
"type": "string"
3075+
}
3076+
}
3077+
},
29343078
"localai.GalleryBackend": {
29353079
"type": "object",
29363080
"properties": {

swagger/swagger.json

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,101 @@
610610
}
611611
}
612612
},
613+
"/api/branding": {
614+
"get": {
615+
"description": "Returns the configured instance name, tagline, and asset URLs. Public — no authentication required.",
616+
"produces": [
617+
"application/json"
618+
],
619+
"tags": [
620+
"branding"
621+
],
622+
"summary": "Get instance branding",
623+
"responses": {
624+
"200": {
625+
"description": "OK",
626+
"schema": {
627+
"$ref": "#/definitions/localai.BrandingResponse"
628+
}
629+
}
630+
}
631+
}
632+
},
633+
"/api/branding/asset/{kind}": {
634+
"post": {
635+
"description": "Upload a custom logo, horizontal logo, or favicon. The file replaces any previous override for that kind.",
636+
"consumes": [
637+
"multipart/form-data"
638+
],
639+
"produces": [
640+
"application/json"
641+
],
642+
"tags": [
643+
"branding"
644+
],
645+
"summary": "Upload a branding asset",
646+
"parameters": [
647+
{
648+
"type": "string",
649+
"description": "Asset kind: logo, logo_horizontal, or favicon",
650+
"name": "kind",
651+
"in": "path",
652+
"required": true
653+
},
654+
{
655+
"type": "file",
656+
"description": "Image file (png, jpeg, svg, webp, ico — up to 5MiB)",
657+
"name": "file",
658+
"in": "formData",
659+
"required": true
660+
}
661+
],
662+
"responses": {
663+
"200": {
664+
"description": "OK",
665+
"schema": {
666+
"$ref": "#/definitions/localai.BrandingResponse"
667+
}
668+
},
669+
"400": {
670+
"description": "Bad Request",
671+
"schema": {
672+
"type": "object",
673+
"additionalProperties": {
674+
"type": "string"
675+
}
676+
}
677+
}
678+
}
679+
},
680+
"delete": {
681+
"description": "Remove a custom branding asset; the UI falls back to the bundled LocalAI default.",
682+
"produces": [
683+
"application/json"
684+
],
685+
"tags": [
686+
"branding"
687+
],
688+
"summary": "Reset a branding asset to default",
689+
"parameters": [
690+
{
691+
"type": "string",
692+
"description": "Asset kind: logo, logo_horizontal, or favicon",
693+
"name": "kind",
694+
"in": "path",
695+
"required": true
696+
}
697+
],
698+
"responses": {
699+
"200": {
700+
"description": "OK",
701+
"schema": {
702+
"$ref": "#/definitions/localai.BrandingResponse"
703+
}
704+
}
705+
}
706+
}
707+
},
613708
"/api/instructions": {
614709
"get": {
615710
"description": "Returns a compact list of instruction areas with descriptions and URLs for detailed guides",
@@ -1329,6 +1424,35 @@
13291424
}
13301425
}
13311426
},
1427+
"/branding/asset/{kind}": {
1428+
"get": {
1429+
"description": "Serves the admin-uploaded logo, horizontal logo, or favicon. 404 when no override is set.",
1430+
"produces": [
1431+
"image/*"
1432+
],
1433+
"tags": [
1434+
"branding"
1435+
],
1436+
"summary": "Serve a custom branding asset",
1437+
"parameters": [
1438+
{
1439+
"type": "string",
1440+
"description": "Asset kind: logo, logo_horizontal, or favicon",
1441+
"name": "kind",
1442+
"in": "path",
1443+
"required": true
1444+
}
1445+
],
1446+
"responses": {
1447+
"200": {
1448+
"description": "OK"
1449+
},
1450+
"404": {
1451+
"description": "Not Found"
1452+
}
1453+
}
1454+
}
1455+
},
13321456
"/metrics": {
13331457
"get": {
13341458
"produces": [
@@ -2928,6 +3052,26 @@
29283052
}
29293053
}
29303054
},
3055+
"localai.BrandingResponse": {
3056+
"type": "object",
3057+
"properties": {
3058+
"favicon_url": {
3059+
"type": "string"
3060+
},
3061+
"instance_name": {
3062+
"type": "string"
3063+
},
3064+
"instance_tagline": {
3065+
"type": "string"
3066+
},
3067+
"logo_horizontal_url": {
3068+
"type": "string"
3069+
},
3070+
"logo_url": {
3071+
"type": "string"
3072+
}
3073+
}
3074+
},
29313075
"localai.GalleryBackend": {
29323076
"type": "object",
29333077
"properties": {

0 commit comments

Comments
 (0)