fix: test & build error

This commit is contained in:
duanfuxiang 2025-06-12 16:20:08 +08:00
parent d16207e3c5
commit 896acd09e0
5 changed files with 18 additions and 14 deletions

View File

@ -49,7 +49,8 @@ export class OpenAIMessageAdapter {
async streamResponse(
client: OpenAI,
request: LLMRequestStreaming,
options?: LLMOptions,
options?: LLMOptions,
extraParams?: Record<string, any>,
): Promise<AsyncIterable<LLMResponseStreaming>> {
const stream = await client.chat.completions.create(
{
@ -66,7 +67,8 @@ export class OpenAIMessageAdapter {
stream: true,
stream_options: {
include_usage: true,
},
},
...extraParams,
},
{
signal: options?.signal,

View File

@ -68,7 +68,7 @@ export function t(str: string, params?: Record<string, any>): any {
}
const path = str.split('.');
let result = locale || en;
let result: any = locale || en;
for (const key of path) {
result = result[key] || (en && en[key]);

View File

@ -397,7 +397,7 @@ const CustomProviderSettings: React.FC<CustomProviderSettingsProps> = ({ plugin,
{/* 模型选择区域 */}
<div className="model-selection-section">
<div className="model-selection-header">
<h2 className="section-title">{t("settings.ModelProvider.modelSelection")}</h2>
<h2 className="section-title">{t("settings.ModelProvider.modelSelection")}:</h2>
<button
className="one-click-config-btn"
onClick={handleOneClickConfig}

View File

@ -9,6 +9,7 @@ describe('parseSmartCopilotSettings', () => {
expect(result).toEqual({
version: 0.4,
activeModels: DEFAULT_MODELS,
activeProviderTab: 'Infio',
infioApiKey: '',
openAIApiKey: '',
anthropicApiKey: '',
@ -25,13 +26,13 @@ describe('parseSmartCopilotSettings', () => {
chatModelId: '',
mcpEnabled: false,
collectedChatModels: [],
chatModelProvider: 'OpenRouter',
chatModelProvider: 'Infio',
applyModelId: '',
applyModelProvider: 'OpenRouter',
applyModelProvider: 'Infio',
embeddingModelId: '',
embeddingModelProvider: 'Google',
embeddingModelProvider: 'Infio',
experimentalDiffStrategy: false,
defaultProvider: 'OpenRouter',
defaultProvider: 'Infio',
alibabaQwenProvider: {
name: 'AlibabaQwen',
apiKey: '',
@ -196,6 +197,7 @@ describe('settings migration', () => {
expect(result).toEqual({
version: 0.4,
activeModels: DEFAULT_MODELS,
activeProviderTab: 'Infio',
infioApiKey: '',
openAIApiKey: '',
anthropicApiKey: '',
@ -212,13 +214,13 @@ describe('settings migration', () => {
collectedChatModels: [],
chatModelId: '',
mcpEnabled: false,
chatModelProvider: 'OpenRouter',
chatModelProvider: 'Infio',
applyModelId: '',
applyModelProvider: 'OpenRouter',
applyModelProvider: 'Infio',
embeddingModelId: '',
embeddingModelProvider: 'Google',
embeddingModelProvider: 'Infio',
experimentalDiffStrategy: false,
defaultProvider: 'OpenRouter',
defaultProvider: 'Infio',
alibabaQwenProvider: {
name: 'AlibabaQwen',
apiKey: '',

View File

@ -203,12 +203,12 @@ export const triggerSchema = z.object({
const FilesSearchSettingsSchema = z.object({
method: z.enum(['match', 'regex', 'semantic', 'auto']).catch('auto'),
regexBackend: z.enum(['coreplugin', 'ripgrep']).catch('ripgrep'),
regexBackend: z.enum(['coreplugin', 'ripgrep']).catch('coreplugin'),
matchBackend: z.enum(['omnisearch', 'coreplugin']).catch('coreplugin'),
ripgrepPath: z.string().catch(''),
}).catch({
method: 'auto',
regexBackend: 'ripgrep',
regexBackend: 'coreplugin',
matchBackend: 'coreplugin',
ripgrepPath: '',
});