Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#38 Groundwork for migration to new openai >=v1.0.0 python API #41

Closed
wants to merge 1 commit into from

Conversation

GeroVanMi
Copy link

Hi @martiansideofthemoon (tagged you, since you were recently active on #38)

I have tried to make the necessary changes for the new OpenAI python library to be used with this codebase. I have tested the atomic_facts generator and it seems to work quite well. However, I am not very well-versed in this project, so please do some testing of your own, before considering to merge this.

Please feel free to change anything according to your needs or give feedback if you'd like me to change something. This project looks very promising and I would like to test our own solutions against this. You have done great work here and I'd be glad to hear back from you!

Changelog

  • Removed unused openai import from atomic_facts.py
  • OpenAIModel class now has an internal client attribute which holds an instance of the OpenAI() class
  • The call_ChatGPT and call_GPT3 functions now both use the openAI client with chat. completions
  • The InvalidRequestError has been renamed to BadRequestError, this had to be changed in the codebase as well

 - Removed unused openai import from atomic_facts.py
 - OpenAIModel class now has an internal client attribute which holds an instance of the OpenAI() class
 - The call_ChatGPT and call_GPT3 functions now both use the openAI client with chat. completions
 - The InvalidRequestError has been renamed to BadRequestError, this had to be changed in the codebase as well
@GeroVanMi
Copy link
Author

I just realized that the project uses Poetry and I haven't updated the dependencies accordingly, I will do so asap.

@GeroVanMi GeroVanMi marked this pull request as draft February 10, 2024 10:10
@GeroVanMi
Copy link
Author

GeroVanMi commented Feb 10, 2024

Update: There is currently a version conflict between spacy and the new openai library. This will probably need to be resolved on the side of spacy, since they are requiring an old version of the typing-extensions library.

For now: There doesn't seem to be a direct usage (except for the download for setup) of spacy, so maybe it could just be removed from the actual dependencies and installed manually through pip? If it is needed somewhere that I didn't find, we'd probably have to wait until spacy updates to the newer version or find some alternative solution.

@GeroVanMi GeroVanMi closed this Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant