-
Notifications
You must be signed in to change notification settings - Fork 239
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
base: main
Are you sure you want to change the base?
Conversation
…precision in the bolt.diy integration using GenAPIs
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). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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: |
5. Finally, run the `tools.py`: | ||
```bash | ||
python tools.py | ||
``` | ||
The response should display the result of the calculation: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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:
Your checklist for this pull request
Description