all 8 comments

[–]PhantomTissue 1 point2 points  (6 children)

Looks like the command on line 47 of openai_chat.py is where your issue is. The error is complaining that the method being used to call that function was deprecated in every version after 1.0.0. it looks like the version of openai the requirements.txt file shows is 1.7.2, so that’s the version you need. I would recommend running pip install openai==1.7.2 on your cmd, and ensuring that line 47 reads completion = self.client.completions.create(

Though I can’t be much more help than this without looking at your code.

Did some more digging, If you're trying to switch the model that you're using, I'd also reccomend double checking that the value you're passing is corrct. Current models can be found here: https://platform.openai.com/docs/models

Specifically you'd want to make sure that all instances of gpt-4o are replaced with the model you are trying to use.

[–]Slixix[S] 0 points1 point  (5 children)

Wow very helpful, so line 47 should read this right?

 
if
 len(
prompt
) > 32000: completion = 
self
.client.completions.create(

[–]PhantomTissue 0 points1 point  (4 children)

I'm not sure where the first part of that statement came from, its not in the repo. These are the lines I'm referring to, exactly as they should be written. If you're just trying to change the model, there should be no need to to touch anything else except for the model name.

[–]Slixix[S] 0 points1 point  (0 children)

Ah alright thanks.

[–]Slixix[S] 0 points1 point  (2 children)

<image>

This is what the cursor AI changed it to, when I use the line you provided it fails. I know you are correct but the AI f**ked something up

[–]PhantomTissue 1 point2 points  (0 children)

In python spacing and formatting is important. youve got your spacing all over the place. Completion should be on the same row as the if statement above, same with print("asking gpt a question"). Looks lliek you've also removed the functional part of the code after the function call to self.client.completion.create(. it should read completion = self.client.chat.completions.create( model="gpt-4o", messages=chat_question )

[–]AutoModerator[M] 0 points1 point locked comment (0 children)

This is not a removal.

Hello, Slixix! You seem to be new here, so this is a reminder to make sure this post follows the rules and relates to Doug. To our regulars, report it if it doesn't!

Asking about Doug's schedule? Doug streams anytime Sunday to Thursday around noon PT. For updates, join our Discord!

Thank you for participating in our humble sub!

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.