Skip to content

Commit

Permalink
fix claude format in claude 1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
zmh-program committed Oct 24, 2023
1 parent aaf32d1 commit 0064408
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions adapter/claude/chat.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ func (c *ChatInstance) CreateStreamChatRequest(props *ChatProps, hook globals.Ho
// response example:
//
// event:completion
// {"completion":"么","stop_reason":null,"model":"claude-1.3","stop":null,"log_id":"605b37b2bbab7a557b811ce47d8beeab959cbab22e46b515cb15e3f00afcbe24"}
// data:{"completion":"!","stop_reason":null,"model":"claude-2.0","stop":null,"log_id":"f5f659a5807419c94cfac4a9f2f79a66e95733975714ce7f00e30689dd136b02"}

if !strings.HasPrefix(data, "data:") {
Expand All @@ -89,6 +90,7 @@ func (c *ChatInstance) CreateStreamChatRequest(props *ChatProps, hook globals.Ho
if err := hook(form.Completion); err != nil {
return err
}
return nil
}

fmt.Println(fmt.Sprintf("anthropic error: cannot parse response: %s", data))
Expand Down

0 comments on commit 0064408

Please sign in to comment.