Skip to content

Commit c3015ef

Browse files
authored
Merge branch 'main' into MTA-5092
2 parents c3fc3ef + 8080918 commit c3015ef

File tree

120 files changed

+1791
-353
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+1791
-353
lines changed

ai-data/generative-apis/api-cli/using-chat-api.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Creates a model response for the given chat conversation.
2323
curl --request POST \
2424
--url https://api.scaleway.ai/v1/chat/completions \
2525
--header 'Authorization: Bearer ${SCW_SECRET_KEY}' \
26-
--header 'Content-Type: application/json'
26+
--header 'Content-Type: application/json' \
2727
--data '{
2828
"model": "llama-3.1-8b-instruct",
2929
"messages": [

ai-data/generative-apis/api-cli/using-generative-apis.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ dates:
2020

2121
All requests to the Scaleway Generative APIs must include an `Authorization` HTTP header with your API key prefixed by `Bearer`.
2222

23-
We recommend exporting your secret key as an environment variable, which you can then pass directly in your curl request as follows. Remember to replace the example value with your own API secret key.
23+
We recommend exporting your secret key as an environment variable, which you can then pass directly in your curl request as follows. Remember to replace the example value with *your own API secret key*.
2424

2525
```
2626
export SCW_SECRET_KEY=720438f9-fcb9-4ebb-80a7-808ebf15314b

ai-data/generative-apis/how-to/query-text-models.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ from openai import OpenAI
5454
# Initialize the client with your base URL and API key
5555
client = OpenAI(
5656
base_url="https://api.scaleway.ai/v1", # Scaleway's Generative APIs service URL
57-
api_key="<SCW_API_KEY>" # Your unique API key from Scaleway
57+
api_key="<SCW_SECRET_KEY>" # Your unique API secret key from Scaleway
5858
)
5959
```
6060

@@ -69,7 +69,7 @@ response = client.chat.completions.create(
6969
messages=[{"role": "user", "content": "Describe a futuristic city with advanced technology and green energy solutions."}],
7070
temperature=0.2, # Adjusts creativity
7171
max_tokens=100, # Limits the length of the output
72-
top_p=0.7 # Controls diversity through nucleus sampling
72+
top_p=0.7 # Controls diversity through nucleus sampling. You usually only need to use temperature.
7373
)
7474

7575
# Print the generated response

ai-data/generative-apis/how-to/use-structured-outputs.mdx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ extract = client.chat.completions.create(
162162
response_format={
163163
"type": "json_schema",
164164
"json_schema": {
165+
"name": "VoiceNote",
165166
"schema": VoiceNote.model_json_schema(),
166167
}
167168
},
@@ -203,6 +204,7 @@ extract = client.chat.completions.create(
203204
response_format={
204205
"type": "json_schema",
205206
"json_schema": {
207+
"name": "VoiceNote",
206208
"schema": {
207209
"type": "object",
208210
"properties": {
@@ -213,6 +215,7 @@ extract = client.chat.completions.create(
213215
"items": {"type": "string"}
214216
}
215217
},
218+
"additionalProperties": false,
216219
"required": ["title", "summary", "actionItems"]
217220
}
218221
}
@@ -235,6 +238,10 @@ Output example:
235238
}
236239
```
237240

241+
<Message type="tip">
242+
When using the OpenAI SDKs like in the examples above, you are expected to set `additionalProperties` to false, and to specify all your properties as required.
243+
</Message>
244+
238245
## Conclusion
239246

240247
Using structured outputs with LLMs can significantly enhance data handling in your applications.
@@ -243,4 +250,4 @@ By choosing between JSON mode and Structured outputs with JSON schema, you contr
243250
- **JSON mode** is flexible but less predictable.
244251
- **Structured outputs** provide strict adherence to a predefined schema, ensuring consistency.
245252

246-
Experiment with both methods to determine which best fits your application's requirements.
253+
Experiment with both methods to determine which best fits your application's requirements.

ai-data/generative-apis/quickstart.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ pip install openai
5555
from openai import OpenAI
5656

5757
client = OpenAI(
58-
base_url="https://api.scaleway.ai/v1",
59-
api_key="<SCW_API_KEY>"
58+
base_url="https://api.scaleway.ai/v1", # # Scaleway's Generative APIs service URL
59+
api_key="<SCW_SECRET_KEY>" # Your unique API secret key from Scaleway
6060
)
6161
```
6262

63-
Make sure that you replace `<SCW_API_KEY>` with the API key obtained from your Scaleway account.
63+
Make sure that you replace `<SCW_SECRET_KEY>` with the API key obtained from your Scaleway account.
6464

6565
<Message type="tip">
6666
It is recommended to store your API keys securely using environment variables or [secret management tools](/identity-and-access-management/secret-manager/) to prevent unauthorized access.

ai-data/managed-inference/reference-content/llama-3-70b-instruct.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ curl -s \
6161
-H "Authorization: Bearer <IAM API key>" \
6262
-H "Content-Type: application/json" \
6363
--request POST \
64-
--url "https://<Deployment UUID>.ifr.fr-par.scw.cloud/v1/chat/completions" \
64+
--url "https://<Deployment UUID>.ifr.fr-par.scaleway.com/v1/chat/completions" \
6565
--data '{"model":"llama-3-70b-instruct", "messages":[{"role": "user","content": "Sing me a song about Xavier Niel"}], "max_tokens": 500, "top_p": 1, "temperature": 0.7, "stream": false}'
6666
```
6767

ai-data/managed-inference/reference-content/llama-3-8b-instruct.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ curl -s \
6565
-H "Authorization: Bearer <IAM API key>" \
6666
-H "Content-Type: application/json" \
6767
--request POST \
68-
--url "https://<Deployment UUID>.ifr.fr-par.scw.cloud/v1/chat/completions" \
68+
--url "https://<Deployment UUID>.ifr.fr-par.scaleway.com/v1/chat/completions" \
6969
--data '{"model":"llama-3-8b-instruct", "messages":[{"role": "user","content": "There is a llama in my garden, what should I do?"}], "max_tokens": 500, "top_p": 1, "temperature": 0.7, "stream": false}'
7070
```
7171

ai-data/managed-inference/reference-content/llama-3.1-70b-instruct.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ curl -s \
6060
-H "Authorization: Bearer <IAM API key>" \
6161
-H "Content-Type: application/json" \
6262
--request POST \
63-
--url "https://<Deployment UUID>.ifr.fr-par.scw.cloud/v1/chat/completions" \
63+
--url "https://<Deployment UUID>.ifr.fr-par.scaleway.com/v1/chat/completions" \
6464
--data '{"model":"llama-3.1-70b-instruct", "messages":[{"role": "user","content": "There is a llama in my garden, what should I do?"}], "max_tokens": 500, "temperature": 0.7, "stream": false}'
6565
```
6666

ai-data/managed-inference/reference-content/llama-3.1-8b-instruct.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ curl -s \
6161
-H "Authorization: Bearer <IAM API key>" \
6262
-H "Content-Type: application/json" \
6363
--request POST \
64-
--url "https://<Deployment UUID>.ifr.fr-par.scw.cloud/v1/chat/completions" \
64+
--url "https://<Deployment UUID>.ifr.fr-par.scaleway.com/v1/chat/completions" \
6565
--data '{"model":"llama-3.1-8b-instruct", "messages":[{"role": "user","content": "There is a llama in my garden, what should I do?"}], "max_tokens": 500, "temperature": 0.7, "stream": false}'
6666
```
6767

ai-data/managed-inference/reference-content/mistral-7b-instruct-v0.3.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ curl -s \
5454
-H "Authorization: Bearer <IAM API key>" \
5555
-H "Content-Type: application/json" \
5656
--request POST \
57-
--url "https://<Deployment UUID>.ifr.fr-par.scw.cloud/v1/chat/completions" \
57+
--url "https://<Deployment UUID>.ifr.fr-par.scaleway.com/v1/chat/completions" \
5858
--data '{"model":"mistral-7b-instruct-v0.3", "messages":[{"role": "user","content": "Explain Public Cloud in a nutshell."}], "top_p": 1, "temperature": 0.7, "stream": false}'
5959
```
6060

0 commit comments

Comments
 (0)