Skip to content

Commit a760a40

Browse files
bene2k1ldecarvalho-docRoRoJ
authored andcommitted
docs(genapi): add docs (scaleway#4475)
* docs(genapi): add docs * fix(genapi): tags * Apply suggestions from code review Co-authored-by: ldecarvalho-doc <[email protected]> * Apply suggestions from code review Co-authored-by: Rowena Jones <[email protected]> Co-authored-by: ldecarvalho-doc <[email protected]> --------- Co-authored-by: ldecarvalho-doc <[email protected]> Co-authored-by: Rowena Jones <[email protected]>
1 parent 3703f50 commit a760a40

File tree

4 files changed

+329
-0
lines changed

4 files changed

+329
-0
lines changed

menu/navigation.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -956,6 +956,18 @@
956956
{
957957
"label": "Data privacy",
958958
"slug": "data-privacy"
959+
},
960+
{
961+
"label": "Adding AI to VS Code using Continue",
962+
"slug": "adding-ai-to-vscode-using-continue"
963+
},
964+
{
965+
"label": "Adding AI to IntelliJ IDEA using Continue",
966+
"slug": "adding-ai-to-intellij-using-continue"
967+
},
968+
{
969+
"label": "Integrating Generative APIs with popular AI tools",
970+
"slug": "integrating-generative-apis-with-popular-tools"
959971
}
960972
],
961973
"label": "Additional Content",
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
---
2+
meta:
3+
title: Adding AI to IntelliJ IDEA using Continue and Generative APIs
4+
description: Learn how to integrate AI-powered code models into IntelliJ IDEA with Continue and Scaleway's Generative APIs.
5+
content:
6+
h1: Adding AI to IntelliJ IDEA using Continue and Generative APIs
7+
paragraph: Improve your coding efficiency by integrating AI-powered code models into IntelliJ IDEA. With Continue and Scaleway's Generative APIs, you can use AI to understand, generate, and optimize code.
8+
tags: generative-apis ai machine-learning language-models code-assistance intellij-idea continue
9+
validation_date: 2025-02-14
10+
posted_date: 2025-02-14
11+
---
12+
13+
AI-driven coding is revolutionizing software development by automating repetitive tasks, generating code snippets, improving code quality, and identifying potential bugs.
14+
By integrating AI-powered tools, developers can significantly enhance productivity and optimize workflows.
15+
This guide will help you integrate AI-powered code models into JetBrain's IntelliJ IDEA using Continue and Scaleway’s Generative APIs.
16+
17+
<Macro id="requirements" />
18+
19+
- A Scaleway account logged into the [console](https://console.scaleway.com)
20+
- [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization
21+
- A valid [API key](/iam/how-to/create-api-keys/) for API authentication
22+
- Installed [IntelliJ IDEA](https://www.jetbrains.com/idea/) on your local machine.
23+
24+
## Install Continue in IntelliJ IDEA
25+
26+
You can install Continue from the [JetBrains marketplace](https://plugins.jetbrains.com/plugin/22707-continue):
27+
28+
1. Open IntelliJ IDEA and go to **Preferences** (`Ctrl+Alt+S` on Windows/Linux, `Cmd+,` on macOS).
29+
2. Navigate to **Plugins**, then click **Marketplace**.
30+
3. Search for **Continue** and click **Install**.
31+
4. Restart IntelliJ IDEA after installation.
32+
33+
### Configure Continue to use Scaleway’s Generative APIs
34+
35+
#### Configure Continue through the graphical interface
36+
37+
To link Continue with Scaleway's Generative APIs, you can use built-in menus from Continue in IntelliJ IDEA.
38+
39+
- Click **Continue** in the menu on the right. .
40+
- In the prompt section, click on **Select model** dropdown, then on **Add Chat model**.
41+
- Select **Scaleway** as provider.
42+
- Select the model you want to use (we recommend `Qwen 2.5 Coder 32b` to get started with).
43+
- Enter your **Scaleway secret key**.
44+
<Message type="tip">
45+
To start with, we recommend you use a Scaleway secret key having access to your `default` Scaleway project.
46+
</Message>
47+
48+
These actions will edit automatically your `config.json` file. To edit it manually, see [Configure Continue through configuration file](#configure-continue-through-configuration-file).
49+
50+
<Message type="note">
51+
Embeddings and autocomplete models are not yet supported through graphical interface configuration. To enable them, you need to edit the configuration manually, see [Configure Continue through configuration file](#configure-continue-through-configuration-file).
52+
</Message>
53+
54+
#### Configure Continue through configuration file
55+
56+
To link Continue with Scaleway’s Generative APIs, you need to configure the settings file:
57+
58+
1. Locate your Continue configuration directory:
59+
- **Linux/macOS**: `~/.continue/`
60+
- **Windows**: `%USERPROFILE%\.continue\`
61+
2. Create a `config.json` file inside this directory.
62+
3. Add the following configuration:
63+
```json
64+
{
65+
"models": [
66+
{
67+
"model": "qwen2.5-coder-32b-instruct",
68+
"title": "Qwen2.5 Coder",
69+
"provider": "scaleway",
70+
"apiKey": "###SCW_SECRET_KEY###"
71+
}
72+
]
73+
}
74+
```
75+
4. Save the file and restart IntelliJ IDEA.
76+
77+
<Message type="tip">
78+
For more details on configuring `config.json`, refer to the [official Continue documentation](https://docs.continue.dev/reference).
79+
If you want to limit access to a specific Scaleway Project, you should add the field `"apiBase": "https://api.scaleway.ai/###PROJECT_ID###/v1/"` for each model (ie. `models`, `embeddingsProvider` and `tabAutocompleteModel`) since the default URL `https://api.scaleway.ai/v1/` can only be used with the `default` project.
80+
</Message>
81+
82+
### Activate Continue in IntelliJ IDEA
83+
84+
After configuring the API, activate Continue in IntelliJ IDEA:
85+
86+
- Open the **Command Search** (Press`Shift` twice quickly on Windows/Linux/macOS).
87+
- Type `"Continue"` and select the appropriate command to enable AI-powered assistance.
88+
89+
<Message type="important">
90+
Enabling tab completion **may lead to higher token consumption** as the model generates predictions for every keystroke. Be mindful of your API usage and adjust settings accordingly to avoid unexpected costs. For more information, refer to the [official Continue documentation](https://docs.continue.dev/reference#tabautocompleteoptions).
91+
</Message>
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
---
2+
meta:
3+
title: Adding AI to VS Code using Continue and Generative APIs
4+
description: Learn how to integrate AI-powered code models into VS Code with Continue and Scaleway's Generative APIs.
5+
content:
6+
h1: Adding AI to VS Code using Continue and Generative APIs
7+
paragraph: Elevate your coding experience by integrating AI-powered code models into VS Code. With Continue and Scaleway's Generative APIs, you can leverage AI to understand, generate, and optimize code with ease.
8+
tags: generative-apis ai machine-learning language-models code-assistance vs-code continue
9+
validation_date: 2025-02-14
10+
posted_date: 2025-02-14
11+
---
12+
13+
AI-powered coding is transforming software development by automating repetitive tasks, generating code, improving code quality, and even detecting and fixing bugs. By integrating AI-driven tools, developers can significantly boost productivity and streamline their workflows.
14+
This guide provides a step-by-step guide on how to integrate AI-powered code models into VS Code using Continue and Scaleway's Generative APIs.
15+
16+
<Macro id="requirements" />
17+
18+
- A Scaleway account logged into the [console](https://console.scaleway.com)
19+
- [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization
20+
- A valid [API key](/iam/how-to/create-api-keys/) for API authentication
21+
- Installed [Visual Studio Code](https://code.visualstudio.com/) on your local machine
22+
23+
## Install Continue in VS Code
24+
25+
You can install Continue directly from the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=Continue.continue) or via the command line:
26+
27+
```bash
28+
code --install-extension continue.continue
29+
```
30+
31+
### Configure Continue to use Scaleway’s Generative APIs
32+
33+
#### Configure Continue through the graphical interface
34+
35+
To link Continue with Scaleway's Generative APIs, you can use built-in menus from Continue in VS Code.
36+
37+
- Click **Continue** in the menu on the left.
38+
- In the prompt section, click on **Select model** dropdown, then on **Add Chat model**.
39+
- Select **Scaleway** as provider.
40+
- Select the model you want to use (we recommend `Qwen 2.5 Coder 32b` to get started with).
41+
- Enter your **Scaleway secret key**.
42+
<Message type="tip">
43+
To start with, we recommend you use a Scaleway secret key having access to your `default` Scaleway project.
44+
</Message>
45+
46+
These actions will edit automatically your `config.json` file. To edit it manually, see [Configure Continue through configuration file](#configure-continue-through-configuration-file).
47+
48+
<Message type="note">
49+
Embeddings and autocomplete models are not yet supported through graphical interface configuration. To enable them, you need to edit the configuration manually, see [Configure Continue through configuration file](#configure-continue-through-configuration-file).
50+
</Message>
51+
52+
#### Configure Continue through a configuration file
53+
54+
To link Continue with Scaleway's Generative APIs, you can configure a settings file:
55+
56+
- Create a `config.json` file inside your `.continue` directory.
57+
- Add the following configuration to enable Scaleway's Generative API:
58+
```json
59+
{
60+
"models": [
61+
{
62+
"model": "qwen2.5-coder-32b-instruct",
63+
"title": "Qwen2.5 Coder",
64+
"provider": "scaleway",
65+
"apiKey": "###SCW_SECRET_KEY###"
66+
}
67+
],
68+
"embeddingsProvider": {
69+
"model": "bge-multilingual-gemma2",
70+
"provider": "scaleway",
71+
"apiKey": "###SCW_SECRET_KEY###"
72+
},
73+
"tabAutocompleteModel": {
74+
"model": "qwen2.5-coder-32b",
75+
"title": "Qwen2.5 Coder Autocomplete",
76+
"provider": "scaleway",
77+
"apiKey": "###SCW_SECRET_KEY###"
78+
}
79+
}
80+
```
81+
- Save the file at the correct location:
82+
- Linux/macOS: `~/.continue/config.json`
83+
- Windows: `%USERPROFILE%\.continue\config.json`
84+
85+
<Message type="tip">
86+
For more details on configuring `config.json`, refer to the [official Continue documentation](https://docs.continue.dev/reference).
87+
If you want to limit access to a specific Scaleway Project, you should add the field `"apiBase": "https://api.scaleway.ai/###PROJECT_ID###/v1/"` for each model (ie. `models`, `embeddingsProvider` and `tabAutocompleteModel`) since the default URL `https://api.scaleway.ai/v1/` can only be used with the `default` project.
88+
</Message>
89+
90+
### Activate Continue in VS Code
91+
92+
After configuring the API, open VS Code and activate Continue:
93+
94+
- Open the **Command Palette** (`Ctrl+Shift+P` on Windows/Linux, `Cmd+Shift+P` on Mac)
95+
- Type `"Continue"` and select the appropriate command to enable AI-powered assistance.
96+
97+
<Message type="important">
98+
Enabling tab completion **may lead to higher token consumption** as the model generates predictions for every keystroke. Be mindful of your API usage and adjust settings accordingly to avoid unexpected costs. For more information, refer to the [official Continue documentation](https://docs.continue.dev/reference#tabautocompleteoptions).
99+
</Message>
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
---
2+
meta:
3+
title: Integrating Scaleway Generative APIs with popular AI tools
4+
description: Learn how to integrate Scaleway's Generative APIs with popular AI tools to unlock the full potential of your applications.
5+
content:
6+
h1: Integrating Scaleway Generative APIs with popular AI tools
7+
paragraph: Scaleway's Generative APIs provide a powerful way to integrate AI capabilities into your applications. By leveraging our APIs, you can tap into the latest advancements in natural language processing, computer vision, and more. In this guide, we'll show you how to integrate Scaleway's Generative APIs with popular AI tools like LangChain, LlamaIndex, and OpenAI.
8+
tags: generative-apis ai language-models
9+
dates:
10+
validation: 2025-02-18
11+
posted: 2025-02-18
12+
---
13+
14+
Scaleway's Generative APIs are designed to provide easy access to the latest AI models and techniques. Our APIs are built on top of a robust infrastructure that ensures scalability, reliability, and security. With our APIs, you can integrate AI capabilities into your applications, such as text generation, image classification, and more.
15+
16+
## Comparison of AI tools and libraries
17+
18+
The following table compares AI tools and libraries supported by Scaleway's Generative APIs:
19+
20+
| Tool/Library | Description | Use cases | Integration effort |
21+
| --- | --- | --- | --- |
22+
| [OpenAI client](#openai-client-libraries) | Popular AI library for natural language processing | Text generation, language translation, text summarization | Low |
23+
| [LangChain](#langchain-rag-and-llm-applications) | Library for building AI applications | Inference, embeddings, document indexing and retrieval | Medium |
24+
| [Continue Dev](#continue-dev-ai-coding-assistance) | Library for AI-powered coding assistance | Code completion, code review | Low |
25+
| [cURL/Python](#custom-http-integrations) | Direct HTTP API calls for custom integrations | Custom applications, data processing | High |
26+
27+
<Message type="note">
28+
The integration effort is subjective and may vary depending on the specific use case and requirements.
29+
</Message>
30+
31+
## OpenAI client libraries
32+
33+
Scaleway Generative APIs follow OpenAI's API structure, making integration straightforward. To get started, you'll need to install the OpenAI library and set up your API key.
34+
35+
### Configuration
36+
37+
To use the OpenAI client library with Scaleway's Generative APIs, first install the required dependencies:
38+
```bash
39+
pip install openai
40+
```
41+
42+
Then set the API key and base URL in your OpenAI-compatible client:
43+
```python
44+
from openai import OpenAI
45+
client = OpenAI(
46+
base_url="https://api.scaleway.ai/v1",
47+
api_key="<API secret key>"
48+
)
49+
```
50+
<Message type="tip">
51+
Make sure to replace `<API secret key>` with your actual API key.
52+
</Message>
53+
54+
### Using OpenAI client for text generation
55+
56+
To use OpenAI client for text generation, you can create a `client.chat.completions` object and call the `create` method:
57+
```python
58+
response = client.chat.completions.create(
59+
model="llama-3.1-8b-instruct",
60+
messages=[{"role": "user", "content": "Tell me a joke about AI"}]
61+
)
62+
print(response.choices[0].message.content)
63+
```
64+
65+
## LangChain (RAG & LLM applications)
66+
67+
LangChain is a popular library for building AI applications. Scaleway's Generative APIs support LangChain for both inference and embeddings.
68+
69+
<Message type="tip">
70+
Refer to our dedicated documentation for
71+
- [Implementing Retrieval-Augmented Generation (RAG) with LangChain and Scaleway Generative APIs](/tutorials/how-to-implement-rag-generativeapis/)
72+
</Message>
73+
74+
## Continue Dev (AI coding assistance)
75+
76+
Continue Dev is a library that provides AI-powered coding assistance. Scaleway's Generative APIs support Continue Dev for code completion and more.
77+
78+
<Message type="tip">
79+
Refer to our dedicated documentation for
80+
- [Integrating Continue Dev with Visual Studio Code](/generative-apis/reference-content/adding-ai-to-vscode-using-continue/)
81+
- [Integrating Continue Dev with IntelliJ IDEA](/generative-apis/reference-content/adding-ai-to-intellij-using-continue/)
82+
</Message>
83+
84+
## Custom HTTP integrations
85+
86+
You can interact with Scaleway's Generative APIs directly using any HTTP client.
87+
88+
### cURL example
89+
90+
To use cURL with Scaleway's Generative APIs, you can use the following command:
91+
```bash
92+
curl https://api.scaleway.ai/v1/chat/completions \
93+
-H "Authorization: Bearer <API secret key>" \
94+
-H "Content-Type: application/json" \
95+
-d '{
96+
"model": "llama-3.1-8b-instruct",
97+
"messages": [{"role": "user", "content": "What is quantum computing?"}]
98+
}'
99+
```
100+
<Message type="tip">
101+
Make sure to replace `<API secret key>` with your actual API key.
102+
</Message>
103+
104+
### Python HTTP example
105+
106+
To perform HTTP requests with Scaleway's Generative APIs, install the `requests` dependency:
107+
```bash
108+
pip install requests
109+
```
110+
111+
Then, you can use the following code:
112+
```python
113+
import requests
114+
headers = {
115+
"Authorization": "Bearer <API secret key>",
116+
"Content-Type": "application/json"
117+
}
118+
data = {
119+
"model": "llama-3.1-8b-instruct",
120+
"messages": [{"role": "user", "content": "Explain black holes"}]
121+
}
122+
response = requests.post("https://api.scaleway.ai/v1/chat/completions", json=data, headers=headers)
123+
print(response.json()["choices"][0]["message"]["content"])
124+
```
125+
<Message type="tip">
126+
Make sure to replace `<API secret key>` with your actual API key.
127+
</Message>

0 commit comments

Comments
 (0)