We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
chat_completion = erniebot.ChatCompletion.create(model="ernie-bot-3.5", messages=[{"role": "user", "content": "你好,请介绍下你自己"}])
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:
你好,我无法在新建的Python3.9环境中复现这个问题。请提供你使用的环境的Python版本以及erniebot版本~
erniebot
Sorry, something went wrong.
你好,我无法在新建的Python3.9环境中复现这个问题。请提供你使用的环境的Python版本以及版本~erniebot
erniebot 0.1.0 Python 3.9.7
看起来我使用相同的环境还是无法复现这个问题~ 请问你有对代码做修改吗?
没有
因为我无法复现这个问题,所以不太容易定位原因。建议可以拉取develop分支的最新代码再次尝试~
Merge pull request PaddlePaddle#11 from qingzhong1/eb7
9063a7e
modify log
sijunhe
Bobholamovic
No branches or pull requests
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: