Skip to content

Commit 6648a70

Browse files
RoRoJfpagny
andcommitted
Apply suggestions from code review
Co-authored-by: fpagny <[email protected]>
1 parent bc8467b commit 6648a70

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

pages/generative-apis/how-to/query-reasoning-models.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Requirements from '@macros/iam/requirements.mdx'
1010

1111
Scaleway's Generative APIs service allows users to interact with language models benefitting from additional reasoning capabilities.
1212

13-
A reasoning model is a language model that is capable of carrying out multiple inference steps and systematically verifying intermediate results before producing answers. You can specify how much effort it should put into reasoning via dedicated parameters, and access reasoning metadata (summaries, step counts, etc.) in its outputs. Even with default parameters, such models are designed to perform better on reasoning tasks like maths and logic problems, than non-reasoning language models.
13+
A reasoning model is a language model that is capable of carrying out multiple inference steps and systematically verifying intermediate results before producing answers. You can specify how much effort it should put into reasoning via dedicated parameters, and access reasoning content in its outputs. Even with default parameters, such models are designed to perform better on reasoning tasks like maths and logic problems, than non-reasoning language models.
1414

1515
Language models supporting the reasoning feature include `gpt-oss-120b`. See [Supported Models](/generative-apis/reference-content/supported-models/) for a full list.
1616

@@ -40,7 +40,7 @@ The web playground displays.
4040
### Using the playground
4141

4242
1. Enter a prompt at the bottom of the page, or use one of the suggested prompts in the conversation area.
43-
2. Edit the hyperparameters listed on the right column, for example the default temperature for more or less randomness on the outputs.
43+
2. Edit the parameters listed on the right column, for example the default temperature for more or less randomness on the outputs.
4444
3. Switch models at the top of the page, to observe the capabilities of chat models offered via Generative APIs.
4545
4. Click **View code** to get code snippets configured according to your settings in the playground.
4646

@@ -57,7 +57,7 @@ In the example that follows, we will use the OpenAI Python client.
5757

5858
Both the [Chat Completions API](/https://www.scaleway.com/en/developers/api/generative-apis/#path-chat-completions-create-a-chat-completion) and the [Responses API](https://www.scaleway.com/en/developers/api/generative-apis/#path-chat-completions-create-a-chat-completion) allow you to access and control reasoning for supported models. Scaleway's support of the Responses API is currently in beta.
5959

60-
Note however, that the Responses API was introduced in part to better support features for reasoning workflows, among other tasks. It provides richer support for reasoning than Chat Completions, for example by providing chain-of-thought reasoning summaries in its responses.
60+
Note however, that the Responses API was introduced in part to better support features for reasoning workflows, among other tasks. It provides richer support for reasoning than Chat Completions, for example by providing chain-of-thought reasoning content in its responses.
6161

6262
For more information on Chat Completions versus Responses API, see the information provided in the [querying language models](/generative-apis/how-to/query-language-models/#chat-completions-api-or-responses-api) documentation.
6363

@@ -124,15 +124,15 @@ You can now create a chat completion with reasoning, using either the Chat Compl
124124
model="gpt-oss-120b",
125125
input=[{"role": "user", "content": "Briefly describe a futuristic city with advanced technology and green energy solutions."}],
126126
temperature=0.2, # Adjusts creativity
127-
max_output_tokens=100, # Limits the length of the output
127+
max_output_tokens=512, # Limits the length of the output
128128
top_p=0.7, # Controls diversity through nucleus sampling. You usually only need to use temperature.
129129
reasoning={"effort":"medium"}
130130
)
131131
# Print the generated response. Here, the last output message will contain the final content.
132132
# Previous outputs will contain reasoning content.
133133
for output in response.output:
134134
if output.type == "reasoning":
135-
print(f"Reasoning: {output.content[0].text}")
135+
print(f"Reasoning: {output.content[0].text}") # output.content[0].text can only be used with openai >= 1.100.0
136136
if output.type == "message":
137137
print(f"Answer: {output.content[0].text}")
138138
```
@@ -161,5 +161,5 @@ Note that the `reasoning_effort` parameter is not available for this model.
161161
162162
## Impact on token generation
163163
164-
Reasoning models generate reasoning tokens, which are billable. Generally these are in the model's output as part of the reasoning summary. To limit generation of reasoning tokens, you can adjust settings for the **reasoning effort** and **max completion/output tokens** parameters. Alternatively, use a non-reasoning model to avoid generation of reasoning tokens and subsequent billing.
164+
Reasoning models generate reasoning tokens, which are billable. Generally these are in the model's output as part of the reasoning content. To limit generation of reasoning tokens, you can adjust settings for the **reasoning effort** and **max completion/output tokens** parameters. Alternatively, use a non-reasoning model to avoid generation of reasoning tokens and subsequent billing.
165165

0 commit comments

Comments
 (0)