Skip to content

docs(genapi): add a langchain integration and update bolt.diy integration using GenAPIs #4911

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

reda-maizate
Copy link

Your checklist for this pull request

Description

  • Add a langchain integration for function calling
  • Update bolt.diy integration to warn customers about compatible models

…precision in the bolt.diy integration using GenAPIs
@reda-maizate reda-maizate requested a review from bene2k1 as a code owner April 30, 2025 17:23
9. Enter your prompt in the Bolt.diy interface to see your application being generated.

<Message type="important">
Only models that have a maximum output token of at least 8000 tokens are supported. You can found the list of Generative APIs models [here](https://www.scaleway.com/en/docs/generative-apis/reference-content/supported-models/#chat-models).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Only models that have a maximum output token of at least 8000 tokens are supported. You can found the list of Generative APIs models [here](https://www.scaleway.com/en/docs/generative-apis/reference-content/supported-models/#chat-models).
Only models that have a maximum output token of at least 8000 tokens are supported. Refer to the [list of Generative APIs models](/generative-apis/reference-content/supported-models/#chat-models) for more information.

Comment on lines +77 to +84
1. Install LangChain and his dependencies.
```bash
pip install 'langchain>=0.3.24'
pip install 'langchain-core>=0.3.55'
pip install 'langchain-openai>=0.3.14'
pip install 'langchain-text-splitters>=0.3.8'
```
2. Create a file `tools.py` and add the following code to it to import and create the tools examples:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. Install LangChain and his dependencies.
```bash
pip install 'langchain>=0.3.24'
pip install 'langchain-core>=0.3.55'
pip install 'langchain-openai>=0.3.14'
pip install 'langchain-text-splitters>=0.3.8'
```
2. Create a file `tools.py` and add the following code to it to import and create the tools examples:
1. Run the following commands to install LangChain and its dependencies:
```bash
pip install 'langchain>=0.3.24'
pip install 'langchain-core>=0.3.55'
pip install 'langchain-openai>=0.3.14'
pip install 'langchain-text-splitters>=0.3.8'
```
2. Create a file named `tools.py` and paste the code below into it to import and create the tools examples:


tools = [add, multiply]
```
3. You can configure the `init_chat_model` function to use Scaleway's Generative APIs.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
3. You can configure the `init_chat_model` function to use Scaleway's Generative APIs.
3. Configure the `init_chat_model` function to use Scaleway's Generative APIs.

```Python
llm = init_chat_model("mistral-small-3.1-24b-instruct-2503", model_provider="openai", base_url="https://api.scaleway.ai/v1")
```
4. Everything is now set up, you can use the `llm` object and the `tools` list to generate a response to a query with the following code:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
4. Everything is now set up, you can use the `llm` object and the `tools` list to generate a response to a query with the following code:
4. Use the `llm` object and the `tools` list to generate a response to your query with the following code:

Comment on lines +127 to +131
5. Finally, run the `tools.py`:
```bash
python tools.py
```
The response should display the result of the calculation:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
5. Finally, run the `tools.py`:
```bash
python tools.py
```
The response should display the result of the calculation:
5. Run `tools.py`:
```bash
python tools.py

The result of the calculation should display in the output:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants