Skip to content

Commit 4ef0097

Browse files
committed
fix: custom toolcall invalid memory address or nil pointer dereference (#32)
1 parent 32a8e1a commit 4ef0097

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ llm:
1717
token: "xxx"
1818

1919
custom-llm:
20-
baseUrl: http://127.0.0.1:8080
20+
baseUrl: http://127.0.0.1:8000
2121
useProxy: false
2222

2323
# 图片放大,domain需要公网可访问的地址

internal/plugin/llm/v1/message.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ func waitResponse(ctx *gin.Context, matchers []common.Matcher, r *http.Response,
141141
continue
142142
}
143143

144-
if choice.Message.ToolCalls != nil && len(choice.Message.ToolCalls) > 0 {
144+
if choice.Delta.ToolCalls != nil && len(choice.Delta.ToolCalls) > 0 {
145145
htc = true
146146
}
147147

@@ -197,7 +197,7 @@ func waitResponse(ctx *gin.Context, matchers []common.Matcher, r *http.Response,
197197
if !sse {
198198
response.Response(ctx, Model, content)
199199
} else {
200-
response.SSEResponse(ctx, Model, "[DONE]", -1)
200+
response.Event(ctx, "[DONE]")
201201
}
202202
return
203203
}

0 commit comments

Comments
 (0)