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
title: How to query code models with Scaleway's Generative APIs
4
-
description: Learn how to interact with powerful code models using Scaleway's Generative APIs service. Integrate with VS Code and IntelliJ for enhanced coding experience.
3
+
title: How to query code models
4
+
description: Learn how to interact with powerful language models specialized in code using Scaleway's Generative APIs service.
5
5
content:
6
-
h1: How to query code models with Scaleway's Generative APIs
7
-
paragraph: Scaleway's Generative APIs service allows users to interact with powerful code models hosted on the platform. These code models are specialized in understanding code, generating code, and fixing code. With Scaleway's Generative APIs, you can integrate these code models with popular IDEs like VS Code and IntelliJ.
@@ -28,100 +28,35 @@ Code models are also ideal AI assistants when **added to IDEs** (integrated deve
28
28
- A Scaleway account logged into the [console](https://console.scaleway.com)
29
29
-[Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization
30
30
- A valid [API key](/iam/how-to/create-api-keys/) for API authentication
31
-
- Python 3.7+ installed on your system
32
31
- An IDE such as Visual Studio Code or JetBrains
33
32
34
-
### Querying code models with Scaleway's Generative APIs
35
-
36
-
1. Set up the OpenAI Python SDK:
37
-
- Install the SDK by running:
38
-
```bash
39
-
pip install openai
40
-
```
41
-
- Configure the SDK with your API key and Scaleway's API base URL:
42
-
```python
43
-
from openai import OpenAI
44
-
45
-
client = OpenAI(
46
-
base_url="https://api.scaleway.ai/v1",
47
-
api_key="###SCW_SECRET_KEY###"
48
-
)
49
-
```
50
-
Replace `"###SCW_SECRET_KEY###"` with your actual API secret key.
51
-
52
-
2. Make an API request:
53
-
- To generate code or receive assistance, send a request to the chat completion endpoint:
54
-
```python
55
-
completion = client.chat.completions.create(
56
-
model="qwen2.5-coder-32b-instruct",
57
-
messages=[{"role": "user", "content": "Write a Python function to sort a list using quicksort."}],
58
-
temperature=0.7,
59
-
max_tokens=150
60
-
)
61
-
62
-
print(completion.choices[0].message.content)
63
-
```
64
-
This will generate a Python function implementing the quicksort algorithm.
65
-
66
-
67
-
## Integrating Continue in VS Code and JetBrains IntelliJ
68
-
69
-
[Continue](https://www.continue.dev/) is an open-source code assistant that connects AI models to your IDE. It is available for Visual Studio Code (VS Code) and JetBrains IntelliJ:
70
-
71
-
*[Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=Continue.continue)
1. Open VS Code and navigate to the **Extensions** view (`Ctrl+Shift+X`).
79
-
2. Type `Continue` in the search bar and click **Install**.
80
-
3. The **Continue** icon should appear on the sidebar.
81
-
82
-
#### For JetBrains IntelliJ
83
-
84
-
1. Open your JetBrains IDE and go to **Settings** (`Ctrl+Alt+S`).
85
-
2. Select **Plugins** and search for `Continue` in the marketplace.
86
-
3. Click **Install**. The `Continue` icon should appear on the toolbar.
87
-
88
-
### Configuration of Continue
89
-
90
-
1. Locate the configuration file. The `config.json` file is typically found at:
91
-
-`~/.continue/config.json` on Linux/macOS
92
-
-`%USERPROFILE%\.continue\config.json` on Windows
93
-
94
-
2. Configure Continue to use Scaleway's API:
95
-
- Add the following configuration:
96
-
```json
97
-
{
98
-
"models": [
99
-
{
100
-
"model": "qwen2.5-coder-32b-instruct",
101
-
"title": "Qwen2.5-coder",
102
-
"provider": "scaleway",
103
-
"apiKey": "###SCW_SECRET_KEY###"
104
-
}
105
-
]
106
-
}
107
-
```
108
-
<Messagetype="tip">
109
-
Read more about how to set up your `config.json` on the [official Continue documentation](https://docs.continue.dev/reference).
110
-
</Message>
111
-
3. Restart your IDE after you have modified and saved the configuration file.
112
-
4. Open the **Command Palette** in VS Code by pressing `Ctrl+Shift+P` (Windows/Linux) or `Cmd+Shift+P` (Mac) and type `Continue` to access the extension's features.
33
+
## Install Continue in your IDE
113
34
114
-
<Messagetype="tip">
115
-
Refer to our dedicated documentation for detailed information on how to integrate Continue in your favourite IDE.
116
-
-[Integrating Continue Dev with Visual Studio Code](/generative-apis/reference-content/adding-ai-to-vscode-using-continue/)
117
-
-[Integrating Continue Dev with IntelliJ IDEA](/generative-apis/reference-content/adding-ai-to-intellij-using-continue/)
118
-
</Message>
35
+
[Continue](https://www.continue.dev/) is an [open-source code assistant](https://github.com/continuedev/continue) to connect AI models to your IDE.
36
+
37
+
To get Continue, simply hit `install` in your IDE's marketplace:
38
+
-[Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=Continue.continue)
## Configure Scaleway as an API provider in Continue
119
42
120
-
### Using Continue with your IDE
121
-
Continue can be used with VS Code to automate tasks, generate code, and enhance your coding experience. Here are some examples of how to use Continue with VS Code:
43
+
Continue's `config.json` file will set models and providers allowed for chat, autocompletion etc.
44
+
Here is an example configuration with Scaleway's OpenAI-compatible provider:
122
45
123
-
* Code generation: Use the `Continue: Generate Code` command to generate boilerplate code, functions, or entire classes.
124
-
* Code completion: Use the `Continue: Complete Code` command to complete partially written code.
125
-
* Code refactoring: Use the `Continue: Refactor Code` command to refactor code and improve its readability and maintainability.
46
+
```json
47
+
"models": [
48
+
{
49
+
"model": "qwen2.5-coder-32b-instruct",
50
+
"title": "Qwen2.5-coder",
51
+
"provider": "scaleway",
52
+
"apiKey": "###SCW SECRET KEY###"
53
+
}
54
+
]
55
+
```
56
+
57
+
<Messagetype="tip">
58
+
The config.json file is typically stored as `~/.continue/config.json` on Linux/macOS systems, and `%USERPROFILE%\.continue\config.json` on Windows.
59
+
</Message>
126
60
61
+
Read more about how to set up your `config.json` on the [official Continue documentation](https://docs.continue.dev/reference).
0 commit comments