This repository contains code that demonstrates how to build a custom chat agent using Langchain, integrating GPT-3.5 from OpenAI. The agent can handle conversational context, provide various tools, and assist in answering questions, including math-related queries.
The project showcases the implementation of a custom chat agent that leverages Langchain, an open-source framework, to interact with users in a conversational manner. The agent uses a conversational business document search tool. This agent is powered by GPT-3.5 for natural language understanding and generation.
Clone this repository to your local machine.
Install the required dependencies by running: pip install -r requirements.txt
Obtain the API keys from OpenAI and Pinecone.
You must create a config.py
file that defines the following:
OPENAI_API_KEY = 'YOUR_OPENAI_API_KEY'
PINECONE_API_KEY = 'YOUR_PINECONE_API_KEY'
PINECONE_API_ENVIRONMENT = 'YOUR_PINECONE_ENVIRONMENT'
Get a previously created Pinecone index name, for document retrieval and set it in the constants.py
file.
To use the custom chat agent:
python main.py
The configuration of the chat agent can be customized by modifying the parameters in the main.py
script. Key components include:
This project is licensed under the MIT License.