InfiniteGPT is a Python script that lets you input an unlimited size text into the OpenAI API. No more tedious copy & pasting. Long live multithreading!
Move openai.api_key into an env variable.
Updated the role "system" content to be more meaningful: "You are a helpful assistant."
Updated the role "user" content to clearly instruct the AI: "Please summarize the following: {chunk}."
Added error handling to the call_openai_api function to prevent the script from crashing if there's an issue with a particular chunk.
Modified comments for better readability and understanding.
These changes should make the script more robust and user-friendly.
Changes made:
Move openai.api_key into an env variable. Updated the role "system" content to be more meaningful: "You are a helpful assistant." Updated the role "user" content to clearly instruct the AI: "Please summarize the following: {chunk}." Added error handling to the call_openai_api function to prevent the script from crashing if there's an issue with a particular chunk. Modified comments for better readability and understanding.
These changes should make the script more robust and user-friendly.