mirror of
https://github.com/sipeed/picoclaw.git
synced 2026-06-12 18:08:54 +00:00
This reverts commit e556a816e4.
This commit is contained in:
@@ -55,12 +55,6 @@ func buildCLIToolsPrompt(tools []ToolDefinition) string {
|
||||
func NormalizeToolCall(tc ToolCall) ToolCall {
|
||||
normalized := tc
|
||||
|
||||
if normalized.ThoughtSignature == "" &&
|
||||
normalized.ExtraContent != nil &&
|
||||
normalized.ExtraContent.Google != nil {
|
||||
normalized.ThoughtSignature = normalized.ExtraContent.Google.ThoughtSignature
|
||||
}
|
||||
|
||||
// Ensure Name is populated from Function if not set
|
||||
if normalized.Name == "" && normalized.Function != nil {
|
||||
normalized.Name = normalized.Function.Name
|
||||
@@ -83,9 +77,8 @@ func NormalizeToolCall(tc ToolCall) ToolCall {
|
||||
argsJSON, _ := json.Marshal(normalized.Arguments)
|
||||
if normalized.Function == nil {
|
||||
normalized.Function = &FunctionCall{
|
||||
Name: normalized.Name,
|
||||
Arguments: string(argsJSON),
|
||||
ThoughtSignature: normalized.ThoughtSignature,
|
||||
Name: normalized.Name,
|
||||
Arguments: string(argsJSON),
|
||||
}
|
||||
} else {
|
||||
if normalized.Function.Name == "" {
|
||||
@@ -97,12 +90,6 @@ func NormalizeToolCall(tc ToolCall) ToolCall {
|
||||
if normalized.Function.Arguments == "" {
|
||||
normalized.Function.Arguments = string(argsJSON)
|
||||
}
|
||||
if normalized.Function.ThoughtSignature == "" {
|
||||
normalized.Function.ThoughtSignature = normalized.ThoughtSignature
|
||||
}
|
||||
if normalized.ThoughtSignature == "" {
|
||||
normalized.ThoughtSignature = normalized.Function.ThoughtSignature
|
||||
}
|
||||
}
|
||||
|
||||
return normalized
|
||||
|
||||
Reference in New Issue
Block a user