-
Notifications
You must be signed in to change notification settings - Fork 52
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
按教程写代码。报错 #11
Labels
question
Further information is requested
Comments
你好,我无法在新建的Python3.9环境中复现这个问题。请提供你使用的环境的Python版本以及 |
erniebot 0.1.0 |
因为我无法复现这个问题,所以不太容易定位原因。建议可以拉取develop分支的最新代码再次尝试~ |
qingzhong1
pushed a commit
to qingzhong1/ERNIE-Bot-SDK
that referenced
this issue
Jan 3, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
print(chat_completion.result)
19 # Create a chat completion
---> 20 chat_completion = erniebot.ChatCompletion.create(model="ernie-bot-3.5", messages=[{"role": "user", "content": "你好,请介绍下你自己"}])
22 print(chat_completion.result)
File /opt/conda/lib/python3.9/site-packages/erniebot/resources/abc/creatable.py:39, in Creatable.create(cls, **create_kwargs)
28 @classmethod
29 def create(cls,
30 **create_kwargs: Any) -> Union[EBResponse, Iterator[EBResponse]]:
31 """Create a new resource.
32
33 Args:
(...)
37 Response from the server.
38 """
---> 39 resource = cls.new_object()
40 return resource.create_resource(**create_kwargs)
File /opt/conda/lib/python3.9/site-packages/erniebot/resources/resource.py:68, in EBResource.new_object(cls, **kwargs)
66 @classmethod
67 def new_object(cls, **kwargs: Any) -> Self:
---> 68 return cls(**kwargs)
File /opt/conda/lib/python3.9/site-packages/erniebot/resources/resource.py:55, in EBResource.init(self, **kwargs)
54 def init(self, **kwargs: Any) -> None:
---> 55 super().init()
57 self._cfg = self._create_config_dict(**kwargs)
59 self.api_type = self._cfg['api_type']
File /opt/conda/lib/python3.9/typing.py:1083, in _no_init(self, *args, **kwargs)
1082 def _no_init(self, *args, **kwargs):
-> 1083 raise TypeError('Protocols cannot be instantiated')
TypeError: Protocols cannot be instantiated
The text was updated successfully, but these errors were encountered: