From 972d9cdbffad19efbf2bb05f2f91e31d09120e32 Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Fri, 8 Aug 2025 13:14:06 +0300 Subject: Enha: get func name from oai tool call --- llm.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'llm.go') diff --git a/llm.go b/llm.go index 3c3085f..14caa5c 100644 --- a/llm.go +++ b/llm.go @@ -146,6 +146,10 @@ func (op OpenAIer) ParseChunk(data []byte) (*models.TextChunk, error) { } if len(llmchunk.Choices[len(llmchunk.Choices)-1].Delta.ToolCalls) > 0 { resp.ToolChunk = llmchunk.Choices[len(llmchunk.Choices)-1].Delta.ToolCalls[0].Function.Arguments + fname := llmchunk.Choices[len(llmchunk.Choices)-1].Delta.ToolCalls[0].Function.Name + if fname != "" { + resp.FuncName = fname + } } if llmchunk.Choices[len(llmchunk.Choices)-1].FinishReason == "stop" { if resp.Chunk != "" { -- cgit v1.2.3