You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+36-8Lines changed: 36 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,17 +17,45 @@ We assume you are familiar with [Docker](https://www.docker.com/), if you are no
17
17
```bash
18
18
docker-compose up
19
19
```
20
-
it will start two services:
20
+
it will start two services:
21
21
-`db`: where the PostgresSQL database runs to support chat history and document retrieval for [RAG](https://en.wikipedia.org/wiki/Prompt_engineering#Retrieval-augmented_generation);
22
22
-`dialog`: the service with the api.
23
23
24
24
## Quick Start
25
25
26
-
To use this project, you need to have a `.csv` file with the knowledge base and a `.toml` file with your prompt configuration.
26
+
If you are new to the project and want to get started quickly with some sample data and a simple prompt configuration, follow the steps below:
27
27
28
-
We recommend that you create a folder inside this project called `data` and put CSVs and TOMLs files over there.
28
+
1. Clone the repository:
29
29
30
-
### `.csv` knowledge base
30
+
```bash
31
+
git clone https://github.com/talkdai/dialog.git
32
+
```
33
+
34
+
2. Create a `.env` file based on the `.env.sample` file:
35
+
36
+
```bash
37
+
cp .env.sample .env
38
+
```
39
+
40
+
3. Set the OPENAI_API_KEY value in the `.env` file:
41
+
42
+
```
43
+
OPENAI_API_KEY=your-openai-api-key
44
+
```
45
+
46
+
4. Build and start the services with docker:
47
+
48
+
```bash
49
+
docker-compose up --build
50
+
```
51
+
52
+
### Customizing prompts and data
53
+
54
+
To customize this project, you need to have a `.csv` file with the knowledge base of your interest and a `.toml` file with your prompt configuration.
55
+
56
+
We recommend that you create a folder inside this project called `data` to store your CSVs and TOMLs files over there. The `data` folder is already in the `.gitignore` file, so you can store your data without worrying about it being pushed to the repository.
faq,promotions,loyalty-program,"The company XYZ has a loyalty program when you refer new customers you get a discount on your next purchase, ..."
44
72
```
45
73
46
-
When the `dialog` service starts, it loads the knowledge base into the database, so make sure the database is up and paths are correct (see [environment variables](##environment-variables) section). Alternatively, inside `src` folder, run `make load-data path="<path-to-your-knowledge-base>.csv"`.
74
+
When the `dialog` service starts, it loads the knowledge base into the database, so make sure the database is up and paths are correct (see [environment variables](##environment-variables) section). Alternatively, inside `src` folder, run `make load-data path="<path-to-your-knowledge-base>.csv"`.
47
75
48
-
See [our documentation](https://dialog.talkd.ai/settings#csv-knowledge-base) for more options about the the knowledge base, including embedding more coluns together.
76
+
See [our documentation](https://dialog.talkd.ai/settings#csv-knowledge-base) for more options about the the knowledge base, including embedding more columns together.
49
77
50
78
51
-
### `.toml` prompt configuration
79
+
####`.toml` prompt configuration
52
80
53
81
The `[prompt.header]`, `[prompt.suggested]`, and `[fallback.prompt]` fields are mandatory fields used for processing the conversation and connecting to the LLM.
54
82
@@ -69,7 +97,7 @@ qualified service to high-end customers. Be brief in your answers, without being
69
97
and objective in your responses. Never say that you are a model (AI), always answer as Avelino.
70
98
Be polite and friendly!"""
71
99
72
-
suggested = "Here is some possible content
100
+
suggested = "Here is some possible content
73
101
that could help the user in a better way."
74
102
75
103
fallback = "I'm sorry, I couldn't find a relevant answer for your question."
You are a nice bot, say something nice to the user and try to help him with his question, but also say to the user that you don't know totally about the content he asked for.
0 commit comments