Skip to content

Commit 755cc31

Browse files
committed
fix: reasoning
1 parent eba41eb commit 755cc31

File tree

9 files changed

+51
-41
lines changed

9 files changed

+51
-41
lines changed

articles/ai-foundry/model-inference/includes/use-chat-completions/csharp.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,12 @@ To use chat completion models in your application, you need:
2626

2727
* A chat completions model deployment. If you don't have one read [Add and configure models to Azure AI services](../../how-to/create-model-deployments.md) to add a chat completions model to your resource.
2828

29-
* Install the Azure AI inference package with the following command:
29+
* Install the [Azure AI inference package](https://aka.ms/azsdk/azure-ai-inference/python/reference) with the following command:
3030

3131
```bash
3232
dotnet add package Azure.AI.Inference --prerelease
3333
```
3434

35-
> [!TIP]
36-
> Read more about the [Azure AI inference package and reference](https://aka.ms/azsdk/azure-ai-inference/python/reference).
37-
3835
* If you are using Entra ID, you also need the following package:
3936

4037
```bash

articles/ai-foundry/model-inference/includes/use-chat-completions/java.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ To use chat completion models in your application, you need:
2626

2727
* A chat completions model deployment. If you don't have one read [Add and configure models to Azure AI services](../../how-to/create-model-deployments.md) to add a chat completions model to your resource.
2828

29-
* Add the Azure AI inference package to your project:
29+
* Add the [Azure AI inference package](https://aka.ms/azsdk/azure-ai-inference/java/reference) to your project:
3030

3131
```xml
3232
<dependency>
@@ -36,9 +36,6 @@ To use chat completion models in your application, you need:
3636
</dependency>
3737
```
3838

39-
> [!TIP]
40-
> Read more about the [Azure AI inference package and reference](https://aka.ms/azsdk/azure-ai-inference/java/reference).
41-
4239
* If you are using Entra ID, you also need the following package:
4340

4441
```xml

articles/ai-foundry/model-inference/includes/use-chat-completions/javascript.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,12 @@ To use chat completion models in your application, you need:
2626

2727
* A chat completions model deployment. If you don't have one read [Add and configure models to Azure AI services](../../how-to/create-model-deployments.md) to add a chat completions model to your resource.
2828

29-
* Install the Azure Inference library for JavaScript with the following command:
29+
* Install the [Azure Inference library for JavaScript](https://aka.ms/azsdk/azure-ai-inference/javascript/reference) with the following command:
3030

3131
```bash
3232
npm install @azure-rest/ai-inference
3333
```
3434
35-
> [!TIP]
36-
> Read more about the [Azure AI inference package and reference](https://aka.ms/azsdk/azure-ai-inference/javascript/reference).
37-
3835
## Use chat completions
3936

4037
First, create the client to consume the model. The following code uses an endpoint URL and key that are stored in environment variables.

articles/ai-foundry/model-inference/includes/use-chat-completions/python.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,12 @@ To use chat completion models in your application, you need:
2626

2727
* A chat completions model deployment. If you don't have one read [Add and configure models to Azure AI services](../../how-to/create-model-deployments.md) to add a chat completions model to your resource.
2828

29-
* Install the Azure AI inference package with the following command:
29+
* Install the [Azure AI inference package for Python](https://aka.ms/azsdk/azure-ai-inference/python/reference) with the following command:
3030

3131
```bash
3232
pip install -U azure-ai-inference
3333
```
3434

35-
> [!TIP]
36-
> Read more about the [Azure AI inference package and reference](https://aka.ms/azsdk/azure-ai-inference/python/reference).
37-
3835
## Use chat completions
3936

4037
First, create the client to consume the model. The following code uses an endpoint URL and key that are stored in environment variables.

articles/ai-foundry/model-inference/includes/use-chat-reasoning/csharp.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,13 @@ ChatCompletionsOptions requestOptions = new ChatCompletionsOptions()
7373
Response<ChatCompletions> response = client.Complete(requestOptions);
7474
```
7575
76-
When building prompts for reasoning models, built-in reasoning capabilities make simple zero-shot prompts as effective as more complex methods. When providing additional context or documents, like in RAG scenarios, including only the most relevant information may help preventing the model from over-complicating its response.
76+
When building prompts for reasoning models, take the following into consideration:
77+
78+
> [!div class="checklist"]
79+
> * Built-in reasoning capabilities make simple zero-shot prompts as effective as more complex methods.
80+
> * When providing additional context or documents, like in RAG scenarios, including only the most relevant information may help preventing the model from over-complicating its response.
81+
> * Reasoning models may support the use of system messages. However, they may not follow them as strictly as other non-reasoning models.
82+
> * When creating multi-turn applications, consider only appending the final answer from the model, without it's reasoning content as explained at [Reasoning content](#reasoning-content) section.
7783

7884
The response is as follows, where you can see the model's usage statistics:
7985

articles/ai-foundry/model-inference/includes/use-chat-reasoning/java.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ To complete this tutorial, you need:
2121

2222
* This examples uses `DeepSeek-R1`.
2323

24-
* Add the Azure AI inference package to your project:
24+
* Add the [Azure AI inference package](https://aka.ms/azsdk/azure-ai-inference/java/reference) to your project:
2525

2626
```xml
2727
<dependency>
@@ -31,9 +31,6 @@ To complete this tutorial, you need:
3131
</dependency>
3232
```
3333

34-
> [!TIP]
35-
> Read more about the [Azure AI inference package and reference](https://aka.ms/azsdk/azure-ai-inference/java/reference).
36-
3734
* If you are using Entra ID, you also need the following package:
3835

3936
```xml
@@ -97,7 +94,13 @@ ChatCompletionsOptions requestOptions = new ChatCompletionsOptions()
9794
Response<ChatCompletions> response = client.complete(requestOptions);
9895
```
9996
100-
When building prompts for reasoning models, built-in reasoning capabilities make simple zero-shot prompts as effective as more complex methods. When providing additional context or documents, like in RAG scenarios, including only the most relevant information may help preventing the model from over-complicating its response.
97+
When building prompts for reasoning models, take the following into consideration:
98+
99+
> [!div class="checklist"]
100+
> * Built-in reasoning capabilities make simple zero-shot prompts as effective as more complex methods.
101+
> * When providing additional context or documents, like in RAG scenarios, including only the most relevant information may help preventing the model from over-complicating its response.
102+
> * Reasoning models may support the use of system messages. However, they may not follow them as strictly as other non-reasoning models.
103+
> * When creating multi-turn applications, consider only appending the final answer from the model, without it's reasoning content as explained at [Reasoning content](#reasoning-content) section.
101104

102105
The response is as follows, where you can see the model's usage statistics:
103106

articles/ai-foundry/model-inference/includes/use-chat-reasoning/javascript.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,13 @@ var response = await client.path("/chat/completions").post({
7676
});
7777
```
7878

79-
When building prompts for reasoning models, built-in reasoning capabilities make simple zero-shot prompts as effective as more complex methods. When providing additional context or documents, like in RAG scenarios, including only the most relevant information may help preventing the model from over-complicating its response.
79+
When building prompts for reasoning models, take the following into consideration:
80+
81+
> [!div class="checklist"]
82+
> * Built-in reasoning capabilities make simple zero-shot prompts as effective as more complex methods.
83+
> * When providing additional context or documents, like in RAG scenarios, including only the most relevant information may help preventing the model from over-complicating its response.
84+
> * Reasoning models may support the use of system messages. However, they may not follow them as strictly as other non-reasoning models.
85+
> * When creating multi-turn applications, consider only appending the final answer from the model, without it's reasoning content as explained at [Reasoning content](#reasoning-content) section.
8086
8187
The response is as follows, where you can see the model's usage statistics:
8288

articles/ai-foundry/model-inference/includes/use-chat-reasoning/python.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,12 @@ To complete this tutorial, you need:
2121

2222
* This examples uses `DeepSeek-R1`.
2323

24-
* Install the Azure AI inference package with the following command:
24+
* Install the [Azure AI inference package](https://aka.ms/azsdk/azure-ai-inference/python/reference) with the following command:
2525

2626
```bash
2727
pip install -U azure-ai-inference
2828
```
2929

30-
> [!TIP]
31-
> Read more about the [Azure AI inference package and reference](https://aka.ms/azsdk/azure-ai-inference/python/reference).
32-
3330
## Use reasoning capabilities with chat
3431

3532
First, create the client to consume the model. The following code uses an endpoint URL and key that are stored in environment variables.
@@ -78,7 +75,13 @@ response = client.complete(
7875
)
7976
```
8077

81-
When building prompts for reasoning models, built-in reasoning capabilities make simple zero-shot prompts as effective as more complex methods. When providing additional context or documents, like in RAG scenarios, including only the most relevant information may help preventing the model from over-complicating its response.
78+
When building prompts for reasoning models, take the following into consideration:
79+
80+
> [!div class="checklist"]
81+
> * Built-in reasoning capabilities make simple zero-shot prompts as effective as more complex methods.
82+
> * When providing additional context or documents, like in RAG scenarios, including only the most relevant information may help preventing the model from over-complicating its response.
83+
> * Reasoning models may support the use of system messages. However, they may not follow them as strictly as other non-reasoning models.
84+
> * When creating multi-turn applications, consider only appending the final answer from the model, without it's reasoning content as explained at [Reasoning content](#reasoning-content) section.
8285
8386
The response is as follows, where you can see the model's usage statistics:
8487

articles/ai-foundry/model-inference/includes/use-chat-reasoning/rest.md

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,13 @@ The following example shows how you can create a basic reasoning capabilities wi
5555
}
5656
```
5757

58-
When building prompts for reasoning models, built-in reasoning capabilities make simple zero-shot prompts as effective as more complex methods. When providing additional context or documents, like in RAG scenarios, including only the most relevant information may help preventing the model from over-complicating its response.
58+
When building prompts for reasoning models, take the following into consideration:
59+
60+
> [!div class="checklist"]
61+
> * Built-in reasoning capabilities make simple zero-shot prompts as effective as more complex methods.
62+
> * When providing additional context or documents, like in RAG scenarios, including only the most relevant information may help preventing the model from over-complicating its response.
63+
> * Reasoning models may support the use of system messages. However, they may not follow them as strictly as other non-reasoning models.
64+
> * When creating multi-turn applications, consider only appending the final answer from the model, without it's reasoning content as explained at [Reasoning content](#reasoning-content) section.
5965
6066
The response is as follows, where you can see the model's usage statistics:
6167

@@ -84,18 +90,6 @@ The response is as follows, where you can see the model's usage statistics:
8490
}
8591
```
8692

87-
### Parameters
88-
89-
In general, reasoning models don't support the following parameters you can find in chat completion models:
90-
91-
* Temperature
92-
* Presence penalty
93-
* Repetition penalty
94-
* Parameter `top_p`
95-
96-
Some models support the use of tools or structured outputs (including JSON-schemas). Read the [Models](../../concepts/models.md) details page to understand each model's support.
97-
98-
9993
### Reasoning content
10094

10195
Some reasoning models, like DeepSeek-R1, generate completions and include the reasoning behind it. The reasoning associated with the completion is included in the response's content within the tags `<think>` and `</think>`. The model may select on which scenarios to generate reasoning content.
@@ -177,6 +171,16 @@ The last message in the stream has `finish_reason` set, indicating the reason fo
177171
}
178172
```
179173

174+
### Parameters
175+
176+
In general, reasoning models don't support the following parameters you can find in chat completion models:
177+
178+
* Temperature
179+
* Presence penalty
180+
* Repetition penalty
181+
* Parameter `top_p`
182+
183+
Some models support the use of tools or structured outputs (including JSON-schemas). Read the [Models](../../concepts/models.md) details page to understand each model's support.
180184

181185
### Apply content safety
182186

0 commit comments

Comments
 (0)