diff options
author | Grail Finder <wohilas@gmail.com> | 2025-08-08 13:14:06 +0300 |
---|---|---|
committer | Grail Finder <wohilas@gmail.com> | 2025-08-08 13:14:06 +0300 |
commit | 972d9cdbffad19efbf2bb05f2f91e31d09120e32 (patch) | |
tree | 78a4e9d637489852871882be9a4933ae299ce085 /llm.go | |
parent | c3a5de7a0d2631c8eda71a54cad9587d3d8915e1 (diff) |
Enha: get func name from oai tool call
Diffstat (limited to 'llm.go')
-rw-r--r-- | llm.go | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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 != "" { |