fix: repair websocket custom tool calls
This commit is contained in:
@@ -379,7 +379,7 @@ func shouldReplaceWebsocketTranscript(rawJSON []byte, nextInput gjson.Result) bo
|
|||||||
|
|
||||||
for _, item := range nextInput.Array() {
|
for _, item := range nextInput.Array() {
|
||||||
switch strings.TrimSpace(item.Get("type").String()) {
|
switch strings.TrimSpace(item.Get("type").String()) {
|
||||||
case "function_call":
|
case "function_call", "custom_tool_call":
|
||||||
return true
|
return true
|
||||||
case "message":
|
case "message":
|
||||||
role := strings.TrimSpace(item.Get("role").String())
|
role := strings.TrimSpace(item.Get("role").String())
|
||||||
@@ -431,7 +431,7 @@ func dedupeFunctionCallsByCallID(rawArray string) (string, error) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
itemType := strings.TrimSpace(gjson.GetBytes(item, "type").String())
|
itemType := strings.TrimSpace(gjson.GetBytes(item, "type").String())
|
||||||
if itemType == "function_call" {
|
if isResponsesToolCallType(itemType) {
|
||||||
callID := strings.TrimSpace(gjson.GetBytes(item, "call_id").String())
|
callID := strings.TrimSpace(gjson.GetBytes(item, "call_id").String())
|
||||||
if callID != "" {
|
if callID != "" {
|
||||||
if _, ok := seenCallIDs[callID]; ok {
|
if _, ok := seenCallIDs[callID]; ok {
|
||||||
|
|||||||
Reference in New Issue
Block a user