From de2df4c341035969b3c48a36c893fb76853d16cc Mon Sep 17 00:00:00 2001 From: tong3jie <14191774+tong3jie@users.noreply.github.com> Date: Wed, 18 Mar 2026 16:08:19 +0800 Subject: [PATCH] fix(provider): remove hard-coded for MaxTokenField and set default is "max_tokens" when ModelConfig.MaxTokensField is null --- pkg/providers/openai_compat/provider.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/providers/openai_compat/provider.go b/pkg/providers/openai_compat/provider.go index e8ff7b330..177204643 100644 --- a/pkg/providers/openai_compat/provider.go +++ b/pkg/providers/openai_compat/provider.go @@ -130,6 +130,7 @@ func NewProvider(apiKey, apiBase, proxy string, opts ...Option) *Provider { } } + // Default to "max_tokens" if no custom field is set, since most APIs use that. if p.maxTokensField == "" { p.maxTokensField = "max_tokens" }