Skip to content

Commit 199ded2

Browse files
committed
🗃️ refactor: add migrations from v3 to v4
1 parent f9fc373 commit 199ded2

16 files changed

+495
-142
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
{
2+
"exportType": "settings",
3+
"state": {
4+
"settings": {
5+
"defaultAgent": {
6+
"config": {
7+
"autoCreateTopicThreshold": 2,
8+
"displayMode": "chat",
9+
"enableAutoCreateTopic": true,
10+
"historyCount": 1,
11+
"model": "gpt-4-vision-preview",
12+
"params": {
13+
"frequency_penalty": 0,
14+
"presence_penalty": 0,
15+
"temperature": 0.6,
16+
"top_p": 1
17+
},
18+
"plugins": ["realtime-weather", "steam"],
19+
"provider": "openai",
20+
"systemRole": "",
21+
"tts": {
22+
"showAllLocaleVoice": false,
23+
"sttLocale": "auto",
24+
"ttsService": "openai",
25+
"voice": { "openai": "alloy" }
26+
}
27+
},
28+
"meta": {}
29+
},
30+
"languageModel": {
31+
"anthropic": { "apiKey": "", "enabled": false },
32+
"azure": {
33+
"apiKey": "asbdasd",
34+
"apiVersion": "2024-02-15-preview",
35+
"enabled": true,
36+
"endpoint": "https://api.chatanywhere.com.cn"
37+
},
38+
"bedrock": {
39+
"accessKeyId": "",
40+
"enabled": false,
41+
"region": "us-east-1",
42+
"secretAccessKey": ""
43+
},
44+
"google": { "apiKey": "", "enabled": false },
45+
"groq": { "apiKey": "", "enabled": false },
46+
"mistral": { "apiKey": "", "enabled": false },
47+
"moonshot": { "apiKey": "", "enabled": false },
48+
"ollama": { "enabled": false, "endpoint": "" },
49+
"openrouter": { "apiKey": "", "enabled": false },
50+
"perplexity": { "apiKey": "", "enabled": false },
51+
"togetherai": { "apiKey": "", "enabled": false },
52+
"zeroone": { "apiKey": "", "enabled": false },
53+
"zhipu": { "apiKey": "", "enabled": false },
54+
"openai": {
55+
"apiKey": "",
56+
"endpoint": "",
57+
"enabled": true
58+
}
59+
},
60+
"sync": { "webrtc": { "enabled": false } },
61+
"tool": { "dalle": { "autoGenerate": false } },
62+
"tts": {
63+
"openAI": { "sttModel": "whisper-1", "ttsModel": "tts-1" },
64+
"sttAutoStop": true,
65+
"sttServer": "openai"
66+
},
67+
"fontSize": 14,
68+
"language": "auto",
69+
"themeMode": "auto",
70+
"primaryColor": "",
71+
"neutralColor": ""
72+
}
73+
},
74+
"version": 4
75+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
{
2+
"exportType": "settings",
3+
"state": {
4+
"settings": {
5+
"defaultAgent": {
6+
"config": {
7+
"autoCreateTopicThreshold": 2,
8+
"displayMode": "chat",
9+
"enableAutoCreateTopic": true,
10+
"historyCount": 1,
11+
"model": "gpt-4-vision-preview",
12+
"params": {
13+
"frequency_penalty": 0,
14+
"presence_penalty": 0,
15+
"temperature": 0.6,
16+
"top_p": 1
17+
},
18+
"plugins": ["realtime-weather", "steam"],
19+
"provider": "openai",
20+
"systemRole": "",
21+
"tts": {
22+
"showAllLocaleVoice": false,
23+
"sttLocale": "auto",
24+
"ttsService": "openai",
25+
"voice": { "openai": "alloy" }
26+
}
27+
},
28+
"meta": {}
29+
},
30+
"languageModel": {
31+
"anthropic": { "apiKey": "", "enabled": false },
32+
"azure": { "apiKey": "", "deployments": "", "enabled": false, "endpoint": "" },
33+
"bedrock": {
34+
"accessKeyId": "",
35+
"enabled": false,
36+
"region": "us-east-1",
37+
"secretAccessKey": ""
38+
},
39+
"google": { "apiKey": "", "enabled": false },
40+
"groq": { "apiKey": "", "enabled": false },
41+
"mistral": { "apiKey": "", "enabled": false },
42+
"moonshot": { "apiKey": "", "enabled": false },
43+
"ollama": {
44+
"enabled": false,
45+
"endpoint": "",
46+
"customModelName": "-all,+llava"
47+
},
48+
"openAI": {
49+
"OPENAI_API_KEY": "",
50+
"enabled": true,
51+
"models": [],
52+
"endpoint": "",
53+
"customModelName": "",
54+
"useAzure": false
55+
},
56+
"openrouter": {
57+
"apiKey": "",
58+
"enabled": true
59+
},
60+
"perplexity": { "apiKey": "", "enabled": false },
61+
"togetherai": { "apiKey": "", "enabled": false },
62+
"zeroone": { "apiKey": "", "enabled": false },
63+
"zhipu": { "apiKey": "", "enabled": false },
64+
"openai": {
65+
"OPENAI_API_KEY": "",
66+
"models": ["gpt-3.5-turbo", "gpt-3.5-turbo-16k", "gpt-4"],
67+
"endpoint": ""
68+
}
69+
},
70+
"sync": { "webrtc": { "enabled": false } },
71+
"tool": { "dalle": { "autoGenerate": false } },
72+
"tts": {
73+
"openAI": { "sttModel": "whisper-1", "ttsModel": "tts-1" },
74+
"sttAutoStop": true,
75+
"sttServer": "openai"
76+
},
77+
"fontSize": 14,
78+
"language": "auto",
79+
"themeMode": "auto",
80+
"primaryColor": "",
81+
"neutralColor": ""
82+
}
83+
},
84+
"version": 3
85+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
{
2+
"exportType": "settings",
3+
"state": {
4+
"settings": {
5+
"defaultAgent": {
6+
"config": {
7+
"autoCreateTopicThreshold": 2,
8+
"displayMode": "chat",
9+
"enableAutoCreateTopic": true,
10+
"historyCount": 1,
11+
"model": "gpt-4-vision-preview",
12+
"params": {
13+
"frequency_penalty": 0,
14+
"presence_penalty": 0,
15+
"temperature": 0.6,
16+
"top_p": 1
17+
},
18+
"plugins": ["realtime-weather", "steam"],
19+
"provider": "openai",
20+
"systemRole": "",
21+
"tts": {
22+
"showAllLocaleVoice": false,
23+
"sttLocale": "auto",
24+
"ttsService": "openai",
25+
"voice": { "openai": "alloy" }
26+
}
27+
},
28+
"meta": {}
29+
},
30+
"languageModel": {
31+
"anthropic": { "apiKey": "", "enabled": false },
32+
"azure": { "apiKey": "", "enabled": false, "endpoint": "" },
33+
"bedrock": {
34+
"accessKeyId": "",
35+
"enabled": false,
36+
"region": "us-east-1",
37+
"secretAccessKey": ""
38+
},
39+
"google": { "apiKey": "", "enabled": false },
40+
"groq": { "apiKey": "", "enabled": false },
41+
"mistral": { "apiKey": "", "enabled": false },
42+
"moonshot": { "apiKey": "", "enabled": false },
43+
"ollama": {
44+
"enabled": false,
45+
"endpoint": "",
46+
"customModelCards": [
47+
{
48+
"displayName": "LLaVA 7B",
49+
"enabled": true,
50+
"functionCall": false,
51+
"id": "llava",
52+
"tokens": 4000,
53+
"vision": true
54+
}
55+
]
56+
},
57+
"openrouter": {
58+
"apiKey": "",
59+
"enabled": true
60+
},
61+
"perplexity": { "apiKey": "", "enabled": false },
62+
"togetherai": { "apiKey": "", "enabled": false },
63+
"zeroone": { "apiKey": "", "enabled": false },
64+
"zhipu": { "apiKey": "", "enabled": false },
65+
"openai": {
66+
"apiKey": "",
67+
"enabled": true,
68+
"endpoint": ""
69+
}
70+
},
71+
"sync": { "webrtc": { "enabled": false } },
72+
"tool": { "dalle": { "autoGenerate": false } },
73+
"tts": {
74+
"openAI": { "sttModel": "whisper-1", "ttsModel": "tts-1" },
75+
"sttAutoStop": true,
76+
"sttServer": "openai"
77+
},
78+
"fontSize": 14,
79+
"language": "auto",
80+
"themeMode": "auto",
81+
"primaryColor": "",
82+
"neutralColor": ""
83+
}
84+
},
85+
"version": 4
86+
}

src/migrations/FromV3ToV4/fixtures/openai-output-v4.json

+9-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,15 @@
5050
"enabled": true,
5151
"apiKey": "asbdasd",
5252
"endpoint": "https://api.chatanywhere.com.cn",
53-
"customModelName": "deerercsds"
53+
"customModelCards": [
54+
{
55+
"displayName": "deerercsds",
56+
"enabled": true,
57+
"functionCall": true,
58+
"id": "deerercsds",
59+
"vision": true
60+
}
61+
]
5462
}
5563
},
5664
"sync": { "webrtc": { "enabled": false } },

src/migrations/FromV3ToV4/fixtures/input-v3-open-router.json renamed to src/migrations/FromV3ToV4/fixtures/openrouter-input-v3.json

+7-4
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,18 @@
4242
"moonshot": { "apiKey": "", "enabled": false },
4343
"ollama": { "enabled": false, "endpoint": "" },
4444
"openAI": {
45-
"OPENAI_API_KEY": "asbdasd",
45+
"OPENAI_API_KEY": "",
4646
"enabled": true,
4747
"models": [],
4848
"endpoint": "",
4949
"customModelName": "",
50-
"useAzure": false,
51-
"azureApiVersion": "2024-02-15-preview"
50+
"useAzure": false
51+
},
52+
"openrouter": {
53+
"apiKey": "",
54+
"enabled": true,
55+
"customModelName": "-all,+01-ai/yi-34b-chat,+huggingfaceh4/zephyr-7b-beta"
5256
},
53-
"openrouter": { "apiKey": "", "enabled": true, "customModelName": "cohere/command-r-plus" },
5457
"perplexity": { "apiKey": "", "enabled": false },
5558
"togetherai": { "apiKey": "", "enabled": false },
5659
"zeroone": { "apiKey": "", "enabled": false },
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
{
2+
"exportType": "settings",
3+
"state": {
4+
"settings": {
5+
"defaultAgent": {
6+
"config": {
7+
"autoCreateTopicThreshold": 2,
8+
"displayMode": "chat",
9+
"enableAutoCreateTopic": true,
10+
"historyCount": 1,
11+
"model": "gpt-4-vision-preview",
12+
"params": {
13+
"frequency_penalty": 0,
14+
"presence_penalty": 0,
15+
"temperature": 0.6,
16+
"top_p": 1
17+
},
18+
"plugins": ["realtime-weather", "steam"],
19+
"provider": "openai",
20+
"systemRole": "",
21+
"tts": {
22+
"showAllLocaleVoice": false,
23+
"sttLocale": "auto",
24+
"ttsService": "openai",
25+
"voice": { "openai": "alloy" }
26+
}
27+
},
28+
"meta": {}
29+
},
30+
"languageModel": {
31+
"anthropic": { "apiKey": "", "enabled": false },
32+
"azure": { "apiKey": "", "enabled": false, "endpoint": "" },
33+
"bedrock": {
34+
"accessKeyId": "",
35+
"enabled": false,
36+
"region": "us-east-1",
37+
"secretAccessKey": ""
38+
},
39+
"google": { "apiKey": "", "enabled": false },
40+
"groq": { "apiKey": "", "enabled": false },
41+
"mistral": { "apiKey": "", "enabled": false },
42+
"moonshot": { "apiKey": "", "enabled": false },
43+
"ollama": { "enabled": false, "endpoint": "" },
44+
"openrouter": {
45+
"apiKey": "",
46+
"enabled": true,
47+
"customModelCards": [
48+
{
49+
"displayName": "01-ai/yi-34b-chat",
50+
"enabled": true,
51+
"functionCall": true,
52+
"id": "01-ai/yi-34b-chat",
53+
"vision": true
54+
},
55+
{
56+
"displayName": "huggingfaceh4/zephyr-7b-beta",
57+
"enabled": true,
58+
"functionCall": true,
59+
"id": "huggingfaceh4/zephyr-7b-beta",
60+
"vision": true
61+
}
62+
]
63+
},
64+
"perplexity": { "apiKey": "", "enabled": false },
65+
"togetherai": { "apiKey": "", "enabled": false },
66+
"zeroone": { "apiKey": "", "enabled": false },
67+
"zhipu": { "apiKey": "", "enabled": false },
68+
"openai": {
69+
"apiKey": "",
70+
"enabled": true,
71+
"endpoint": ""
72+
}
73+
},
74+
"sync": { "webrtc": { "enabled": false } },
75+
"tool": { "dalle": { "autoGenerate": false } },
76+
"tts": {
77+
"openAI": { "sttModel": "whisper-1", "ttsModel": "tts-1" },
78+
"sttAutoStop": true,
79+
"sttServer": "openai"
80+
},
81+
"fontSize": 14,
82+
"language": "auto",
83+
"themeMode": "auto",
84+
"primaryColor": "",
85+
"neutralColor": ""
86+
}
87+
},
88+
"version": 4
89+
}

src/migrations/FromV3ToV4/fixtures/output-v3-from-v1.json renamed to src/migrations/FromV3ToV4/fixtures/output-v4-from-v1.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -199,5 +199,5 @@
199199
}
200200
]
201201
},
202-
"version": 3
202+
"version": 4
203203
}

0 commit comments

Comments
 (0)