Connecting to OpenAI
While we wait for the crawler, we’ll set up the frontend for sending queries to Elastic.
In a browser navigate to https://platform.openai.com/ where you’ll need to sign up for an OpenAI account. (Don’t worry it’s free.)
If you are unable to use your account or create one, we will try to provide keys for use with this workshop.
Click on your account and then click on “View API keys” to
3. Now we’ll need to generate an API key to use for connecting in python.
Click on “API Keys”.
4. Click “Create New Secret”.
5. Copy the new key and save it.
It will not be displayed again.
Now we will use an app called Streamlit to run a web based frontend to submit our queries to Elastic and ChatGPT.
Navigate back to the “Terminal” view in Strigo.
2. At the command prompt, type “cd src/elasticgpt/” and press enter.
cd src/elasticgpt/
3. To start the frontend application that will give us a webpage to interact with Elastic and ChatGPT, run the following command…
There may be a couple of warnings, these can be ignored.
streamlit run elasticdocs_gpt.py
4. Copy the External URL like this…
5. Paste the URL into a new browser tab.
Your URL should look similar to this (if you’re on a VPN or corporate network this port might be blocked.
6. Press Enter and a page like below should appear.
We’ll fill in the information for this page during the next lab…
Lab 2 is complete.