Hi @ricklamers,
This change switches from plain Python requests to using the official openai package. While this introduces an additional dependency, it very much standardizes the used interface, shortens the code, and simplifies error handling. Imho, this will help keeping the tool up-to-date as, e.g., changes to the official API will be supported automatically.
With this change, I also introduced the possibility to supply additional user-defined headers. This is also possible in many other packages that interact with the openAI API to, e.g., firewalls, internal gateway server and the like.
Hi @ricklamers, This change switches from plain Python requests to using the official
openai
package. While this introduces an additional dependency, it very much standardizes the used interface, shortens the code, and simplifies error handling. Imho, this will help keeping the tool up-to-date as, e.g., changes to the official API will be supported automatically.With this change, I also introduced the possibility to supply additional user-defined headers. This is also possible in many other packages that interact with the openAI API to, e.g., firewalls, internal gateway server and the like.
What do you think about this?