mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-05-13 14:47:35 +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 == "" {
|
if callID == "" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if seenCalls != nil {
|
|
||||||
seenCalls[callID] = struct{}{}
|
|
||||||
}
|
|
||||||
name := strings.TrimSpace(tc.Name)
|
name := strings.TrimSpace(tc.Name)
|
||||||
argsRaw := ""
|
argsRaw := ""
|
||||||
if tc.Function != nil {
|
if tc.Function != nil {
|
||||||
@@ -255,6 +252,9 @@ func toResponsesInputItemsWithState(msg Message, seenCalls map[string]struct{})
|
|||||||
argsRaw = string(argsJSON)
|
argsRaw = string(argsJSON)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if seenCalls != nil {
|
||||||
|
seenCalls[callID] = struct{}{}
|
||||||
|
}
|
||||||
items = append(items, map[string]interface{}{
|
items = append(items, map[string]interface{}{
|
||||||
"type": "function_call",
|
"type": "function_call",
|
||||||
"call_id": callID,
|
"call_id": callID,
|
||||||
|
|||||||
Reference in New Issue
Block a user