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

Claude改用messages API,支持Claude3 #86

Merged
merged 4 commits into from
Mar 6, 2024
Merged

Conversation

moondie
Copy link
Contributor

@moondie moondie commented Mar 6, 2024

顺便修复解析json到空指针的bug.
至于删除的claude-instant-1(已被claude-instant-1.2替代)和claude-2(已被claude-2.1替代)是否需要重定向以便旧的用户可以兼容,就需要作者您考虑啦

@MartialBE
Copy link
Owner

感谢pr
测试可以通过么。我一直没申请到它的API😂😂😂

@moondie
Copy link
Contributor Author

moondie commented Mar 6, 2024

实测可以用,不过我没实现图片能力,只支持文字

@moondie
Copy link
Contributor Author

moondie commented Mar 6, 2024

claude现在不需要申请,绑卡预付费就可以用

@MartialBE
Copy link
Owner

是么 我去看看。信用卡支持国内发行的visa 吗

@moondie
Copy link
Contributor Author

moondie commented Mar 6, 2024

没试不清楚,我用的美国虚拟卡,卡信息填的美国,组织地区和使用地区填的我的oneapi部署所在地日本。

@MartialBE
Copy link
Owner

噗...登陆封号...😑

@MartialBE MartialBE merged commit e1fcfae into MartialBE:main Mar 6, 2024
@moondie
Copy link
Contributor Author

moondie commented Mar 6, 2024

我被官方文档骗惨! 官方文档里usage在delta里面! 结果实际是在外面

@moondie
Copy link
Contributor Author

moondie commented Mar 6, 2024

image
这里中间少了个"Usage." go语言应该不能这样吧?为啥编辑器没报错

@MartialBE
Copy link
Owner

确实还有点问题。 是因为结构体写错了。
因为之前的结构体 使用的是

type ClaudeResponse struct {
	Usage         `json:"usage,omitempty"`
}

相当于继承了 Usage 结构体。 所以可以直接在 Message下使用 Usage 的字段。

我已经修复了, 并且支持了 vision

@MartialBE
Copy link
Owner

哇..Claude杀疯了吧...
本来想弄弄函数调用。又被封了,还是固定ip..
还好文本/vision调试完了。不玩了...

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.

2 participants