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: pages/generative-apis/how-to/query-reasoning-models.mdx
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ import Requirements from '@macros/iam/requirements.mdx'
10
10
11
11
Scaleway's Generative APIs service allows users to interact with language models benefitting from additional reasoning capabilities.
12
12
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.
14
14
15
15
Language models supporting the reasoning feature include `gpt-oss-120b`. See [Supported Models](/generative-apis/reference-content/supported-models/) for a full list.
16
16
@@ -40,7 +40,7 @@ The web playground displays.
40
40
### Using the playground
41
41
42
42
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.
44
44
3. Switch models at the top of the page, to observe the capabilities of chat models offered via Generative APIs.
45
45
4. Click **View code** to get code snippets configured according to your settings in the playground.
46
46
@@ -57,7 +57,7 @@ In the example that follows, we will use the OpenAI Python client.
57
57
58
58
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.
59
59
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.
61
61
62
62
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.
63
63
@@ -124,15 +124,15 @@ You can now create a chat completion with reasoning, using either the Chat Compl
124
124
model="gpt-oss-120b",
125
125
input=[{"role": "user", "content": "Briefly describe a futuristic city with advanced technology and green energy solutions."}],
126
126
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
128
128
top_p=0.7, # Controls diversity through nucleus sampling. You usually only need to use temperature.
129
129
reasoning={"effort":"medium"}
130
130
)
131
131
# Print the generated response. Here, the last output message will contain the final content.
132
132
# Previous outputs will contain reasoning content.
133
133
for output in response.output:
134
134
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
136
136
if output.type =="message":
137
137
print(f"Answer: {output.content[0].text}")
138
138
```
@@ -161,5 +161,5 @@ Note that the `reasoning_effort` parameter is not available for this model.
161
161
162
162
## Impact on token generation
163
163
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.
0 commit comments