From 00644081604c8c64cd79e6b1ea6d85033d8cc2f8 Mon Sep 17 00:00:00 2001 From: Zhang Minghan Date: Tue, 24 Oct 2023 19:51:29 +0800 Subject: [PATCH] fix claude format in claude 1.3 --- adapter/claude/chat.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/adapter/claude/chat.go b/adapter/claude/chat.go index ecde8964..595b8c6b 100644 --- a/adapter/claude/chat.go +++ b/adapter/claude/chat.go @@ -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:") { @@ -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))