chore: update claude format

This commit is contained in:
Minghan Zhang 2024-03-30 23:11:25 +08:00 committed by GitHub
parent 1b161f9264
commit 6fea649f7c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -54,14 +54,12 @@ func (c *ChatInstance) GetTokens(props *adaptercommon.ChatProps) int {
} }
func (c *ChatInstance) ConvertMessages(props *adaptercommon.ChatProps) []globals.Message { func (c *ChatInstance) ConvertMessages(props *adaptercommon.ChatProps) []globals.Message {
// anthropic api: top message must be user message, system message is not allowed // anthropic api: top message must be user message, only `user` and `assistant` role messages are allowd
start := false start := false
result := make([]globals.Message, 0) result := make([]globals.Message, 0)
for _, message := range props.Message { for _, message := range props.Message {
// System message is set when constructing Chatbody
if message.Role == globals.System { if message.Role == globals.System {
continue continue
} }