Skip to content

Commit 42713cd

Browse files
committed
update openAPI doc
1 parent c6133eb commit 42713cd

File tree

1 file changed

+148
-8
lines changed

1 file changed

+148
-8
lines changed

docs/openapi.json

Lines changed: 148 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"name": "Apache 2.0",
1111
"url": "https://www.apache.org/licenses/LICENSE-2.0"
1212
},
13-
"version": "2.1.1-dev0"
13+
"version": "2.1.2-dev0"
1414
},
1515
"paths": {
1616
"/": {
@@ -492,12 +492,12 @@
492492
"content": {
493493
"application/json": {
494494
"schema": {
495-
"$ref": "#/components/schemas/Completion"
495+
"$ref": "#/components/schemas/CompletionFinal"
496496
}
497497
},
498498
"text/event-stream": {
499499
"schema": {
500-
"$ref": "#/components/schemas/CompletionCompleteChunk"
500+
"$ref": "#/components/schemas/Chunk"
501501
}
502502
}
503503
}
@@ -809,7 +809,6 @@
809809
"ChatRequest": {
810810
"type": "object",
811811
"required": [
812-
"model",
813812
"messages"
814813
],
815814
"properties": {
@@ -854,7 +853,8 @@
854853
"model": {
855854
"type": "string",
856855
"description": "[UNUSED] ID of the model to use. See the model endpoint compatibility table for details on which models work with the Chat API.",
857-
"example": "mistralai/Mistral-7B-Instruct-v0.2"
856+
"example": "mistralai/Mistral-7B-Instruct-v0.2",
857+
"nullable": true
858858
},
859859
"n": {
860860
"type": "integer",
@@ -1116,7 +1116,6 @@
11161116
"CompletionRequest": {
11171117
"type": "object",
11181118
"required": [
1119-
"model",
11201119
"prompt"
11211120
],
11221121
"properties": {
@@ -1138,7 +1137,8 @@
11381137
"model": {
11391138
"type": "string",
11401139
"description": "UNUSED\nID of the model to use. See the model endpoint compatibility table for details on which models work with the Chat API.",
1141-
"example": "mistralai/Mistral-7B-Instruct-v0.2"
1140+
"example": "mistralai/Mistral-7B-Instruct-v0.2",
1141+
"nullable": true
11421142
},
11431143
"prompt": {
11441144
"$ref": "#/components/schemas/Prompt"
@@ -1324,6 +1324,17 @@
13241324
}
13251325
}
13261326
},
1327+
"FunctionName": {
1328+
"type": "object",
1329+
"required": [
1330+
"name"
1331+
],
1332+
"properties": {
1333+
"name": {
1334+
"type": "string"
1335+
}
1336+
}
1337+
},
13271338
"GenerateParameters": {
13281339
"type": "object",
13291340
"properties": {
@@ -1708,6 +1719,72 @@
17081719
}
17091720
}
17101721
},
1722+
"MessageChunk": {
1723+
"oneOf": [
1724+
{
1725+
"type": "object",
1726+
"required": [
1727+
"text",
1728+
"type"
1729+
],
1730+
"properties": {
1731+
"text": {
1732+
"type": "string"
1733+
},
1734+
"type": {
1735+
"type": "string",
1736+
"enum": [
1737+
"text"
1738+
]
1739+
}
1740+
}
1741+
},
1742+
{
1743+
"type": "object",
1744+
"required": [
1745+
"image_url",
1746+
"type"
1747+
],
1748+
"properties": {
1749+
"image_url": {
1750+
"$ref": "#/components/schemas/Url"
1751+
},
1752+
"type": {
1753+
"type": "string",
1754+
"enum": [
1755+
"image_url"
1756+
]
1757+
}
1758+
}
1759+
}
1760+
],
1761+
"discriminator": {
1762+
"propertyName": "type"
1763+
}
1764+
},
1765+
"MessageContent": {
1766+
"oneOf": [
1767+
{
1768+
"type": "string"
1769+
},
1770+
{
1771+
"type": "array",
1772+
"items": {
1773+
"$ref": "#/components/schemas/MessageChunk"
1774+
}
1775+
}
1776+
]
1777+
},
1778+
"OutputMessage": {
1779+
"oneOf": [
1780+
{
1781+
"$ref": "#/components/schemas/TextMessage"
1782+
},
1783+
{
1784+
"$ref": "#/components/schemas/ToolCallMessage"
1785+
}
1786+
]
1787+
},
17111788
"PrefillToken": {
17121789
"type": "object",
17131790
"required": [
@@ -1834,6 +1911,23 @@
18341911
}
18351912
}
18361913
},
1914+
"TextMessage": {
1915+
"type": "object",
1916+
"required": [
1917+
"role",
1918+
"content"
1919+
],
1920+
"properties": {
1921+
"content": {
1922+
"type": "string",
1923+
"example": "My name is David and I"
1924+
},
1925+
"role": {
1926+
"type": "string",
1927+
"example": "user"
1928+
}
1929+
}
1930+
},
18371931
"Token": {
18381932
"type": "object",
18391933
"required": [
@@ -1906,6 +2000,41 @@
19062000
}
19072001
}
19082002
},
2003+
"ToolCallDelta": {
2004+
"type": "object",
2005+
"required": [
2006+
"role",
2007+
"tool_calls"
2008+
],
2009+
"properties": {
2010+
"role": {
2011+
"type": "string",
2012+
"example": "assistant"
2013+
},
2014+
"tool_calls": {
2015+
"$ref": "#/components/schemas/DeltaToolCall"
2016+
}
2017+
}
2018+
},
2019+
"ToolCallMessage": {
2020+
"type": "object",
2021+
"required": [
2022+
"role",
2023+
"tool_calls"
2024+
],
2025+
"properties": {
2026+
"role": {
2027+
"type": "string",
2028+
"example": "assistant"
2029+
},
2030+
"tool_calls": {
2031+
"type": "array",
2032+
"items": {
2033+
"$ref": "#/components/schemas/ToolCall"
2034+
}
2035+
}
2036+
}
2037+
},
19092038
"ToolType": {
19102039
"oneOf": [
19112040
{
@@ -1929,6 +2058,17 @@
19292058
}
19302059
]
19312060
},
2061+
"Url": {
2062+
"type": "object",
2063+
"required": [
2064+
"url"
2065+
],
2066+
"properties": {
2067+
"url": {
2068+
"type": "string"
2069+
}
2070+
}
2071+
},
19322072
"Usage": {
19332073
"type": "object",
19342074
"required": [
@@ -1962,4 +2102,4 @@
19622102
"description": "Hugging Face Text Generation Inference API"
19632103
}
19642104
]
1965-
}
2105+
}

0 commit comments

Comments
 (0)