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_code=error_data.get("code"), AttributeError: 'str' object has no attribute 'get' #23

Open
wyZhang016 opened this issue Nov 23, 2024 · 3 comments

Comments

@wyZhang016
Copy link

这是因为什么原因造成的,应该如何解决呢?
Traceback (most recent call last):
File "/home/1/MindMap-main/MindMap.py", line 662, in
if is_unable_to_answer(response_of_KG_list_path):
File "/home/1/MindMap-main/MindMap.py", line 265, in is_unable_to_answer
analysis = openai.Completion.create(
File "/home/1/anaconda3/envs/mindmap/lib/python3.9/site-packages/openai/api_resources/completion.py", line 25, in create
return super().create(*args, **kwargs)
File "/home/1/anaconda3/envs/mindmap/lib/python3.9/site-packages/openai/api_resources/abstract/engine_api_resource.py", line 153, in create
response, _, api_key = requestor.request(
File "/home/1/anaconda3/envs/mindmap/lib/python3.9/site-packages/openai/api_requestor.py", line 230, in request
resp, got_stream = self._interpret_response(result, stream)
File "/home/1/anaconda3/envs/mindmap/lib/python3.9/site-packages/openai/api_requestor.py", line 624, in _interpret_response
self._interpret_response_line(
File "/home/1/anaconda3/envs/mindmap/lib/python3.9/site-packages/openai/api_requestor.py", line 687, in _interpret_response_line
raise self.handle_error_response(
File "/home/1/anaconda3/envs/mindmap/lib/python3.9/site-packages/openai/api_requestor.py", line 350, in handle_error_response
error_code=error_data.get("code"),
AttributeError: 'str' object has no attribute 'get'

@wyl-willing
Copy link
Owner

wyl-willing commented Nov 23, 2024 via email

@wyZhang016
Copy link
Author

请问openai版本应该为多少合适,调整一下函数是指需要移除is_unable_to_answer方法吗

@wyZhang016
Copy link
Author

感谢,我删除了这部分代码,已经可以了

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

2 participants