fix: add gpustack provider for qwen3 enable think (#11843)

* add gpustack provider

* fix: test

* fix: type
This commit is contained in:
SuYao 2025-12-11 18:16:47 +08:00 committed by GitHub
parent 595a0f194a
commit c1bf6cfbb7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 7 deletions

View File

@ -148,9 +148,10 @@ export async function printWebviewToPDF(webviewId: number): Promise<string | nul
// Generate PDF with settings to capture full page // Generate PDF with settings to capture full page
const pdfData = await webview.printToPDF({ const pdfData = await webview.printToPDF({
marginsType: 0, margins: {
marginType: 'default'
},
printBackground: true, printBackground: true,
printSelectionOnly: false,
landscape: false, landscape: false,
pageSize: 'A4', pageSize: 'A4',
preferCSSPageSize: true preferCSSPageSize: true
@ -206,13 +207,13 @@ export async function saveWebviewAsHTML(webviewId: number): Promise<string | nul
if (document.doctype) { if (document.doctype) {
const dt = document.doctype; const dt = document.doctype;
doctype = '<!DOCTYPE ' + (dt.name || 'html'); doctype = '<!DOCTYPE ' + (dt.name || 'html');
// Add PUBLIC identifier if publicId is present // Add PUBLIC identifier if publicId is present
if (dt.publicId) { if (dt.publicId) {
// Escape single quotes in publicId // Escape single quotes in publicId
const escapedPublicId = String(dt.publicId).replace(/'/g, "\\'"); const escapedPublicId = String(dt.publicId).replace(/'/g, "\\'");
doctype += " PUBLIC '" + escapedPublicId + "'"; doctype += " PUBLIC '" + escapedPublicId + "'";
// Add systemId if present (required when publicId is present) // Add systemId if present (required when publicId is present)
if (dt.systemId) { if (dt.systemId) {
const escapedSystemId = String(dt.systemId).replace(/'/g, "\\'"); const escapedSystemId = String(dt.systemId).replace(/'/g, "\\'");
@ -223,7 +224,7 @@ export async function saveWebviewAsHTML(webviewId: number): Promise<string | nul
const escapedSystemId = String(dt.systemId).replace(/'/g, "\\'"); const escapedSystemId = String(dt.systemId).replace(/'/g, "\\'");
doctype += " SYSTEM '" + escapedSystemId + "'"; doctype += " SYSTEM '" + escapedSystemId + "'";
} }
doctype += '>'; doctype += '>';
} }
return doctype + (document.documentElement?.outerHTML || ''); return doctype + (document.documentElement?.outerHTML || '');

View File

@ -754,7 +754,8 @@ describe('reasoning utils', () => {
const result = getGeminiReasoningParams(assistant, model) const result = getGeminiReasoningParams(assistant, model)
expect(result).toEqual({ expect(result).toEqual({
thinkingConfig: { thinkingConfig: {
includeThoughts: true includeThoughts: true,
thinkingBudget: -1
} }
}) })
}) })

View File

@ -58,7 +58,8 @@ export const isSupportStreamOptionsProvider = (provider: Provider) => {
const NOT_SUPPORT_QWEN3_ENABLE_THINKING_PROVIDER = [ const NOT_SUPPORT_QWEN3_ENABLE_THINKING_PROVIDER = [
'ollama', 'ollama',
'lmstudio', 'lmstudio',
'nvidia' 'nvidia',
'gpustack'
] as const satisfies SystemProviderId[] ] as const satisfies SystemProviderId[]
/** /**