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

Error #37

Open
Alakirhell opened this issue Apr 7, 2024 · 0 comments
Open

Error #37

Alakirhell opened this issue Apr 7, 2024 · 0 comments

Comments

@Alakirhell
Copy link

APIRemovedInV1 Traceback (most recent call last)
in <cell line: 5>()
3 num_chapters = 10
4 writing_style = "Clear and easily understandable, similar to a young adult novel. Lots of dialogue."
----> 5 novel, title, chapters, chapter_titles = write_fantasy_novel(prompt, num_chapters, writing_style, claude_true)
6
7 # Replace chapter descriptions with body text in chapter_titles

2 frames
in write_fantasy_novel(prompt, num_chapters, writing_style, claude_true)
250
251 def write_fantasy_novel(prompt, num_chapters, writing_style, claude_true=False):
--> 252 plots = generate_plots(prompt)
253 print('generated plots')
254

in generate_plots(prompt)
43
44 def generate_plots(prompt):
---> 45 response = openai.ChatCompletion.create(
46 model="gpt-4",
47 messages=[

/usr/local/lib/python3.10/dist-packages/openai/lib/_old_api.py in call(self, *_args, **_kwargs)
37
38 def call(self, *_args: Any, **_kwargs: Any) -> Any:
---> 39 raise APIRemovedInV1(symbol=self._symbol)
40
41

APIRemovedInV1:

You tried to access openai.ChatCompletion, but this is no longer supported in openai>=1.0.0 - see the README at https://github.com/openai/openai-python for the API.

You can run openai migrate to automatically upgrade your codebase to use the 1.0.0 interface.

Alternatively, you can pin your installation to the old version, e.g. pip install openai==0.28

A detailed migration guide is available here: openai/openai-python#742
how to fix this

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

No branches or pull requests

1 participant