emmethalm / infiniteGPT

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!
750 stars 152 forks source link

some chatgpt suggested improvements #1

Open d3287t328 opened 1 year ago

d3287t328 commented 1 year ago

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.

arochedy commented 1 year ago

good idea for the env variable.

For the system & user content, the best will be to be customizable by the user (you can add it in a file or in the command line)