mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-04-19 11:48:38 +00:00
Merge pull request #2511 from JerryKwan/issue2499
This commit is contained in:
@@ -389,25 +389,29 @@ func StreamResponseOpenAI2Claude(openAIResponse *dto.ChatCompletionsStreamRespon
|
|||||||
}
|
}
|
||||||
|
|
||||||
idx := blockIndex
|
idx := blockIndex
|
||||||
claudeResponses = append(claudeResponses, &dto.ClaudeResponse{
|
if toolCall.Function.Name != "" {
|
||||||
Index: &idx,
|
claudeResponses = append(claudeResponses, &dto.ClaudeResponse{
|
||||||
Type: "content_block_start",
|
Index: &idx,
|
||||||
ContentBlock: &dto.ClaudeMediaMessage{
|
Type: "content_block_start",
|
||||||
Id: toolCall.ID,
|
ContentBlock: &dto.ClaudeMediaMessage{
|
||||||
Type: "tool_use",
|
Id: toolCall.ID,
|
||||||
Name: toolCall.Function.Name,
|
Type: "tool_use",
|
||||||
Input: map[string]interface{}{},
|
Name: toolCall.Function.Name,
|
||||||
},
|
Input: map[string]interface{}{},
|
||||||
})
|
},
|
||||||
|
})
|
||||||
claudeResponses = append(claudeResponses, &dto.ClaudeResponse{
|
}
|
||||||
Index: &idx,
|
|
||||||
Type: "content_block_delta",
|
if len(toolCall.Function.Arguments) > 0 {
|
||||||
Delta: &dto.ClaudeMediaMessage{
|
claudeResponses = append(claudeResponses, &dto.ClaudeResponse{
|
||||||
Type: "input_json_delta",
|
Index: &idx,
|
||||||
PartialJson: &toolCall.Function.Arguments,
|
Type: "content_block_delta",
|
||||||
},
|
Delta: &dto.ClaudeMediaMessage{
|
||||||
})
|
Type: "input_json_delta",
|
||||||
|
PartialJson: &toolCall.Function.Arguments,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
info.ClaudeConvertInfo.Index = blockIndex
|
info.ClaudeConvertInfo.Index = blockIndex
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user