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-preview.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,9 @@ ms.date: 09/08/2024
10
10
11
11
## Completions - Create
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---Create) which allows you to take advantage of the latest models like GPT-4o, GPT-4o mini, and GPT-4 Turbo.
15
+
13
16
```HTTP
14
17
POST https://{endpoint}/openai/deployments/{deployment-id}/completions?api-version=2024-08-01-preview
Copy file name to clipboardExpand all lines: articles/ai-services/openai/includes/api-versions/latest-inference.md
+79-21Lines changed: 79 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,9 @@ 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
+
13
16
```HTTP
14
17
POST https://{endpoint}/openai/deployments/{deployment-id}/completions?api-version=2024-06-01
15
18
```
@@ -96,18 +99,16 @@ Creates a completion for the provided prompt, parameters and chosen model.
96
99
97
100
### Example
98
101
99
-
Creates a completion for the provided prompt, parameters and chosen model.
102
+
Creates a chat completion for the provided messages.
100
103
101
104
```HTTP
102
-
POST https://{endpoint}/openai/deployments/{deployment-id}/completions?api-version=2024-06-01
105
+
POST https://{endpoint}/openai/deployments/{deployment-id}/chat/completions?api-version=2024-06-01
103
106
104
107
{
105
-
"prompt": [
106
-
"tell me a joke about mango"
107
-
],
108
-
"max_tokens": 32,
109
-
"temperature": 1.0,
110
-
"n": 1
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
+
]
111
112
}
112
113
113
114
```
@@ -116,23 +117,80 @@ POST https://{endpoint}/openai/deployments/{deployment-id}/completions?api-versi
116
117
Status Code: 200
117
118
```json
118
119
{
119
-
"body": {
120
-
"id": "cmpl-7QmVI15qgYVllxK0FtxVGG6ywfzaq",
121
-
"created": 1686617332,
122
120
"choices": [
123
-
{
124
-
"text": "es\n\nWhat do you call a mango who's in charge?\n\nThe head mango.",
125
-
"index": 0,
126
-
"finish_reason": "stop",
127
-
"logprobs": null
128
-
}
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!",
0 commit comments