ollama chat api done

This commit is contained in:
Concedo 2024-11-24 00:10:15 +08:00
parent 62dde8cfb2
commit bf28d956ae
2 changed files with 78 additions and 7 deletions

View file

@ -1170,7 +1170,7 @@
},
"/api/extra/tokencount": {
"post": {
"description": "Counts the number of tokens in a string.",
"description": "Counts the number of tokens in a string, and returns their token IDs. Also aliased to /api/extra/tokenize",
"requestBody": {
"content": {
"application/json": {
@ -1209,8 +1209,19 @@
]
},
"schema": {
"$ref": "#/components/schemas/ValueResult"
}
"properties": {
"value": {
"type": "number"
},
"ids": {
"type": "array",
"items": {
"type": "integer"
}
}
},
"type": "object"
}
}
},
"description": "Successful request"
@ -1222,6 +1233,61 @@
]
}
},
"/api/extra/detokenize": {
"post": {
"description": "Converts an array of token IDs into a string.",
"requestBody": {
"content": {
"application/json": {
"example": {
"ids": [529,29989,5205,29989,29958,13]
},
"schema": {
"properties": {
"ids": {
"type": "array",
"items": {
"type": "number"
}
}
},
"type": "object"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"example": {
"result": "<|system|>\n",
"success": true
},
"schema": {
"properties": {
"result": {
"type": "string",
"description": "The detokenized string."
},
"success": {
"type": "boolean"
}
},
"type": "object"
}
}
},
"description": "Successful request"
}
},
"summary": "Converts an array of token IDs into a string.",
"tags": [
"api/extra"
]
}
},
"/api/extra/abort": {
"post": {
"description": "Aborts the currently ongoing text generation. Does not work when multiple requests are in queue.",