This repository contains a demo application that uses OpenAI and LangChain to interact with Looker and output data based on natural language questions in English and other languages.
- Retrieve data from Looker by asking questions in English and other languages
- Utilizes OpenAI and LangChain for language understanding and translation
- Converts natural language questions into Looker API requests using GPT-3 (text-davinci-003)
- Supports local LookML embeddings
-
Clone this repository to your local machine.
-
Install the required dependencies using the following command:
pip install -r requirements.txt
-
Place the
looker.ini
file in the root directory of the project. -
Set the environment variables
LOOKER_MODEL_NAME
andLOOKML_DIR
to the appropriate values for your Looker model and LookML directory:export LOOKER_MODEL_NAME=<your_looker_model_name> export LOOKML_DIR=<path_to_your_lookml_directory> export OPENAI_API_KEY=<your_openai_api_key>
-
Run app.py to start the Streamlit application:
streamlit run app.py
-
Open the Streamlit application in your web browser using the provided URL.
- Input your question in the text box, either in English or any other natural language.
- Press "Send" to send the question to the application.
- The application will process the question using OpenAI and LangChain, converting it into a Looker API request.
- View the retrieved data from Looker displayed on the screen.
- Integrate this application with ChatGPT to enable seamless communication between the two platforms and further enhance the natural language processing capabilities.
- Implement a smarter search indexing for Retrieval QA using lkml to improve the overall search experience.
- Integrate with ChatGPT Plugin.
This project is licensed under the terms of the MIT license.