You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
---------------------------------------------------------------------------
APIRemovedInV1 Traceback (most recent call last)
[<ipython-input-7-36f4c2dde96f>](https://localhost:8080/#) in <cell line: 3>()
1 import openai
2
----> 3 response = openai.ChatCompletion.create(
4 model="gpt-3.5-turbo",
5 messages=[
2 frames
[/usr/local/lib/python3.10/dist-packages/openai/lib/_old_api.py](https://localhost:8080/#) in __load__(self)
31 @override
32 def __load__(self) -> None:
---> 33 raise APIRemovedInV1(symbol=self._symbol)
34
35
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: https://github.com/openai/openai-python/discussions/742
スクリーンショット
書籍の該当箇所
3.5章 「Chat Completion APIをさわってみる」P.55のサンプルコード
環境
Google Colab
その他
Google Colabのランタイムを再起動したうえで、書籍では !pip install openai
となっている箇所を、エラーメッセージに記載されているとおり !pip install openai==0.28
としたところ、正常に実行ができました。
The text was updated successfully, but these errors were encountered:
エラーの説明
以下サンプルコードの実行でエラーが発生
エラーメッセージは以下。
スクリーンショット
書籍の該当箇所
3.5章 「Chat Completion APIをさわってみる」P.55のサンプルコード
環境
Google Colab
その他
Google Colabのランタイムを再起動したうえで、書籍では
!pip install openai
となっている箇所を、エラーメッセージに記載されているとおり
!pip install openai==0.28
としたところ、正常に実行ができました。
The text was updated successfully, but these errors were encountered: