mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-04-13 21:57:29 +08:00
ensure seen call ids only after valid function_call is emitted
This commit is contained in:
@@ -233,9 +233,6 @@ func toResponsesInputItemsWithState(msg Message, seenCalls map[string]struct{})
|
||||
if callID == "" {
|
||||
continue
|
||||
}
|
||||
if seenCalls != nil {
|
||||
seenCalls[callID] = struct{}{}
|
||||
}
|
||||
name := strings.TrimSpace(tc.Name)
|
||||
argsRaw := ""
|
||||
if tc.Function != nil {
|
||||
@@ -255,6 +252,9 @@ func toResponsesInputItemsWithState(msg Message, seenCalls map[string]struct{})
|
||||
argsRaw = string(argsJSON)
|
||||
}
|
||||
}
|
||||
if seenCalls != nil {
|
||||
seenCalls[callID] = struct{}{}
|
||||
}
|
||||
items = append(items, map[string]interface{}{
|
||||
"type": "function_call",
|
||||
"call_id": callID,
|
||||
|
||||
Reference in New Issue
Block a user