feat: 完善openai转claude支持

This commit is contained in:
CaIon
2025-04-11 18:28:50 +08:00
parent c94f662829
commit 9e4506ebaf
6 changed files with 100 additions and 37 deletions
+8 -3
View File
@@ -19,13 +19,18 @@ type ThinkingContentInfo struct {
}
const (
LastMessageTypeText = "text"
LastMessageTypeTools = "tools"
LastMessageTypeNone = "none"
LastMessageTypeText = "text"
LastMessageTypeTools = "tools"
LastMessageTypeThinking = "thinking"
)
type ClaudeConvertInfo struct {
LastMessagesType string
Index int
Usage *dto.Usage
FinishReason string
Done bool
}
const (
@@ -113,7 +118,7 @@ func GenRelayInfoClaude(c *gin.Context) *RelayInfo {
info.RelayFormat = RelayFormatClaude
info.ShouldIncludeUsage = false
info.ClaudeConvertInfo = ClaudeConvertInfo{
LastMessagesType: LastMessageTypeText,
LastMessagesType: LastMessageTypeNone,
}
return info
}