You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/ai-services/openai/includes/api-versions/latest-inference.md
+21-79Lines changed: 21 additions & 79 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,9 +10,6 @@ ms.date: 07/09/2024
10
10
11
11
## Completions
12
12
13
-
> [!IMPORTANT]
14
-
> Unless you have a specific use case that requires the completions endpoint, we recommend instead using the [chat completions endpoint](#Chat-completions) which allows you to take advantage of the latest models like GPT-4o, GPT-4o mini, and GPT-4 Turbo.
15
-
16
13
```HTTP
17
14
POST https://{endpoint}/openai/deployments/{deployment-id}/completions?api-version=2024-06-01
18
15
```
@@ -99,16 +96,18 @@ Creates a completion for the provided prompt, parameters and chosen model.
99
96
100
97
### Example
101
98
102
-
Creates a chat completion for the provided messages.
99
+
Creates a completion for the provided prompt, parameters and chosen model.
103
100
104
101
```HTTP
105
-
POST https://{endpoint}/openai/deployments/{deployment-id}/chat/completions?api-version=2024-06-01
102
+
POST https://{endpoint}/openai/deployments/{deployment-id}/completions?api-version=2024-06-01
106
103
107
104
{
108
-
"messages": [
109
-
{"role": "system", "content": "Provide some context and/or instructions to the model"},
110
-
{"role": "user", "content": "tell me a joke about mango"}
111
-
]
105
+
"prompt": [
106
+
"tell me a joke about mango"
107
+
],
108
+
"max_tokens": 32,
109
+
"temperature": 1.0,
110
+
"n": 1
112
111
}
113
112
114
113
```
@@ -117,80 +116,23 @@ POST https://{endpoint}/openai/deployments/{deployment-id}/chat/completions?api-
117
116
Status Code: 200
118
117
```json
119
118
{
119
+
"body": {
120
+
"id": "cmpl-7QmVI15qgYVllxK0FtxVGG6ywfzaq",
121
+
"created": 1686617332,
120
122
"choices": [
121
-
{
122
-
"content_filter_results": {
123
-
"hate": {
124
-
"filtered": false,
125
-
"severity": "safe"
126
-
},
127
-
"profanity": {
128
-
"filtered": false,
129
-
"detected": false
130
-
},
131
-
"self_harm": {
132
-
"filtered": false,
133
-
"severity": "safe"
134
-
},
135
-
"sexual": {
136
-
"filtered": false,
137
-
"severity": "safe"
138
-
},
139
-
"violence": {
140
-
"filtered": false,
141
-
"severity": "safe"
142
-
}
143
-
},
144
-
"finish_reason": "stop",
145
-
"index": 0,
146
-
"logprobs": null,
147
-
"message": {
148
-
"content": "Sure, here's a mango joke for you:\n\nWhy did the mango blush?\n\nBecause it saw the salad dressing!",
149
-
"role": "assistant"
150
-
}
151
-
}
152
-
],
153
-
"created": 1726694535,
154
-
"id": "chatcmpl-A8wPnNAjr2YPtA50Tex0ya7tRDadM",
155
-
"model": "gpt-4o-2024-05-13",
156
-
"object": "chat.completion",
157
-
"prompt_filter_results": [
158
-
{
159
-
"prompt_index": 0,
160
-
"content_filter_results": {
161
-
"hate": {
162
-
"filtered": false,
163
-
"severity": "safe"
164
-
},
165
-
"jailbreak": {
166
-
"filtered": false,
167
-
"detected": false
168
-
},
169
-
"profanity": {
170
-
"filtered": false,
171
-
"detected": false
172
-
},
173
-
"self_harm": {
174
-
"filtered": false,
175
-
"severity": "safe"
176
-
},
177
-
"sexual": {
178
-
"filtered": false,
179
-
"severity": "safe"
180
-
},
181
-
"violence": {
182
-
"filtered": false,
183
-
"severity": "safe"
184
-
}
185
-
}
186
-
}
123
+
{
124
+
"text": "es\n\nWhat do you call a mango who's in charge?\n\nThe head mango.",
0 commit comments