Skip to content

Commit

Permalink
🗃️ refactor: add migrations from v3 to v4
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed Apr 10, 2024
1 parent f9fc373 commit 199ded2
Show file tree
Hide file tree
Showing 16 changed files with 495 additions and 142 deletions.
75 changes: 75 additions & 0 deletions src/migrations/FromV3ToV4/fixtures/azure-output-v4.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"exportType": "settings",
"state": {
"settings": {
"defaultAgent": {
"config": {
"autoCreateTopicThreshold": 2,
"displayMode": "chat",
"enableAutoCreateTopic": true,
"historyCount": 1,
"model": "gpt-4-vision-preview",
"params": {
"frequency_penalty": 0,
"presence_penalty": 0,
"temperature": 0.6,
"top_p": 1
},
"plugins": ["realtime-weather", "steam"],
"provider": "openai",
"systemRole": "",
"tts": {
"showAllLocaleVoice": false,
"sttLocale": "auto",
"ttsService": "openai",
"voice": { "openai": "alloy" }
}
},
"meta": {}
},
"languageModel": {
"anthropic": { "apiKey": "", "enabled": false },
"azure": {
"apiKey": "asbdasd",
"apiVersion": "2024-02-15-preview",
"enabled": true,
"endpoint": "https://api.chatanywhere.com.cn"
},
"bedrock": {
"accessKeyId": "",
"enabled": false,
"region": "us-east-1",
"secretAccessKey": ""
},
"google": { "apiKey": "", "enabled": false },
"groq": { "apiKey": "", "enabled": false },
"mistral": { "apiKey": "", "enabled": false },
"moonshot": { "apiKey": "", "enabled": false },
"ollama": { "enabled": false, "endpoint": "" },
"openrouter": { "apiKey": "", "enabled": false },
"perplexity": { "apiKey": "", "enabled": false },
"togetherai": { "apiKey": "", "enabled": false },
"zeroone": { "apiKey": "", "enabled": false },
"zhipu": { "apiKey": "", "enabled": false },
"openai": {
"apiKey": "",
"endpoint": "",
"enabled": true
}
},
"sync": { "webrtc": { "enabled": false } },
"tool": { "dalle": { "autoGenerate": false } },
"tts": {
"openAI": { "sttModel": "whisper-1", "ttsModel": "tts-1" },
"sttAutoStop": true,
"sttServer": "openai"
},
"fontSize": 14,
"language": "auto",
"themeMode": "auto",
"primaryColor": "",
"neutralColor": ""
}
},
"version": 4
}
85 changes: 85 additions & 0 deletions src/migrations/FromV3ToV4/fixtures/ollama-input-v3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"exportType": "settings",
"state": {
"settings": {
"defaultAgent": {
"config": {
"autoCreateTopicThreshold": 2,
"displayMode": "chat",
"enableAutoCreateTopic": true,
"historyCount": 1,
"model": "gpt-4-vision-preview",
"params": {
"frequency_penalty": 0,
"presence_penalty": 0,
"temperature": 0.6,
"top_p": 1
},
"plugins": ["realtime-weather", "steam"],
"provider": "openai",
"systemRole": "",
"tts": {
"showAllLocaleVoice": false,
"sttLocale": "auto",
"ttsService": "openai",
"voice": { "openai": "alloy" }
}
},
"meta": {}
},
"languageModel": {
"anthropic": { "apiKey": "", "enabled": false },
"azure": { "apiKey": "", "deployments": "", "enabled": false, "endpoint": "" },
"bedrock": {
"accessKeyId": "",
"enabled": false,
"region": "us-east-1",
"secretAccessKey": ""
},
"google": { "apiKey": "", "enabled": false },
"groq": { "apiKey": "", "enabled": false },
"mistral": { "apiKey": "", "enabled": false },
"moonshot": { "apiKey": "", "enabled": false },
"ollama": {
"enabled": false,
"endpoint": "",
"customModelName": "-all,+llava"
},
"openAI": {
"OPENAI_API_KEY": "",
"enabled": true,
"models": [],
"endpoint": "",
"customModelName": "",
"useAzure": false
},
"openrouter": {
"apiKey": "",
"enabled": true
},
"perplexity": { "apiKey": "", "enabled": false },
"togetherai": { "apiKey": "", "enabled": false },
"zeroone": { "apiKey": "", "enabled": false },
"zhipu": { "apiKey": "", "enabled": false },
"openai": {
"OPENAI_API_KEY": "",
"models": ["gpt-3.5-turbo", "gpt-3.5-turbo-16k", "gpt-4"],
"endpoint": ""
}
},
"sync": { "webrtc": { "enabled": false } },
"tool": { "dalle": { "autoGenerate": false } },
"tts": {
"openAI": { "sttModel": "whisper-1", "ttsModel": "tts-1" },
"sttAutoStop": true,
"sttServer": "openai"
},
"fontSize": 14,
"language": "auto",
"themeMode": "auto",
"primaryColor": "",
"neutralColor": ""
}
},
"version": 3
}
86 changes: 86 additions & 0 deletions src/migrations/FromV3ToV4/fixtures/ollama-output-v4.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{
"exportType": "settings",
"state": {
"settings": {
"defaultAgent": {
"config": {
"autoCreateTopicThreshold": 2,
"displayMode": "chat",
"enableAutoCreateTopic": true,
"historyCount": 1,
"model": "gpt-4-vision-preview",
"params": {
"frequency_penalty": 0,
"presence_penalty": 0,
"temperature": 0.6,
"top_p": 1
},
"plugins": ["realtime-weather", "steam"],
"provider": "openai",
"systemRole": "",
"tts": {
"showAllLocaleVoice": false,
"sttLocale": "auto",
"ttsService": "openai",
"voice": { "openai": "alloy" }
}
},
"meta": {}
},
"languageModel": {
"anthropic": { "apiKey": "", "enabled": false },
"azure": { "apiKey": "", "enabled": false, "endpoint": "" },
"bedrock": {
"accessKeyId": "",
"enabled": false,
"region": "us-east-1",
"secretAccessKey": ""
},
"google": { "apiKey": "", "enabled": false },
"groq": { "apiKey": "", "enabled": false },
"mistral": { "apiKey": "", "enabled": false },
"moonshot": { "apiKey": "", "enabled": false },
"ollama": {
"enabled": false,
"endpoint": "",
"customModelCards": [
{
"displayName": "LLaVA 7B",
"enabled": true,
"functionCall": false,
"id": "llava",
"tokens": 4000,
"vision": true
}
]
},
"openrouter": {
"apiKey": "",
"enabled": true
},
"perplexity": { "apiKey": "", "enabled": false },
"togetherai": { "apiKey": "", "enabled": false },
"zeroone": { "apiKey": "", "enabled": false },
"zhipu": { "apiKey": "", "enabled": false },
"openai": {
"apiKey": "",
"enabled": true,
"endpoint": ""
}
},
"sync": { "webrtc": { "enabled": false } },
"tool": { "dalle": { "autoGenerate": false } },
"tts": {
"openAI": { "sttModel": "whisper-1", "ttsModel": "tts-1" },
"sttAutoStop": true,
"sttServer": "openai"
},
"fontSize": 14,
"language": "auto",
"themeMode": "auto",
"primaryColor": "",
"neutralColor": ""
}
},
"version": 4
}
10 changes: 9 additions & 1 deletion src/migrations/FromV3ToV4/fixtures/openai-output-v4.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,15 @@
"enabled": true,
"apiKey": "asbdasd",
"endpoint": "https://api.chatanywhere.com.cn",
"customModelName": "deerercsds"
"customModelCards": [
{
"displayName": "deerercsds",
"enabled": true,
"functionCall": true,
"id": "deerercsds",
"vision": true
}
]
}
},
"sync": { "webrtc": { "enabled": false } },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,18 @@
"moonshot": { "apiKey": "", "enabled": false },
"ollama": { "enabled": false, "endpoint": "" },
"openAI": {
"OPENAI_API_KEY": "asbdasd",
"OPENAI_API_KEY": "",
"enabled": true,
"models": [],
"endpoint": "",
"customModelName": "",
"useAzure": false,
"azureApiVersion": "2024-02-15-preview"
"useAzure": false
},
"openrouter": {
"apiKey": "",
"enabled": true,
"customModelName": "-all,+01-ai/yi-34b-chat,+huggingfaceh4/zephyr-7b-beta"
},
"openrouter": { "apiKey": "", "enabled": true, "customModelName": "cohere/command-r-plus" },
"perplexity": { "apiKey": "", "enabled": false },
"togetherai": { "apiKey": "", "enabled": false },
"zeroone": { "apiKey": "", "enabled": false },
Expand Down
89 changes: 89 additions & 0 deletions src/migrations/FromV3ToV4/fixtures/openrouter-output-v4.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
"exportType": "settings",
"state": {
"settings": {
"defaultAgent": {
"config": {
"autoCreateTopicThreshold": 2,
"displayMode": "chat",
"enableAutoCreateTopic": true,
"historyCount": 1,
"model": "gpt-4-vision-preview",
"params": {
"frequency_penalty": 0,
"presence_penalty": 0,
"temperature": 0.6,
"top_p": 1
},
"plugins": ["realtime-weather", "steam"],
"provider": "openai",
"systemRole": "",
"tts": {
"showAllLocaleVoice": false,
"sttLocale": "auto",
"ttsService": "openai",
"voice": { "openai": "alloy" }
}
},
"meta": {}
},
"languageModel": {
"anthropic": { "apiKey": "", "enabled": false },
"azure": { "apiKey": "", "enabled": false, "endpoint": "" },
"bedrock": {
"accessKeyId": "",
"enabled": false,
"region": "us-east-1",
"secretAccessKey": ""
},
"google": { "apiKey": "", "enabled": false },
"groq": { "apiKey": "", "enabled": false },
"mistral": { "apiKey": "", "enabled": false },
"moonshot": { "apiKey": "", "enabled": false },
"ollama": { "enabled": false, "endpoint": "" },
"openrouter": {
"apiKey": "",
"enabled": true,
"customModelCards": [
{
"displayName": "01-ai/yi-34b-chat",
"enabled": true,
"functionCall": true,
"id": "01-ai/yi-34b-chat",
"vision": true
},
{
"displayName": "huggingfaceh4/zephyr-7b-beta",
"enabled": true,
"functionCall": true,
"id": "huggingfaceh4/zephyr-7b-beta",
"vision": true
}
]
},
"perplexity": { "apiKey": "", "enabled": false },
"togetherai": { "apiKey": "", "enabled": false },
"zeroone": { "apiKey": "", "enabled": false },
"zhipu": { "apiKey": "", "enabled": false },
"openai": {
"apiKey": "",
"enabled": true,
"endpoint": ""
}
},
"sync": { "webrtc": { "enabled": false } },
"tool": { "dalle": { "autoGenerate": false } },
"tts": {
"openAI": { "sttModel": "whisper-1", "ttsModel": "tts-1" },
"sttAutoStop": true,
"sttServer": "openai"
},
"fontSize": 14,
"language": "auto",
"themeMode": "auto",
"primaryColor": "",
"neutralColor": ""
}
},
"version": 4
}
Original file line number Diff line number Diff line change
Expand Up @@ -199,5 +199,5 @@
}
]
},
"version": 3
"version": 4
}
Loading

0 comments on commit 199ded2

Please sign in to comment.