ragflow icon indicating copy to clipboard operation
ragflow copied to clipboard

[Question]: Anthropic claude API integeration

Open duraiyuva opened this issue 1 year ago • 4 comments

Describe your problem

I entered a valid API. I am getting the following error.

Fail to access model(claude-2.0) using this api key. ERROR: string indices must be integers Fail to access model(claude-2.1) using this api key. ERROR: string indices must be integers Fail to access model(claude-3-5-sonnet-20240620) using this api key. ERROR: string indices must be integers Fail to access model(claude-3-haiku-20240307) using this api key. ERROR: string indices must be integers Fail to access model(claude-3-opus-20240229) using this api key. ERROR: string indices must be integers Fail to access model(claude-3-sonnet-20240229) using this api key. ERROR: string indices must be integers 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'}}

How to resolve this? How to select a specific model from Anthropic AI?

duraiyuva avatar Nov 13 '24 01:11 duraiyuva

On the other side the the API access log says, API access and credit consumption:

ID Model Workspace Input Tokens Output Tokens Type Request 2024-11-13 06:47:12 req_014HkfHclaude-3-sonnet-20240229 Default 14 44 HTTP

This is a sample log: However, The Ragflow has accessed all models and incurred unnecessary costs.

duraiyuva avatar Nov 13 '24 01:11 duraiyuva

Is this on demo site or local deployed? If it's local, pull the dev version of image since some related issue fixed recently. When add an API key to a LLM provider, it will be successful as long as just one model has a successful completion.

KevinHuSh avatar Nov 14 '24 01:11 KevinHuSh

Is this on demo site or local deployed? If it's local, pull the dev version of image since some related issue fixed recently. When add an API key to a LLM provider, it will be successful as long as just one model has a successful completion.

This is a local deployment. Using the docker image "docker pull infiniflow/ragflow:v0.13.0"(shown as 14 days old as of now). I will try dev version. Won't it be better to force a particular model optionally? The error is on the client side. All models are accessed and incurring charges.

duraiyuva avatar Nov 14 '24 04:11 duraiyuva

I found latest version Claude 3.5 Sonnet 2024-10-22 is also missing. added and pull request created llm": [ { "llm_name": "claude-3-5-sonnet-20240620", "tags": "LLM,CHAT,200k", "max_tokens": 204800, "model_type": "chat"

duraiyuva avatar Nov 14 '24 04:11 duraiyuva