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

添加对Anthropic Claude API的支持 #559

Merged
merged 4 commits into from
Feb 21, 2025
Merged

Conversation

Rt39
Copy link
Contributor

@Rt39 Rt39 commented Feb 21, 2025

#558

Motivation

Anthropic Claude的API与OpenAI的不兼容,希望增加对Claude的支持

Modifications

.gitignore中添加了.conda文件夹,对使用conda环境的用户更加友好

requirements.txt添加了anthropic库

添加了anthropic_source.py,用以处理Anthropic API(警告:尚未对上传图片进行测试,可能这部分存在bug)

func_tool_manager.py文件中增加了get_func_desc_anthropic_style()函数,以处理Anthropic的函数调用API。

default.py中添加claude模板

需要的进一步改进

在前端面板的“服务提供商配置”上添加anthropic_chat_completion类型

前端面板将“服务提供商配置”中的“文本生成模型”里“模型最大输出长度(tokens) (max_tokens)”对于anthropic_chat_completion类型改为常驻或显式的,因为调用Anthropic API,max_tokens是必须的

@Soulter Soulter requested a review from Fridemn February 21, 2025 07:42
@Soulter
Copy link
Owner

Soulter commented Feb 21, 2025

Nice!前端面板不需要进行修改的,前端面板会根据 default.py 里面配置好的相关数据(schema)自动渲染

@Fridemn Fridemn merged commit 04d204e into Soulter:master Feb 21, 2025
1 check failed
@Fridemn
Copy link
Collaborator

Fridemn commented Feb 21, 2025

LGTM

@Rt39 Rt39 deleted the feat-claude-api branch February 21, 2025 17:14
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

Successfully merging this pull request may close these issues.

3 participants