mirror of
https://github.com/alibaba/higress.git
synced 2026-05-28 22:57:31 +08:00
remove omitempty for toolcall index (#3148)
Co-authored-by: 澄潭 <zty98751@alibaba-inc.com>
This commit is contained in:
@@ -108,7 +108,6 @@ func (b *bedrockProvider) convertEventFromBedrockToOpenAI(ctx wrapper.HttpContex
|
|||||||
chatChoice.Delta.ToolCalls = []toolCall{
|
chatChoice.Delta.ToolCalls = []toolCall{
|
||||||
{
|
{
|
||||||
Id: bedrockEvent.Start.ToolUse.ToolUseID,
|
Id: bedrockEvent.Start.ToolUse.ToolUseID,
|
||||||
Index: 0,
|
|
||||||
Type: "function",
|
Type: "function",
|
||||||
Function: functionCall{
|
Function: functionCall{
|
||||||
Name: bedrockEvent.Start.ToolUse.Name,
|
Name: bedrockEvent.Start.ToolUse.Name,
|
||||||
@@ -138,7 +137,6 @@ func (b *bedrockProvider) convertEventFromBedrockToOpenAI(ctx wrapper.HttpContex
|
|||||||
if bedrockEvent.Delta.ToolUse != nil {
|
if bedrockEvent.Delta.ToolUse != nil {
|
||||||
chatChoice.Delta.ToolCalls = []toolCall{
|
chatChoice.Delta.ToolCalls = []toolCall{
|
||||||
{
|
{
|
||||||
Index: 0,
|
|
||||||
Type: "function",
|
Type: "function",
|
||||||
Function: functionCall{
|
Function: functionCall{
|
||||||
Arguments: bedrockEvent.Delta.ToolUse.Input,
|
Arguments: bedrockEvent.Delta.ToolUse.Input,
|
||||||
@@ -168,7 +166,6 @@ func (b *bedrockProvider) convertEventFromBedrockToOpenAI(ctx wrapper.HttpContex
|
|||||||
TotalTokens: bedrockEvent.Usage.TotalTokens,
|
TotalTokens: bedrockEvent.Usage.TotalTokens,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
openAIFormattedChunkBytes, _ := json.Marshal(openAIFormattedChunk)
|
openAIFormattedChunkBytes, _ := json.Marshal(openAIFormattedChunk)
|
||||||
var openAIChunk strings.Builder
|
var openAIChunk strings.Builder
|
||||||
openAIChunk.WriteString(ssePrefix)
|
openAIChunk.WriteString(ssePrefix)
|
||||||
|
|||||||
@@ -393,7 +393,7 @@ func (m *chatMessage) ParseContent() []chatMessageContent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type toolCall struct {
|
type toolCall struct {
|
||||||
Index int `json:"index,omitempty"`
|
Index int `json:"index"`
|
||||||
Id string `json:"id,omitempty"`
|
Id string `json:"id,omitempty"`
|
||||||
Type string `json:"type"`
|
Type string `json:"type"`
|
||||||
Function functionCall `json:"function"`
|
Function functionCall `json:"function"`
|
||||||
|
|||||||
Reference in New Issue
Block a user