[Bug]: Anthropic set api key error
Is there an existing issue for the same bug?
- [X] I have checked the existing issues.
Branch name
main
Commit ID
7e0148c
Other environment information
No response
Actual behavior
A small bug caused the inability to add anthropic model providers.
I found that this bug is caused by this code:
The file is located at /rag/llm/chat_model.py row1261
This should not be parsed as Json string, causing the following code to fail in taking values:
ans = response["content"][0]["text"]
Suggestion for modification: change .json() to .dict()
Expected behavior
No response
Steps to reproduce
when i add anthropic model providers and set apikey, always fail.
Additional information
No response
Could you paste the error message or print(response) if it's convenient ?
Could you paste the error message or
print(response)if it's convenient ?
Yes, my negligence. This was an error in setting the anthropic’s apikey.
Additionally, I have ignored claude-instant-1.2 as it caused an error:
Fail to access model(claude-instant-1.2) using this api key. **ERROR**: Error code: 404 - {'type': 'error', 'error': {'type': 'not_found_error', 'message': 'model: claude-instant-1.2'}
Same issue
Fail to access model(claude-2.0) using this api key. **ERROR**: string indices must be integers, not 'str' Fail to access model(claude-2.1) using this api key. **ERROR**: string indices must be integers, not 'str' Fail to access model(claude-3-5-sonnet-20240620) using this api key. **ERROR**: string indices must be integers, not 'str' Fail to access model(claude-3-haiku-20240307) using this api key. **ERROR**: string indices must be integers, not 'str' Fail to access model(claude-3-opus-20240229) using this api key. **ERROR**: string indices must be integers, not 'str' Fail to access model(claude-3-sonnet-20240229) using this api key. **ERROR**: string indices must be integers, not 'str' Fail to access model(claude-instant-1.2) using this api key. **ERROR**: Error code: 404 - {'type': 'error', 'error': {'type': 'not_found_error', 'message': 'model: claude-instant-1.2'}}
Same issue
Fail to access model(claude-2.0) using this api key. **ERROR**: string indices must be integers, not 'str' Fail to access model(claude-2.1) using this api key. **ERROR**: string indices must be integers, not 'str' Fail to access model(claude-3-5-sonnet-20240620) using this api key. **ERROR**: string indices must be integers, not 'str' Fail to access model(claude-3-haiku-20240307) using this api key. **ERROR**: string indices must be integers, not 'str' Fail to access model(claude-3-opus-20240229) using this api key. **ERROR**: string indices must be integers, not 'str' Fail to access model(claude-3-sonnet-20240229) using this api key. **ERROR**: string indices must be integers, not 'str' Fail to access model(claude-instant-1.2) using this api key. **ERROR**: Error code: 404 - {'type': 'error', 'error': {'type': 'not_found_error', 'message': 'model: claude-instant-1.2'}}
Same error for me right now.
Fixed by #3351