mirror of
https://github.com/EthanMarti/infio-copilot.git
synced 2026-01-16 16:31:56 +00:00
fix: test & build error
This commit is contained in:
parent
d16207e3c5
commit
896acd09e0
@ -49,7 +49,8 @@ export class OpenAIMessageAdapter {
|
|||||||
async streamResponse(
|
async streamResponse(
|
||||||
client: OpenAI,
|
client: OpenAI,
|
||||||
request: LLMRequestStreaming,
|
request: LLMRequestStreaming,
|
||||||
options?: LLMOptions,
|
options?: LLMOptions,
|
||||||
|
extraParams?: Record<string, any>,
|
||||||
): Promise<AsyncIterable<LLMResponseStreaming>> {
|
): Promise<AsyncIterable<LLMResponseStreaming>> {
|
||||||
const stream = await client.chat.completions.create(
|
const stream = await client.chat.completions.create(
|
||||||
{
|
{
|
||||||
@ -66,7 +67,8 @@ export class OpenAIMessageAdapter {
|
|||||||
stream: true,
|
stream: true,
|
||||||
stream_options: {
|
stream_options: {
|
||||||
include_usage: true,
|
include_usage: true,
|
||||||
},
|
},
|
||||||
|
...extraParams,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
signal: options?.signal,
|
signal: options?.signal,
|
||||||
|
|||||||
@ -68,7 +68,7 @@ export function t(str: string, params?: Record<string, any>): any {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const path = str.split('.');
|
const path = str.split('.');
|
||||||
let result = locale || en;
|
let result: any = locale || en;
|
||||||
|
|
||||||
for (const key of path) {
|
for (const key of path) {
|
||||||
result = result[key] || (en && en[key]);
|
result = result[key] || (en && en[key]);
|
||||||
|
|||||||
@ -397,7 +397,7 @@ const CustomProviderSettings: React.FC<CustomProviderSettingsProps> = ({ plugin,
|
|||||||
{/* 模型选择区域 */}
|
{/* 模型选择区域 */}
|
||||||
<div className="model-selection-section">
|
<div className="model-selection-section">
|
||||||
<div className="model-selection-header">
|
<div className="model-selection-header">
|
||||||
<h2 className="section-title">{t("settings.ModelProvider.modelSelection")}</h2>
|
<h2 className="section-title">{t("settings.ModelProvider.modelSelection")}:</h2>
|
||||||
<button
|
<button
|
||||||
className="one-click-config-btn"
|
className="one-click-config-btn"
|
||||||
onClick={handleOneClickConfig}
|
onClick={handleOneClickConfig}
|
||||||
|
|||||||
@ -9,6 +9,7 @@ describe('parseSmartCopilotSettings', () => {
|
|||||||
expect(result).toEqual({
|
expect(result).toEqual({
|
||||||
version: 0.4,
|
version: 0.4,
|
||||||
activeModels: DEFAULT_MODELS,
|
activeModels: DEFAULT_MODELS,
|
||||||
|
activeProviderTab: 'Infio',
|
||||||
infioApiKey: '',
|
infioApiKey: '',
|
||||||
openAIApiKey: '',
|
openAIApiKey: '',
|
||||||
anthropicApiKey: '',
|
anthropicApiKey: '',
|
||||||
@ -25,13 +26,13 @@ describe('parseSmartCopilotSettings', () => {
|
|||||||
chatModelId: '',
|
chatModelId: '',
|
||||||
mcpEnabled: false,
|
mcpEnabled: false,
|
||||||
collectedChatModels: [],
|
collectedChatModels: [],
|
||||||
chatModelProvider: 'OpenRouter',
|
chatModelProvider: 'Infio',
|
||||||
applyModelId: '',
|
applyModelId: '',
|
||||||
applyModelProvider: 'OpenRouter',
|
applyModelProvider: 'Infio',
|
||||||
embeddingModelId: '',
|
embeddingModelId: '',
|
||||||
embeddingModelProvider: 'Google',
|
embeddingModelProvider: 'Infio',
|
||||||
experimentalDiffStrategy: false,
|
experimentalDiffStrategy: false,
|
||||||
defaultProvider: 'OpenRouter',
|
defaultProvider: 'Infio',
|
||||||
alibabaQwenProvider: {
|
alibabaQwenProvider: {
|
||||||
name: 'AlibabaQwen',
|
name: 'AlibabaQwen',
|
||||||
apiKey: '',
|
apiKey: '',
|
||||||
@ -196,6 +197,7 @@ describe('settings migration', () => {
|
|||||||
expect(result).toEqual({
|
expect(result).toEqual({
|
||||||
version: 0.4,
|
version: 0.4,
|
||||||
activeModels: DEFAULT_MODELS,
|
activeModels: DEFAULT_MODELS,
|
||||||
|
activeProviderTab: 'Infio',
|
||||||
infioApiKey: '',
|
infioApiKey: '',
|
||||||
openAIApiKey: '',
|
openAIApiKey: '',
|
||||||
anthropicApiKey: '',
|
anthropicApiKey: '',
|
||||||
@ -212,13 +214,13 @@ describe('settings migration', () => {
|
|||||||
collectedChatModels: [],
|
collectedChatModels: [],
|
||||||
chatModelId: '',
|
chatModelId: '',
|
||||||
mcpEnabled: false,
|
mcpEnabled: false,
|
||||||
chatModelProvider: 'OpenRouter',
|
chatModelProvider: 'Infio',
|
||||||
applyModelId: '',
|
applyModelId: '',
|
||||||
applyModelProvider: 'OpenRouter',
|
applyModelProvider: 'Infio',
|
||||||
embeddingModelId: '',
|
embeddingModelId: '',
|
||||||
embeddingModelProvider: 'Google',
|
embeddingModelProvider: 'Infio',
|
||||||
experimentalDiffStrategy: false,
|
experimentalDiffStrategy: false,
|
||||||
defaultProvider: 'OpenRouter',
|
defaultProvider: 'Infio',
|
||||||
alibabaQwenProvider: {
|
alibabaQwenProvider: {
|
||||||
name: 'AlibabaQwen',
|
name: 'AlibabaQwen',
|
||||||
apiKey: '',
|
apiKey: '',
|
||||||
|
|||||||
@ -203,12 +203,12 @@ export const triggerSchema = z.object({
|
|||||||
|
|
||||||
const FilesSearchSettingsSchema = z.object({
|
const FilesSearchSettingsSchema = z.object({
|
||||||
method: z.enum(['match', 'regex', 'semantic', 'auto']).catch('auto'),
|
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'),
|
matchBackend: z.enum(['omnisearch', 'coreplugin']).catch('coreplugin'),
|
||||||
ripgrepPath: z.string().catch(''),
|
ripgrepPath: z.string().catch(''),
|
||||||
}).catch({
|
}).catch({
|
||||||
method: 'auto',
|
method: 'auto',
|
||||||
regexBackend: 'ripgrep',
|
regexBackend: 'coreplugin',
|
||||||
matchBackend: 'coreplugin',
|
matchBackend: 'coreplugin',
|
||||||
ripgrepPath: '',
|
ripgrepPath: '',
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user