Skip to content

Commit 05083b9

Browse files
authored
Update latest-inference.md
1 parent 6ee55db commit 05083b9

File tree

1 file changed

+21
-79
lines changed

1 file changed

+21
-79
lines changed

articles/ai-services/openai/includes/api-versions/latest-inference.md

Lines changed: 21 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ ms.date: 07/09/2024
1010

1111
## Completions
1212

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-
1613
```HTTP
1714
POST https://{endpoint}/openai/deployments/{deployment-id}/completions?api-version=2024-06-01
1815
```
@@ -99,16 +96,18 @@ Creates a completion for the provided prompt, parameters and chosen model.
9996

10097
### Example
10198

102-
Creates a chat completion for the provided messages.
99+
Creates a completion for the provided prompt, parameters and chosen model.
103100

104101
```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
106103
107104
{
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
112111
}
113112
114113
```
@@ -117,80 +116,23 @@ POST https://{endpoint}/openai/deployments/{deployment-id}/chat/completions?api-
117116
Status Code: 200
118117
```json
119118
{
119+
"body": {
120+
"id": "cmpl-7QmVI15qgYVllxK0FtxVGG6ywfzaq",
121+
"created": 1686617332,
120122
"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.",
125+
"index": 0,
126+
"finish_reason": "stop",
127+
"logprobs": null
128+
}
187129
],
188-
"system_fingerprint": "fp_80a1bad4c7",
189130
"usage": {
190-
"completion_tokens": 22,
191-
"prompt_tokens": 26,
192-
"total_tokens": 48
131+
"completion_tokens": 20,
132+
"prompt_tokens": 6,
133+
"total_tokens": 26
193134
}
135+
}
194136
}
195137
```
196138

0 commit comments

Comments
 (0)