diff --git a/src/types/settings.test.ts b/src/types/settings.test.ts new file mode 100644 index 0000000..5790425 --- /dev/null +++ b/src/types/settings.test.ts @@ -0,0 +1,22 @@ +import { parseSmartCopilotSettings } from './settings' + +describe('parseSmartCopilotSettings', () => { + it('should return default values for empty input', () => { + const result = parseSmartCopilotSettings({}) + expect(result).toEqual({ + openAIApiKey: '', + groqApiKey: '', + anthropicApiKey: '', + ollamaBaseUrl: '', + chatModel: 'claude-3-5-sonnet-latest', + applyModel: 'gpt-4o-mini', + embeddingModel: 'text-embedding-3-small', + ragOptions: { + chunkSize: 1000, + thresholdTokens: 8192, + minSimilarity: 0.0, + limit: 10, + }, + }) + }) +}) diff --git a/src/types/settings.ts b/src/types/settings.ts index 4f959b5..b774af3 100644 --- a/src/types/settings.ts +++ b/src/types/settings.ts @@ -16,6 +16,7 @@ const embeddingModelSchema = z.enum( EMBEDDING_MODEL_OPTIONS.map((opt) => opt.value) as [string, ...string[]], ) +// Update settings.test.ts after changing this schema const smartCopilotSettingsSchema = z.object({ openAIApiKey: z.string().catch(''), groqApiKey: z.string().catch(''),