-
Notifications
You must be signed in to change notification settings - Fork 258
docs(genapi): add docs #4475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
docs(genapi): add docs #4475
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
91 changes: 91 additions & 0 deletions
91
pages/generative-apis/reference-content/adding-ai-to-intellij-using-continue.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| --- | ||
| meta: | ||
| title: Adding AI to IntelliJ IDEA using Continue and Generative APIs | ||
| description: Learn how to integrate AI-powered code models into IntelliJ IDEA with Continue and Scaleway's Generative APIs. | ||
| content: | ||
| h1: Adding AI to IntelliJ IDEA using Continue and Generative APIs | ||
| 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. | ||
| tags: generative-apis ai machine-learning language-models code-assistance intellij-idea continue | ||
| validation_date: 2025-02-14 | ||
| posted_date: 2025-02-14 | ||
| --- | ||
|
|
||
| AI-driven coding is revolutionizing software development by automating repetitive tasks, generating code snippets, improving code quality, and identifying potential bugs. | ||
| By integrating AI-powered tools, developers can significantly enhance productivity and optimize workflows. | ||
| This guide will help you integrate AI-powered code models into JetBrain's IntelliJ IDEA using Continue and Scaleway’s Generative APIs. | ||
|
|
||
| <Macro id="requirements" /> | ||
|
|
||
| - A Scaleway account logged into the [console](https://console.scaleway.com) | ||
| - [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization | ||
| - A valid [API key](/iam/how-to/create-api-keys/) for API authentication | ||
| - Installed [IntelliJ IDEA](https://www.jetbrains.com/idea/) on your local machine. | ||
|
|
||
| ## Install Continue in IntelliJ IDEA | ||
|
|
||
| You can install Continue from the [JetBrains marketplace](https://plugins.jetbrains.com/plugin/22707-continue): | ||
|
|
||
| 1. Open IntelliJ IDEA and go to **Preferences** (`Ctrl+Alt+S` on Windows/Linux, `Cmd+,` on macOS). | ||
| 2. Navigate to **Plugins**, then click **Marketplace**. | ||
| 3. Search for **Continue** and click **Install**. | ||
| 4. Restart IntelliJ IDEA after installation. | ||
|
|
||
| ### Configure Continue to use Scaleway’s Generative APIs | ||
|
|
||
| #### Configure Continue through the graphical interface | ||
|
|
||
| To link Continue with Scaleway's Generative APIs, you can use built-in menus from Continue in IntelliJ IDEA. | ||
|
|
||
| - Click **Continue** in the menu on the right. . | ||
| - In the prompt section, click on **Select model** dropdown, then on **Add Chat model**. | ||
| - Select **Scaleway** as provider. | ||
| - Select the model you want to use (we recommend `Qwen 2.5 Coder 32b` to get started with). | ||
| - Enter your **Scaleway secret key**. | ||
| <Message type="tip"> | ||
| To start with, we recommend you use a Scaleway secret key having access to your `default` Scaleway project. | ||
| </Message> | ||
|
|
||
| These actions will edit automatically your `config.json` file. To edit it manually, see [Configure Continue through configuration file](#configure-continue-through-configuration-file). | ||
|
|
||
| <Message type="note"> | ||
| 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). | ||
| </Message> | ||
|
|
||
| #### Configure Continue through configuration file | ||
|
|
||
| To link Continue with Scaleway’s Generative APIs, you need to configure the settings file: | ||
|
|
||
| 1. Locate your Continue configuration directory: | ||
| - **Linux/macOS**: `~/.continue/` | ||
| - **Windows**: `%USERPROFILE%\.continue\` | ||
| 2. Create a `config.json` file inside this directory. | ||
| 3. Add the following configuration: | ||
| ```json | ||
| { | ||
| "models": [ | ||
| { | ||
| "model": "qwen2.5-coder-32b-instruct", | ||
| "title": "Qwen2.5 Coder", | ||
| "provider": "scaleway", | ||
| "apiKey": "###SCW_SECRET_KEY###" | ||
| } | ||
| ] | ||
| } | ||
| ``` | ||
| 4. Save the file and restart IntelliJ IDEA. | ||
|
|
||
| <Message type="tip"> | ||
| For more details on configuring `config.json`, refer to the [official Continue documentation](https://docs.continue.dev/reference). | ||
| 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. | ||
| </Message> | ||
|
|
||
| ### Activate Continue in IntelliJ IDEA | ||
|
|
||
| After configuring the API, activate Continue in IntelliJ IDEA: | ||
|
|
||
| - Open the **Command Search** (Press`Shift` twice quickly on Windows/Linux/macOS). | ||
| - Type `"Continue"` and select the appropriate command to enable AI-powered assistance. | ||
|
|
||
| <Message type="important"> | ||
| 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). | ||
| </Message> |
99 changes: 99 additions & 0 deletions
99
pages/generative-apis/reference-content/adding-ai-to-vscode-using-continue.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| --- | ||
| meta: | ||
| title: Adding AI to VS Code using Continue and Generative APIs | ||
| description: Learn how to integrate AI-powered code models into VS Code with Continue and Scaleway's Generative APIs. | ||
| content: | ||
| h1: Adding AI to VS Code using Continue and Generative APIs | ||
| 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. | ||
| tags: generative-apis ai machine-learning language-models code-assistance vs-code continue | ||
| validation_date: 2025-02-14 | ||
| posted_date: 2025-02-14 | ||
| --- | ||
|
|
||
| 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. | ||
| 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. | ||
|
|
||
| <Macro id="requirements" /> | ||
|
|
||
| - A Scaleway account logged into the [console](https://console.scaleway.com) | ||
| - [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization | ||
| - A valid [API key](/iam/how-to/create-api-keys/) for API authentication | ||
| - Installed [Visual Studio Code](https://code.visualstudio.com/) on your local machine | ||
|
|
||
| ## Install Continue in VS Code | ||
|
|
||
| You can install Continue directly from the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=Continue.continue) or via the command line: | ||
|
|
||
| ```bash | ||
| code --install-extension continue.continue | ||
| ``` | ||
|
|
||
| ### Configure Continue to use Scaleway’s Generative APIs | ||
|
|
||
| #### Configure Continue through the graphical interface | ||
|
|
||
| To link Continue with Scaleway's Generative APIs, you can use built-in menus from Continue in VS Code. | ||
|
|
||
| - Click **Continue** in the menu on the left. | ||
| - In the prompt section, click on **Select model** dropdown, then on **Add Chat model**. | ||
| - Select **Scaleway** as provider. | ||
| - Select the model you want to use (we recommend `Qwen 2.5 Coder 32b` to get started with). | ||
| - Enter your **Scaleway secret key**. | ||
| <Message type="tip"> | ||
| To start with, we recommend you use a Scaleway secret key having access to your `default` Scaleway project. | ||
| </Message> | ||
|
|
||
| These actions will edit automatically your `config.json` file. To edit it manually, see [Configure Continue through configuration file](#configure-continue-through-configuration-file). | ||
|
|
||
| <Message type="note"> | ||
| 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). | ||
| </Message> | ||
|
|
||
| #### Configure Continue through a configuration file | ||
|
|
||
| To link Continue with Scaleway's Generative APIs, you can configure a settings file: | ||
|
|
||
| - Create a `config.json` file inside your `.continue` directory. | ||
| - Add the following configuration to enable Scaleway's Generative API: | ||
| ```json | ||
| { | ||
| "models": [ | ||
| { | ||
| "model": "qwen2.5-coder-32b-instruct", | ||
| "title": "Qwen2.5 Coder", | ||
| "provider": "scaleway", | ||
| "apiKey": "###SCW_SECRET_KEY###" | ||
| } | ||
| ], | ||
| "embeddingsProvider": { | ||
| "model": "bge-multilingual-gemma2", | ||
| "provider": "scaleway", | ||
| "apiKey": "###SCW_SECRET_KEY###" | ||
| }, | ||
| "tabAutocompleteModel": { | ||
| "model": "qwen2.5-coder-32b", | ||
| "title": "Qwen2.5 Coder Autocomplete", | ||
| "provider": "scaleway", | ||
| "apiKey": "###SCW_SECRET_KEY###" | ||
| } | ||
| } | ||
| ``` | ||
| - Save the file at the correct location: | ||
| - Linux/macOS: `~/.continue/config.json` | ||
| - Windows: `%USERPROFILE%\.continue\config.json` | ||
|
|
||
| <Message type="tip"> | ||
| For more details on configuring `config.json`, refer to the [official Continue documentation](https://docs.continue.dev/reference). | ||
| 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. | ||
| </Message> | ||
|
|
||
| ### Activate Continue in VS Code | ||
|
|
||
| After configuring the API, open VS Code and activate Continue: | ||
|
|
||
| - Open the **Command Palette** (`Ctrl+Shift+P` on Windows/Linux, `Cmd+Shift+P` on Mac) | ||
| - Type `"Continue"` and select the appropriate command to enable AI-powered assistance. | ||
|
|
||
| <Message type="important"> | ||
| 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). | ||
| </Message> |
127 changes: 127 additions & 0 deletions
127
...ative-apis/reference-content/integrating-generative-apis-with-popular-tools.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,127 @@ | ||
| --- | ||
| meta: | ||
| title: Integrating Scaleway Generative APIs with popular AI tools | ||
| description: Learn how to integrate Scaleway's Generative APIs with popular AI tools to unlock the full potential of your applications. | ||
| content: | ||
| h1: Integrating Scaleway Generative APIs with popular AI tools | ||
| 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. | ||
| tags: generative-apis ai language-models | ||
| dates: | ||
| validation: 2025-02-18 | ||
| posted: 2025-02-18 | ||
| --- | ||
|
|
||
| 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. | ||
|
|
||
| ## Comparison of AI tools and libraries | ||
|
|
||
| The following table compares AI tools and libraries supported by Scaleway's Generative APIs: | ||
|
|
||
| | Tool/Library | Description | Use cases | Integration effort | | ||
| | --- | --- | --- | --- | | ||
| | [OpenAI client](#openai-client-libraries) | Popular AI library for natural language processing | Text generation, language translation, text summarization | Low | | ||
| | [LangChain](#langchain-rag-and-llm-applications) | Library for building AI applications | Inference, embeddings, document indexing and retrieval | Medium | | ||
| | [Continue Dev](#continue-dev-ai-coding-assistance) | Library for AI-powered coding assistance | Code completion, code review | Low | | ||
| | [cURL/Python](#custom-http-integrations) | Direct HTTP API calls for custom integrations | Custom applications, data processing | High | | ||
|
|
||
| <Message type="note"> | ||
| The integration effort is subjective and may vary depending on the specific use case and requirements. | ||
| </Message> | ||
|
|
||
| ## OpenAI client libraries | ||
|
|
||
| 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. | ||
|
|
||
| ### Configuration | ||
|
|
||
| To use the OpenAI client library with Scaleway's Generative APIs, you'll need to install the required dependencies: | ||
| ```bash | ||
| pip install openai | ||
| ``` | ||
|
|
||
| Then you'll need to set the API key and base URL in your OpenAI-compatible client: | ||
bene2k1 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ```python | ||
| from openai import OpenAI | ||
| client = OpenAI( | ||
| base_url="https://api.scaleway.ai/v1", | ||
| api_key="<API secret key>" | ||
| ) | ||
| ``` | ||
| <Message type="tip"> | ||
| Make sure to replace `<API secret key>` with your actual API key. | ||
| </Message> | ||
|
|
||
| ### Using OpenAI client for text generation | ||
|
|
||
| To use OpenAI client for text generation, you can create a `client.chat.completions` object and call the `create` method: | ||
| ```python | ||
| response = client.chat.completions.create( | ||
| model="llama-3.1-8b-instruct", | ||
| messages=[{"role": "user", "content": "Tell me a joke about AI"}] | ||
| ) | ||
| print(response.choices[0].message.content) | ||
| ``` | ||
|
|
||
| ## LangChain (RAG & LLM applications) | ||
|
|
||
| LangChain is a popular library for building AI applications. Scaleway's Generative APIs support LangChain for both inference and embeddings. | ||
|
|
||
| <Message type="tip"> | ||
| Refer to our dedicated documentation for | ||
| - [Implementing Retrieval-Augmented Generation (RAG) with LangChain and Scaleway Generative APIs](/tutorials/how-to-implement-rag-generativeapis/) | ||
| </Message> | ||
|
|
||
| ## Continue Dev (AI coding assistance) | ||
|
|
||
| Continue Dev is a library that provides AI-powered coding assistance. Scaleway's Generative APIs support Continue Dev for code completion and more. | ||
|
|
||
| <Message type="tip"> | ||
| Refer our dedicated documentation for | ||
bene2k1 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - [Integrating Continue Dev with Visual Studio Code](/generative-apis/reference-content/adding-ai-to-vscode-using-continue/) | ||
| - [Integrating Continue Dev with IntelliJ IDEA](/generative-apis/reference-content/adding-ai-to-intellij-using-continue/) | ||
| </Message> | ||
|
|
||
| ## Custom HTTP integrations | ||
|
|
||
| You can interact with Scaleway's Generative APIs directly using any HTTP client. | ||
|
|
||
| ### cURL example | ||
|
|
||
| To use cURL with Scaleway's Generative APIs, you can use the following command: | ||
| ```bash | ||
| curl https://api.scaleway.ai/v1/chat/completions \ | ||
| -H "Authorization: Bearer <API secret key>" \ | ||
| -H "Content-Type: application/json" \ | ||
| -d '{ | ||
| "model": "llama-3.1-8b-instruct", | ||
| "messages": [{"role": "user", "content": "What is quantum computing?"}] | ||
| }' | ||
| ``` | ||
| <Message type="tip"> | ||
| Make sure to replace `<API secret key>` with your actual API key. | ||
| </Message> | ||
|
|
||
| ### Python HTTP example | ||
|
|
||
| To perform HTTP requests with Scaleway's Generative APIs, you'll need to install `requests` dependency: | ||
bene2k1 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ```bash | ||
| pip install requests | ||
| ``` | ||
|
|
||
| Then, you can use the following code: | ||
| ```python | ||
| import requests | ||
| headers = { | ||
| "Authorization": "Bearer <API secret key>", | ||
| "Content-Type": "application/json" | ||
| } | ||
| data = { | ||
| "model": "llama-3.1-8b-instruct", | ||
| "messages": [{"role": "user", "content": "Explain black holes"}] | ||
| } | ||
| response = requests.post("https://api.scaleway.ai/v1/chat/completions", json=data, headers=headers) | ||
| print(response.json()["choices"][0]["message"]["content"]) | ||
| ``` | ||
| <Message type="tip"> | ||
| Make sure to replace `<API secret key>` with your actual API key. | ||
| </Message> | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.