Skip to content

Commit 3e0612b

Browse files
localai-botmudler
andauthored
feat(swagger): update swagger (#9992)
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 de2ce74 commit 3e0612b

3 files changed

Lines changed: 616 additions & 59 deletions

File tree

swagger/docs.go

Lines changed: 218 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,6 +1121,117 @@ const docTemplate = `{
11211121
}
11221122
}
11231123
},
1124+
"/api/pii/decide": {
1125+
"post": {
1126+
"consumes": [
1127+
"application/json"
1128+
],
1129+
"produces": [
1130+
"application/json"
1131+
],
1132+
"tags": [
1133+
"pii"
1134+
],
1135+
"summary": "Scan text for PII and return findings + suggested action (decision oracle)",
1136+
"parameters": [
1137+
{
1138+
"description": "decide params",
1139+
"name": "request",
1140+
"in": "body",
1141+
"required": true,
1142+
"schema": {
1143+
"$ref": "#/definitions/schema.PIIDecideRequest"
1144+
}
1145+
}
1146+
],
1147+
"responses": {
1148+
"200": {
1149+
"description": "OK",
1150+
"schema": {
1151+
"$ref": "#/definitions/schema.PIIDecideResponse"
1152+
}
1153+
},
1154+
"400": {
1155+
"description": "Bad Request",
1156+
"schema": {
1157+
"type": "object",
1158+
"additionalProperties": {
1159+
"type": "string"
1160+
}
1161+
}
1162+
}
1163+
}
1164+
}
1165+
},
1166+
"/api/router/decide": {
1167+
"post": {
1168+
"consumes": [
1169+
"application/json"
1170+
],
1171+
"produces": [
1172+
"application/json"
1173+
],
1174+
"tags": [
1175+
"router"
1176+
],
1177+
"summary": "Classify a prompt against a router model's policies (decision oracle)",
1178+
"parameters": [
1179+
{
1180+
"description": "decide params",
1181+
"name": "request",
1182+
"in": "body",
1183+
"required": true,
1184+
"schema": {
1185+
"$ref": "#/definitions/schema.RouterDecideRequest"
1186+
}
1187+
}
1188+
],
1189+
"responses": {
1190+
"200": {
1191+
"description": "OK",
1192+
"schema": {
1193+
"$ref": "#/definitions/schema.RouterDecideResponse"
1194+
}
1195+
},
1196+
"400": {
1197+
"description": "Bad Request",
1198+
"schema": {
1199+
"type": "object",
1200+
"additionalProperties": {
1201+
"type": "string"
1202+
}
1203+
}
1204+
},
1205+
"404": {
1206+
"description": "Not Found",
1207+
"schema": {
1208+
"type": "object",
1209+
"additionalProperties": {
1210+
"type": "string"
1211+
}
1212+
}
1213+
},
1214+
"500": {
1215+
"description": "Internal Server Error",
1216+
"schema": {
1217+
"type": "object",
1218+
"additionalProperties": {
1219+
"type": "string"
1220+
}
1221+
}
1222+
},
1223+
"503": {
1224+
"description": "Service Unavailable",
1225+
"schema": {
1226+
"type": "object",
1227+
"additionalProperties": {
1228+
"type": "string"
1229+
}
1230+
}
1231+
}
1232+
}
1233+
}
1234+
},
11241235
"/api/traces": {
11251236
"get": {
11261237
"description": "Returns captured API exchange traces (request/response pairs) in reverse chronological order",
@@ -3286,7 +3397,6 @@ const docTemplate = `{
32863397
"downloaded_size": {
32873398
"type": "string"
32883399
},
3289-
"error": {},
32903400
"file_name": {
32913401
"type": "string"
32923402
},
@@ -4709,27 +4819,6 @@ const docTemplate = `{
47094819
"description": "The message role",
47104820
"type": "string"
47114821
},
4712-
"string_audios": {
4713-
"type": "array",
4714-
"items": {
4715-
"type": "string"
4716-
}
4717-
},
4718-
"string_content": {
4719-
"type": "string"
4720-
},
4721-
"string_images": {
4722-
"type": "array",
4723-
"items": {
4724-
"type": "string"
4725-
}
4726-
},
4727-
"string_videos": {
4728-
"type": "array",
4729-
"items": {
4730-
"type": "string"
4731-
}
4732-
},
47334822
"tool_call_id": {
47344823
"type": "string"
47354824
},
@@ -5323,6 +5412,10 @@ const docTemplate = `{
53235412
}
53245413
]
53255414
},
5415+
"max_completion_tokens": {
5416+
"description": "MaxCompletionTokens is the modern alias for max_tokens\n(OpenAI deprecated max_tokens; gpt-5 / o-series reject it).\nAccepted on the wire so up-to-date clients can use the new\nname; the request middleware collapses it into Maxtokens so\ninternal code reads exactly one field.",
5417+
"type": "integer"
5418+
},
53265419
"max_tokens": {
53275420
"type": "integer"
53285421
},
@@ -5654,6 +5747,109 @@ const docTemplate = `{
56545747
}
56555748
}
56565749
},
5750+
"schema.PIIDecideRequest": {
5751+
"type": "object",
5752+
"properties": {
5753+
"text": {
5754+
"description": "Text is the user-visible content to inspect. Required.",
5755+
"type": "string"
5756+
}
5757+
}
5758+
},
5759+
"schema.PIIDecideResponse": {
5760+
"type": "object",
5761+
"properties": {
5762+
"findings": {
5763+
"description": "Findings is one entry per matched span — pattern id, byte\nrange, and audit-safe hash prefix (never the matched value).",
5764+
"type": "array",
5765+
"items": {
5766+
"$ref": "#/definitions/schema.PIIFinding"
5767+
}
5768+
},
5769+
"redacted_preview": {
5770+
"description": "RedactedPreview is the input with mask-action spans replaced\nby their placeholders. Identical to Text when no findings or\nwhen the strongest action is block/route_local (which don't\nrewrite content).",
5771+
"type": "string"
5772+
},
5773+
"suggested_action": {
5774+
"description": "SuggestedAction is the strongest action across all findings:\n\"block\", \"route_local\", \"mask\", or \"allow\" (no findings).",
5775+
"type": "string"
5776+
}
5777+
}
5778+
},
5779+
"schema.PIIFinding": {
5780+
"type": "object",
5781+
"properties": {
5782+
"end": {
5783+
"type": "integer"
5784+
},
5785+
"hash_prefix": {
5786+
"type": "string"
5787+
},
5788+
"pattern": {
5789+
"type": "string"
5790+
},
5791+
"start": {
5792+
"type": "integer"
5793+
}
5794+
}
5795+
},
5796+
"schema.RouterDecideRequest": {
5797+
"type": "object",
5798+
"properties": {
5799+
"input": {
5800+
"description": "Input is the user-visible prompt text to classify. Required.\nSchema-shape extraction (chat-message concatenation, etc.) is\nthe caller's responsibility — matches the Probe contract used\nby the in-band middleware.",
5801+
"type": "string"
5802+
},
5803+
"router": {
5804+
"description": "Router is the name of the router model (a ModelConfig with a\n` + "`" + `router:` + "`" + ` block). Required.",
5805+
"type": "string"
5806+
}
5807+
}
5808+
},
5809+
"schema.RouterDecideResponse": {
5810+
"type": "object",
5811+
"properties": {
5812+
"cache_similarity": {
5813+
"description": "CacheSimilarity carries the cosine similarity of the cache hit\n(0 when not cached).",
5814+
"type": "number"
5815+
},
5816+
"cached": {
5817+
"description": "Cached is true when the decision came from the L2 embedding\ncache rather than a fresh classifier run.",
5818+
"type": "boolean"
5819+
},
5820+
"candidate": {
5821+
"description": "Candidate is the model that would be routed to. Empty when no\ncandidate covers Labels AND no fallback is configured.",
5822+
"type": "string"
5823+
},
5824+
"classifier": {
5825+
"description": "Classifier is the classifier name that produced the decision\n(e.g. \"score\").",
5826+
"type": "string"
5827+
},
5828+
"fallback": {
5829+
"description": "Fallback is true when Candidate is the router's configured\nfallback because no candidate covered Labels. Lets callers\ndistinguish \"matched\" from \"fell back\" without comparing names.",
5830+
"type": "boolean"
5831+
},
5832+
"labels": {
5833+
"description": "Labels is the set of active policy labels.",
5834+
"type": "array",
5835+
"items": {
5836+
"type": "string"
5837+
}
5838+
},
5839+
"latency_ms": {
5840+
"description": "LatencyMs is the classifier's wall-clock cost.",
5841+
"type": "integer"
5842+
},
5843+
"router": {
5844+
"description": "Router echoes the requested router model.",
5845+
"type": "string"
5846+
},
5847+
"score": {
5848+
"description": "Score is the top label's softmax probability (the\nclassifier-side confidence signal).",
5849+
"type": "number"
5850+
}
5851+
}
5852+
},
56575853
"schema.StreamOptions": {
56585854
"type": "object",
56595855
"properties": {

0 commit comments

Comments
 (0)