Closed Chen2226 closed 1 year ago
发送消息:你好 error_code=invalid_api_key error_message='Incorrect API key provided: fill_you**here. You can find your API key at https://platform.openai.com/account/api-keys.' error_param=None error_type=invalid_request_error message='OpenAI API error received' stream_error=False ERROR: Incorrect API key provided: fill_you**here. You can find your API key at https://platform.openai.com/account/api-keys. Traceback (most recent call last): File "/bot/pkg/qqbot/message.py", line 24, in process_normal_message text = session.append(text_message) File "/bot/pkg/openai/session.py", line 166, in append response = pkg.utils.context.get_openai_manager().request_completion( File "/bot/pkg/openai/manager.py", line 35, in request_completion response = openai.Completion.create( File "/usr/local/lib/python3.9/site-packages/openai/api_resources/completion.py", line 25, in create return super().create(*args, kwargs) File "/usr/local/lib/python3.9/site-packages/openai/api_resources/abstract/engine_apiresource.py", line 153, in create response, , api_key = requestor.request( File "/usr/local/lib/python3.9/site-packages/openai/api_requestor.py", line 227, in request resp, got_stream = self._interpret_response(result, stream) File "/usr/local/lib/python3.9/site-packages/openai/api_requestor.py", line 620, in _interpret_response self._interpret_response_line( File "/usr/local/lib/python3.9/site-packages/openai/api_requestor.py", line 680, in _interpret_response_line raise self.handle_error_response( openai.error.AuthenticationError: Incorrect API key provided: fill_you****here. You can find your API key at https://platform.openai.com/account/api-keys.
我看文档使用curl请求,key使用跟我配置文件填写一直 返回: {"id":"cmpl-6hGFOgxul7C0IufEpXmgu8MiZ9tNh","object":"text_completion","created":1675768578,"model":"text-davinci-003","choices":[{"text":"\n\nThis is indeed a test","index":0,"logprobs":null,"finish_reason":"length"}],"usage":{"prompt_tokens":5,"completion_tokens":7,"total_tokens":12}}
apikey应该是没问题的
我傻叉了,没仔细看去写到注释里面。。。
[bot]err:Incorrect API key provided: fill_you**here. You can find your API key at https://platform.openai.com/account/api-keys.
apikey我确定生成了的