Skip to content

Commit 0746fde

Browse files
committed
Revert "fix(fncall): fix regression introduced in #1963 (#2048)"
This reverts commit 6b06d4e.
1 parent 5763dc1 commit 0746fde

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

core/services/openai.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -778,16 +778,13 @@ func parseFunctionCall(llmresult string, multipleResults bool) []funcCallResults
778778
// As we have to change the result before processing, we can't stream the answer token-by-token (yet?)
779779
ss := map[string]interface{}{}
780780
// This prevent newlines to break JSON parsing for clients
781-
s := utils.EscapeNewLines(llmresult)
782-
if err := json.Unmarshal([]byte(s), &ss); err != nil {
783-
log.Error().Msgf("error unmarshalling JSON: %s", err.Error())
784-
return results
785-
}
781+
// s := utils.EscapeNewLines(llmresult)
782+
json.Unmarshal([]byte(llmresult), &ss)
786783

787784
// The grammar defines the function name as "function", while OpenAI returns "name"
788785
func_name, ok := ss["function"]
789786
if !ok {
790-
log.Debug().Msgf("ss[function] is not OK!, llm result: %q", llmresult)
787+
log.Debug().Msg("ss[function] is not OK!")
791788
return results
792789
}
793790
// Similarly, while here arguments is a map[string]interface{}, OpenAI actually want a stringified object

0 commit comments

Comments
 (0)