Skip to content

Commit 426a45f

Browse files
committed
fix(genapi): fix indention
1 parent 34b2934 commit 426a45f

File tree

1 file changed

+31
-31
lines changed

1 file changed

+31
-31
lines changed

pages/generative-apis/reference-content/integrating-generative-apis-with-popular-tools.mdx

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -77,43 +77,43 @@ LangChain is a popular library for building AI applications. Scaleway's Generati
7777

7878
LlamaIndex is an open-source framework for building Large Language Models (LLMs) based applications, especially optimizing RAG (Retrieval Augmented Generation) pipelines.
7979
1. Install the required dependencies to use the LlamaIndex framework with Scaleway's Generative APIs:
80-
```bash
81-
pip install llama-index-llms-openai-like
82-
```
80+
```bash
81+
pip install llama-index-llms-openai-like
82+
```
8383

8484
2. Create a file `main.py` and add the following code to it to configure the `OpenAILike` client and your secret key:
85-
```python
86-
from llama_index.llms.openai_like import OpenAILike
87-
from llama_index.core.llms import ChatMessage
88-
89-
llm = OpenAILike(
90-
model="llama-3.1-8b-instruct",
91-
api_key="<API secret key>",
92-
api_base="https://api.scaleway.ai/v1",
93-
max_tokens=512,
94-
temperature=0.7,
95-
top_p=1,
96-
presence_penalty=0,
97-
)
98-
```
99-
<Message type="tip">
100-
Make sure to replace `<API secret key>` with your actual API key.
101-
</Message>
85+
```python
86+
from llama_index.llms.openai_like import OpenAILike
87+
from llama_index.core.llms import ChatMessage
88+
89+
llm = OpenAILike(
90+
model="llama-3.1-8b-instruct",
91+
api_key="<API secret key>",
92+
api_base="https://api.scaleway.ai/v1",
93+
max_tokens=512,
94+
temperature=0.7,
95+
top_p=1,
96+
presence_penalty=0,
97+
)
98+
```
99+
<Message type="tip">
100+
Make sure to replace `<API secret key>` with your actual API key.
101+
</Message>
102102

103103
3. You can then interact with the LLM by sending messages to the model with the following code:
104-
```python
105-
response = llm.chat([ChatMessage("Could you tell me about Scaleway please ?")])
106-
print(response)
107-
```
104+
```python
105+
response = llm.chat([ChatMessage("Could you tell me about Scaleway please ?")])
106+
print(response)
107+
```
108108

109109
4. Finally, run `main.py`:
110-
```python
111-
python main.py
112-
```
113-
The LLM response should display an answer:
114-
```bash
115-
Generally, Scaleway is a reliable and secure cloud provider that offers a range of services for businesses and developers.
116-
```
110+
```python
111+
python main.py
112+
```
113+
The LLM response should display an answer:
114+
```bash
115+
Generally, Scaleway is a reliable and secure cloud provider that offers a range of services for businesses and developers.
116+
```
117117

118118
### Javascript (Typescript)
119119

0 commit comments

Comments
 (0)