mirror of
https://github.com/EthanMarti/infio-copilot.git
synced 2026-01-16 16:31:56 +00:00
update settings test
This commit is contained in:
parent
208e14f8e8
commit
2363e964ad
@ -5,7 +5,33 @@ import { parseInfioSettings } from './settings'
|
|||||||
|
|
||||||
describe('parseSmartCopilotSettings', () => {
|
describe('parseSmartCopilotSettings', () => {
|
||||||
it('should return default values for empty input', () => {
|
it('should return default values for empty input', () => {
|
||||||
const result = parseInfioSettings({})
|
const result = parseInfioSettings({
|
||||||
|
autocompleteEnabled: true,
|
||||||
|
advancedMode: false,
|
||||||
|
apiProvider: 'openai',
|
||||||
|
triggers: DEFAULT_SETTINGS.triggers,
|
||||||
|
delay: 500,
|
||||||
|
modelOptions: {
|
||||||
|
temperature: 1,
|
||||||
|
top_p: 0.1,
|
||||||
|
frequency_penalty: 0.25,
|
||||||
|
presence_penalty: 0,
|
||||||
|
max_tokens: 800,
|
||||||
|
},
|
||||||
|
systemMessage: DEFAULT_SETTINGS.systemMessage,
|
||||||
|
fewShotExamples: DEFAULT_SETTINGS.fewShotExamples,
|
||||||
|
userMessageTemplate: '{{prefix}}<mask/>{{suffix}}',
|
||||||
|
chainOfThoughRemovalRegex: '(.|\\n)*ANSWER:',
|
||||||
|
dontIncludeDataviews: true,
|
||||||
|
maxPrefixCharLimit: 4000,
|
||||||
|
maxSuffixCharLimit: 4000,
|
||||||
|
removeDuplicateMathBlockIndicator: true,
|
||||||
|
removeDuplicateCodeBlockIndicator: true,
|
||||||
|
ignoredFilePatterns: '**/secret/**\n',
|
||||||
|
ignoredTags: '',
|
||||||
|
cacheSuggestions: true,
|
||||||
|
debugMode: false,
|
||||||
|
})
|
||||||
expect(result).toEqual({
|
expect(result).toEqual({
|
||||||
version: 0.4,
|
version: 0.4,
|
||||||
activeModels: DEFAULT_MODELS,
|
activeModels: DEFAULT_MODELS,
|
||||||
@ -191,6 +217,31 @@ describe('settings migration', () => {
|
|||||||
minSimilarity: 0.0,
|
minSimilarity: 0.0,
|
||||||
limit: 10,
|
limit: 10,
|
||||||
},
|
},
|
||||||
|
autocompleteEnabled: true,
|
||||||
|
advancedMode: false,
|
||||||
|
apiProvider: 'openai',
|
||||||
|
triggers: DEFAULT_SETTINGS.triggers,
|
||||||
|
delay: 500,
|
||||||
|
modelOptions: {
|
||||||
|
temperature: 1,
|
||||||
|
top_p: 0.1,
|
||||||
|
frequency_penalty: 0.25,
|
||||||
|
presence_penalty: 0,
|
||||||
|
max_tokens: 800,
|
||||||
|
},
|
||||||
|
systemMessage: DEFAULT_SETTINGS.systemMessage,
|
||||||
|
fewShotExamples: DEFAULT_SETTINGS.fewShotExamples,
|
||||||
|
userMessageTemplate: '{{prefix}}<mask/>{{suffix}}',
|
||||||
|
chainOfThoughRemovalRegex: '(.|\\n)*ANSWER:',
|
||||||
|
dontIncludeDataviews: true,
|
||||||
|
maxPrefixCharLimit: 4000,
|
||||||
|
maxSuffixCharLimit: 4000,
|
||||||
|
removeDuplicateMathBlockIndicator: true,
|
||||||
|
removeDuplicateCodeBlockIndicator: true,
|
||||||
|
ignoredFilePatterns: '**/secret/**\n',
|
||||||
|
ignoredTags: '',
|
||||||
|
cacheSuggestions: true,
|
||||||
|
debugMode: false,
|
||||||
}
|
}
|
||||||
|
|
||||||
const result = parseInfioSettings(oldSettings)
|
const result = parseInfioSettings(oldSettings)
|
||||||
@ -199,8 +250,8 @@ describe('settings migration', () => {
|
|||||||
activeModels: DEFAULT_MODELS,
|
activeModels: DEFAULT_MODELS,
|
||||||
activeProviderTab: 'Infio',
|
activeProviderTab: 'Infio',
|
||||||
infioApiKey: '',
|
infioApiKey: '',
|
||||||
openAIApiKey: '',
|
openAIApiKey: 'openai-api-key',
|
||||||
anthropicApiKey: '',
|
anthropicApiKey: 'anthropic-api-key',
|
||||||
filesSearchSettings: {
|
filesSearchSettings: {
|
||||||
method: 'auto',
|
method: 'auto',
|
||||||
regexBackend: 'coreplugin',
|
regexBackend: 'coreplugin',
|
||||||
@ -209,7 +260,7 @@ describe('settings migration', () => {
|
|||||||
},
|
},
|
||||||
fuzzyMatchThreshold: 0.85,
|
fuzzyMatchThreshold: 0.85,
|
||||||
geminiApiKey: '',
|
geminiApiKey: '',
|
||||||
groqApiKey: '',
|
groqApiKey: 'groq-api-key',
|
||||||
deepseekApiKey: '',
|
deepseekApiKey: '',
|
||||||
collectedChatModels: [],
|
collectedChatModels: [],
|
||||||
chatModelId: '',
|
chatModelId: '',
|
||||||
@ -255,7 +306,7 @@ describe('settings migration', () => {
|
|||||||
baseUrl: '',
|
baseUrl: '',
|
||||||
model: '',
|
model: '',
|
||||||
},
|
},
|
||||||
systemPrompt: '',
|
systemPrompt: 'system prompt',
|
||||||
ragOptions: {
|
ragOptions: {
|
||||||
chunkSize: 1000,
|
chunkSize: 1000,
|
||||||
thresholdTokens: 8192,
|
thresholdTokens: 8192,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user