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.
- Replace
ENTER API-KEY
in the script with your actual OpenAI API key. - Set the
file_path
variable to the path of the research paper you want to upload. - Run the script to create the assistant, upload the research paper, and interact with the assistant.
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.
- Replace
'API_KEY'
in the script with your actual OpenAI API key. - Run the script to obtain an answer to the predefined question about the differences between GPT and BERT.
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.
- Replace
'API_KEY'
in the script with your actual OpenAI API key. - Run the script to generate an answer to the user question about the differences between LSTM and BERT.
- OpenAI API key
- Python environment with required libraries (openai)
- 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!