|
3 | 3 |
|
4 | 4 | ## Introduction |
5 | 5 |
|
6 | | -**LangChain** is a framework for developing applications powered by language models. For this tutorial, we are going to use it to interact with CrateDB using only natural language without writing any SQL. To achieve that, you will need a CrateDB instance running, an OpenAI API key, and some Python knowledge. |
| 6 | +**LangChain** is a framework for developing applications powered by language models. |
| 7 | +This tutorial uses LangChain to interact with CrateDB using only natural language without writing any SQL. |
| 8 | +To achieve that, you will need a CrateDB instance running, an OpenAI API key, and some Python knowledge. |
7 | 9 |
|
8 | 10 | ## Set up database |
9 | 11 |
|
@@ -35,7 +37,11 @@ First, install the required libraries |
35 | 37 | pip install 'langchain[openai]' 'sqlalchemy-cratedb' |
36 | 38 | ``` |
37 | 39 |
|
38 | | -Once installed, import every component that will be used as follows. Also, before running the code snippet below, make sure to replace the <API_KEY> with your OpenAI API key. Besides that, replace the URI with the correct connection string to your CrateDB instance. Finally, enter your question as a string replacing <TEXT_QUESTION> in the code. |
| 40 | +Once installed, import the required components: |
| 41 | +Also, before running the code snippet below, make sure to replace the |
| 42 | +`<API_KEY>` with your OpenAI API key. Besides that, replace the URI with |
| 43 | +the correct connection string to your CrateDB instance. Finally, enter |
| 44 | +your question as a string replacing `<TEXT_QUESTION>` in the code. |
39 | 45 |
|
40 | 46 | ```python |
41 | 47 | from langchain.agents import create_sql_agent |
@@ -70,7 +76,8 @@ Now that everything is set up, feel free to explore with different questions and |
70 | 76 |
|
71 | 77 | ## Summary |
72 | 78 |
|
73 | | -This tutorial covered the use of LangChain to interact with CrateDB by simply writing questions in English. If you explore different questions, you may encounter some wrong answers, so we recommend you use this tool with caution and always check the reasoning it provides behind every answer. If you are looking for more exciting integrations, have a look at the {ref}`integrations section <integrate>` in our documentation. |
| 79 | +This tutorial demonstrates how to use LangChain to interact with CrateDB by writing questions in English. |
| 80 | +If you explore different questions, you may encounter some wrong answers, so we recommend you use this tool with caution and always check the reasoning it provides behind every answer. If you are looking for more exciting integrations, have a look at the {ref}`integrations section <integrate>` in our documentation. |
74 | 81 |
|
75 | 82 |
|
76 | 83 | [LangChain Introduction]: https://python.langchain.com/docs/introduction/ |
0 commit comments