GvHemanth / Prompt-Engineering-GPT-Assistants-API-using-RAG

This project showcases the implementation of a prompt engineering using the OpenAI Assistant API, specifically leveraging the Retrieval-Augmented Generation (RAG) system. By integrating cutting-edge language models, the system demonstrates advanced natural language understanding and generation capabilities.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OpenAI Prompt Engineering Case Study

Problem Statement - 1: Creating an Assistant

Description:

This section of the project demonstrates the creation of an OpenAI Assistant using the GPT-3.5 Turbo model with a focus on abstract generation from research papers. The assistant is designed to read research papers and provide abstracts based on user-defined lengths. The case study includes uploading a research paper, interacting with the assistant to obtain an abstract, and then modifying the length and tone of the abstract as per user input.

Instructions for Use:

  1. Replace ENTER API-KEY in the script with your actual OpenAI API key.
  2. Set the file_path variable to the path of the research paper you want to upload.
  3. Run the script to create the assistant, upload the research paper, and interact with the assistant.

Problem Statement - 2: Zero Shot Prompt

Description:

This section explores the use of OpenAI's Chat Completions API to generate answers based on provided contexts. It demonstrates how the assistant can answer questions about the differences between GPT and BERT using predefined contexts and a user prompt.

Instructions for Use:

  1. Replace 'API_KEY' in the script with your actual OpenAI API key.
  2. Run the script to obtain an answer to the predefined question about the differences between GPT and BERT.

Problem Statement - 2: Few Shot Learning

Description:

This part of the case study showcases the application of few-shot learning with the OpenAI Chat Completions API. It answers a user question about the differences between LSTM and BERT based on a predefined context containing information about various models.

Instructions for Use:

  1. Replace 'API_KEY' in the script with your actual OpenAI API key.
  2. Run the script to generate an answer to the user question about the differences between LSTM and BERT.

Prerequisites:

  • OpenAI API key
  • Python environment with required libraries (openai)

Note:

  • Ensure that you have the necessary permissions to use the OpenAI API.
  • The scripts provide clear comments to guide through the code.
  • Customize the scripts as needed for your specific use cases.

Feel free to explore, experiment, and contribute to this prompt engineering case study!

About

This project showcases the implementation of a prompt engineering using the OpenAI Assistant API, specifically leveraging the Retrieval-Augmented Generation (RAG) system. By integrating cutting-edge language models, the system demonstrates advanced natural language understanding and generation capabilities.


Languages

Language:Python 100.0%