Claude webapi sdk, 支持 claude2
claude webapi sdk writen by golang.
support the latest claude-2 model.
you should login into the Claude Website firstly, find the Cookie named sessionKey, and copy it's value.
you can find your orgid in the Network panel.
go get -u github.com/all-in-aigc/claude-webapi…cli := getClient()
res, err := cli.GetOrganizations()
if err != nil {
log.Fatalf("get orgs fail: %v\n", err)
}
for _, v := range res.Array() {
orgid := v.Get("uuid").String()
log.Printf("orgid: %s\n", orgid)
}conversationId := uuid.New().String()
name := "my conversation"
cli := getClient()
params := map[string]interface{}{
"name": name,
"uuid": conversationId,
}
res, err := cli.NewConversation(params)
if err != nil {
log.Fatalf("new conversation fail: %v\n", err)
}
conversationName := res.Get("name").String()
log.Printf("conversation name: %s\n", conversationName)cli := getClient()
res, err := cli.GetConversations()
if err != nil {
log.Fatalf("get conversations fail: %v\n", err)
}
for _, v := range res.Array() {
conversationId := v.Get("uuid").String()
conversationName := v.Get("name").String()
log.Printf("conversation: %s, %s\n", conversationId, conversationName)
}…Test cases are under the ./examples folder, you can test them by go test.
Telegram Group: all in AIGC
Discord Server: all in AIGC
暂无开放 Issues,或尚未同步最近议题。