mirror of
https://github.com/coaidev/coai.git
synced 2025-05-19 13:00:14 +09:00
chore: update claude format
This commit is contained in:
parent
1b161f9264
commit
6fea649f7c
@ -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
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user