Closed deng-cy closed 5 months ago
Replace https://api.g4f.icu
with https://api.g4f.icu/v1
to fix the issue.
Thanks, OPENAI works, but ANTHROPIC gives HTTP Request: POST https://api.g4f.icu/v1/v1/messages "HTTP/1.1 404 Not Found"
The request for anthropic models to g4f.icu should also be routed through the OpenAI SDK. I'm still looking for an appropriate solution.
Install the lastest version from github:
pip install git+https://github.com/zh-plus/openlrc
and route claude model into OpenAI SDK by chatbot_model='openai: claude-3-haiku-20240307'
Example:
lrcer = LRCer(chatbot_model='openai: claude-3-haiku-20240307',
base_url_config={'openai': 'https://api.g4f.icu/v1/'})
试了一下
base_url={'openai': 'https://api.g4f.icu'}
,在chatbox.pyprompt_tokens = response.usage.prompt_tokens
这一行报错,response
里面的信息是试了一下修改
json_mode=True
没有用如果用
{'anthropic': 'https://api.g4f.icu'}
会有另一个错误,显示https://api.g4f.icu/v1/messages "HTTP/1.1 404 Not Found"