From 7459c2c81af86d4cb91dcec48dc0c8b6e4278079 Mon Sep 17 00:00:00 2001 From: hkfires <10558748+hkfires@users.noreply.github.com> Date: Sun, 26 Oct 2025 16:28:20 +0800 Subject: [PATCH] fix(aistudio): remove generationConfig and tools when action is countTokens --- internal/runtime/executor/aistudio_executor.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/runtime/executor/aistudio_executor.go b/internal/runtime/executor/aistudio_executor.go index 53de71c8..de90c63a 100644 --- a/internal/runtime/executor/aistudio_executor.go +++ b/internal/runtime/executor/aistudio_executor.go @@ -192,6 +192,10 @@ func (e *AistudioExecutor) CountTokens(ctx context.Context, auth *cliproxyauth.A if err != nil { return cliproxyexecutor.Response{}, err } + + body.payload, _ = sjson.DeleteBytes(body.payload, "generationConfig") + body.payload, _ = sjson.DeleteBytes(body.payload, "tools") + endpoint := e.buildEndpoint(req.Model, "countTokens", "") wsReq := &wsrelay.HTTPRequest{ Method: http.MethodPost,