fix(translator): handle empty tool function names in OpenAI Claude responses
- Added check to prevent processing of empty `function.name` values, ensuring valid data is handled. Fixed: #2557
This commit is contained in:
@@ -236,7 +236,7 @@ func convertOpenAIStreamingChunkToAnthropic(rawJSON []byte, param *ConvertOpenAI
|
||||
|
||||
// Handle function name
|
||||
if function := toolCall.Get("function"); function.Exists() {
|
||||
if name := function.Get("name"); name.Exists() {
|
||||
if name := function.Get("name"); name.Exists() && name.String() != "" {
|
||||
accumulator.Name = util.MapToolName(param.ToolNameMap, name.String())
|
||||
|
||||
stopThinkingContentBlock(param, &results)
|
||||
|
||||
Reference in New Issue
Block a user