OpenAI Embeddings provides a clean Python coding example of retrieval augmented generation by combining OpenAI's API with hybrid search. This project demonstrates how to utilize system prompting, templates, and LangChain. You can use this project for scaffolding your own command-line drive RAG solution.
This repository provides a powerful solution for Retrieval Augmented Generation (RAG) and Hybrid Search using OpenAI's chatGPT capabilities. It leverages the Python OpenAI API Embeddings and integrates with a Pinecone vector database, orchestrated by LangChain.
The following command-line usage examples demonstrate the capabilities of this repository:
# Example 1 - Generic Assistant
python3 -m models.examples.prompt "you are a helpful assistant" "What analytics and accounting courses does Wharton offer?"
# Example 2 - Assistant with Improved System Prompting
python3 -m models.examples.prompt "You are a student advisor at University of Pennsylvania. You provide concise answers of 100 words or less." "What analytics and accounting courses does Wharton offer?"
# Example 5 - Retrieval Augmented Generation
python3 -m models.examples.load "/path/to/your/pdf/documents"
python3 -m models.examples.rag "What analytics and accounting courses does Wharton offer?"
For example, when prompted with "What analytics and accounting courses does Wharton offer?", the response generated by chatGPT may vary significantly with or without the use of embeddings from uploaded documents. By employing embeddings from a course's lecture notes, the results can reflect more accurate and relevant information.
To utilize this project, ensure the following dependencies are installed:
For further information and tutorials, consider exploring resources such as:
No comments yet.
Sign in to be the first to comment.