mirror of
https://github.com/router-for-me/CLIProxyAPIPlus.git
synced 2026-04-04 19:51:18 +00:00
refactor: remove redundant bounds checks per code review
This commit is contained in:
@@ -305,11 +305,7 @@ func fixCLIToolResponse(input string) (string, error) {
|
||||
|
||||
functionResponseContent := `{"parts":[],"role":"function"}`
|
||||
for ri, response := range groupResponses {
|
||||
fallbackName := ""
|
||||
if ri < len(group.CallNames) {
|
||||
fallbackName = group.CallNames[ri]
|
||||
}
|
||||
partRaw := parseFunctionResponseRaw(response, fallbackName)
|
||||
partRaw := parseFunctionResponseRaw(response, group.CallNames[ri])
|
||||
if partRaw != "" {
|
||||
functionResponseContent, _ = sjson.SetRaw(functionResponseContent, "parts.-1", partRaw)
|
||||
}
|
||||
|
||||
@@ -261,10 +261,7 @@ func fixCLIToolResponse(input string) (string, error) {
|
||||
log.Warnf("failed to parse function response")
|
||||
continue
|
||||
}
|
||||
raw := response.Raw
|
||||
if ri < len(group.CallNames) {
|
||||
raw = backfillFunctionResponseName(raw, group.CallNames[ri])
|
||||
}
|
||||
raw := backfillFunctionResponseName(response.Raw, group.CallNames[ri])
|
||||
functionResponseContent, _ = sjson.SetRaw(functionResponseContent, "parts.-1", raw)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user