-
Notifications
You must be signed in to change notification settings - Fork 32
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
Comments
openai版本不对?这是以前的版本,is_unable_to_answer是为了防止gpt输出“无法提供”这之类的话,调用的直接是openai
api不是langchain。可以调整一下函数或者版本。
wyZhang016 ***@***.***>于2024年11月23日 周六15:13写道:
… 这是因为什么原因造成的,应该如何解决呢?
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'
—
Reply to this email directly, view it on GitHub
<#23>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/APCDU67WCM3BSNFPPVMZLRT2CATJ7AVCNFSM6AAAAABSKY4YAOVHI2DSMVQWIX3LMV43ASLTON2WKOZSGY4DKNJVGIZTCOA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
请问openai版本应该为多少合适,调整一下函数是指需要移除is_unable_to_answer方法吗 |
感谢,我删除了这部分代码,已经可以了 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
这是因为什么原因造成的,应该如何解决呢?
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'
The text was updated successfully, but these errors were encountered: