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
Use the reference section to explore the API design and which parameters are available. For example, the reference section for [Chat completions](reference-model-inference-chat-completions.md) details how to use the route `/chat/completions` to generate predictions based on chat-formatted instructions:
@@ -143,11 +169,13 @@ The Azure AI Model Inference API specifies a set of modalities and parameters th
143
169
144
170
By setting a header `extra-parameters: pass-through`, the API will attempt to pass any unknown parameter directly to the underlying model. If the model can handle that parameter, the request completes.
145
171
146
-
The following example shows a request passing the parameter `safe_prompt` supported by Mistral-Large, which isn't specified in the Azure AI Model Inference API:
172
+
The following example shows a request passing the parameter `safe_prompt` supported by Mistral-Large, which isn't specified in the Azure AI Model Inference API.
147
173
148
174
# [Python](#tab/python)
149
175
150
176
```python
177
+
from azure.ai.inference.models import SystemMessage, UserMessage
178
+
151
179
response = model.complete(
152
180
messages=[
153
181
SystemMessage(content="You are a helpful assistant."),
@@ -157,8 +185,13 @@ response = model.complete(
157
185
"safe_mode": True
158
186
}
159
187
)
188
+
189
+
print(response.choices[0].message.content)
160
190
```
161
191
192
+
> [!TIP]
193
+
> When using Azure AI Inference SDK, using passing extra parameters using `model_extras` configures the request with `extra-parameters: pass-through` automatically for you.
194
+
162
195
# [JavaScript](#tab/javascript)
163
196
164
197
```javascript
@@ -174,6 +207,8 @@ var response = await client.path("/chat/completions").post({
> The default value for `extra-parameters` is `error` which returns an error if an extra parameter is indicated in the payload. Alternatively, you can set `extra-parameters: ignore` to drop any unknown parameter in the request. Use this capability in case you happen to be sending requests with extra parameters that you know the model won't support but you want the request to completes anyway. A typical example of this is indicating `seed` parameter.
246
+
> [!NOTE]
247
+
> The default value for `extra-parameters` is `error` which returns an error if an extra parameter is indicated in the payload. Alternatively, you can set `extra-parameters: drop` to drop any unknown parameter in the request. Use this capability in case you happen to be sending requests with extra parameters that you know the model won't support but you want the request to completes anyway. A typical example of this is indicating `seed` parameter.
213
248
214
249
### Models with disparate set of capabilities
215
250
@@ -220,7 +255,7 @@ The following example shows the response for a chat completion request indicatin
220
255
# [Python](#tab/python)
221
256
222
257
```python
223
-
from azure.ai.inference.models import ChatCompletionsResponseFormat
258
+
from azure.ai.inference.models importSystemMessage, UserMessage, ChatCompletionsResponseFormat
224
259
from azure.core.exceptions import HttpResponseError
0 commit comments