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
tar -xz --strip=2 elasticsearch-labs-main/example-apps/workplace-search
14
14
```
15
15
16
-
## 2. Index Data
16
+
## 2. Credentials
17
17
18
-
You can index the data from the provided .json files by following the [README](./example-data/README.md) instructions in the `example-data` folder. At the moment indexing your own data should be possible. The UI will attempt to use the URL in the data file for the HTML link to the source.
18
+
This app requires the following environment variables to be set:
19
19
20
-
### Loading your own data
21
-
22
-
See the [medicare](./example-data/README.md#loading-custom-data) example in the example-data folder for loding your own data.
23
-
24
-
## 3. Credentials
25
-
26
-
Requires the following environment variables to be set. This can be done by creating a `.env` file in the `/api` directory of the project.
27
-
28
-
### Setup with OpenAI
20
+
```sh
21
+
export ELASTIC_CLOUD_ID=...
22
+
export ELASTIC_USERNAME=...
23
+
export ELASTIC_PASSWORD=...
24
+
export OPENAI_API_KEY=...
25
+
```
29
26
30
-
You can get your OpenAI key from the [OpenAI dashboard](https://platform.openai.com/account/api-keys).
27
+
Note: you can get your OpenAI key from the [OpenAI dashboard](https://platform.openai.com/account/api-keys).
31
28
32
-
```
33
-
openai_type=openai
34
-
openai_api_model="gpt-3.5-turbo-0613"
35
-
openai_api_key=<your-openai-key>
36
-
cloud_id=<elasticsearch-cloud-id>
37
-
cloud_pass=<elasticsearch-password>
38
-
cloud_user=<elasticsearch-user>
39
-
```
40
29
41
-
### Setup with Azure OpenAI Credentials
30
+
##3. Index Data
42
31
43
-
You can get your Azure OpenAI key from the [Azure OpenAI dashboard](https://ms.portal.azure.com/#blade/Microsoft_Azure_Marketplace/GalleryFeaturedMenuItemBlade/selectedMenuItemId/home/searchQuery/openai/resetMenuId/).
32
+
You can index the data from the provided .json files in the `data` folder:
44
33
45
-
```
46
-
openai_type=azure
47
-
openai_api_key=<your openai api key>
48
-
openai_api_type=azure
49
-
openai_api_base=<your openai api base url>
50
-
openai_api_version=2023-03-15-preview
51
-
openai_api_engine=<your openai api engine>
52
-
cloud_id=<elasticsearch-cloud-id>
53
-
cloud_pass=<elasticsearch-password>
54
-
cloud_user=<elasticsearch-user>
34
+
```sh
35
+
python data/index-data.py
55
36
```
56
37
57
38
## Developing
@@ -65,18 +46,33 @@ With the environment variables set, you can run the following commands to start
65
46
66
47
### Install the dependencies
67
48
49
+
For Python we recommend using a virtual environment.
50
+
51
+
_ℹ️ Here's a good [primer](https://realpython.com/python-virtual-environments-a-primer) on virtual environments from Real Python._
0 commit comments