File tree 4 files changed +17
-11
lines changed
4 files changed +17
-11
lines changed Original file line number Diff line number Diff line change @@ -147,7 +147,7 @@ export class LocalDB extends Dexie {
147
147
148
148
upgradeToV8 = async ( trans : Transaction ) => {
149
149
const users = trans . table ( 'users' ) ;
150
- users . toCollection ( ) . modify ( ( user : DB_User ) => {
150
+ await users . toCollection ( ) . modify ( ( user : DB_User ) => {
151
151
if ( user . settings ) {
152
152
user . settings = MigrationLLMSettings . migrateSettings ( user . settings as any ) ;
153
153
}
Original file line number Diff line number Diff line change @@ -33,17 +33,23 @@ export class MigrationV3ToV4 implements Migration {
33
33
languageModel : {
34
34
...res ,
35
35
azure,
36
- ollama : this . migrateProvider ( ollama ) ,
36
+ ollama : ollama && this . migrateProvider ( ollama ) ,
37
37
openai,
38
- openrouter : this . migrateProvider ( openrouter ) ,
39
- togetherai : this . migrateProvider ( togetherai ) ,
38
+ openrouter : openrouter && this . migrateProvider ( openrouter ) ,
39
+ togetherai : togetherai && this . migrateProvider ( togetherai ) ,
40
40
} ,
41
41
} ;
42
42
} ;
43
43
44
44
static migrateOpenAI = (
45
- openai : V3OpenAIConfig ,
45
+ openai ? : V3OpenAIConfig ,
46
46
) : { azure : V4AzureOpenAIConfig ; openai : V4ProviderConfig } => {
47
+ if ( ! openai )
48
+ return {
49
+ azure : { apiKey : '' , enabled : false } ,
50
+ openai : { apiKey : '' , enabled : true } ,
51
+ } ;
52
+
47
53
if ( openai . useAzure ) {
48
54
return {
49
55
azure : {
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ export interface V3Settings {
44
44
defaultAgent : any ;
45
45
fontSize : number ;
46
46
language : string ;
47
- languageModel : V3LLMConfig ;
47
+ languageModel ?: Partial < V3LLMConfig > ;
48
48
neutralColor ?: string ;
49
49
password : string ;
50
50
primaryColor ?: string ;
Original file line number Diff line number Diff line change @@ -17,12 +17,12 @@ export interface V4AzureOpenAIConfig extends V4ProviderConfig {
17
17
}
18
18
19
19
export interface V4lLLMConfig
20
- extends Omit < V3LLMConfig , 'ollama' | 'openAI' | 'openrouter' | 'togetherai' > {
21
- azure : V4AzureOpenAIConfig ;
22
- ollama : V4ProviderConfig ;
20
+ extends Omit < Partial < V3LLMConfig > , 'ollama' | 'openAI' | 'openrouter' | 'togetherai' > {
21
+ azure ? : V4AzureOpenAIConfig ;
22
+ ollama ? : V4ProviderConfig ;
23
23
openai : V4ProviderConfig ;
24
- openrouter : V4ProviderConfig ;
25
- togetherai : V4ProviderConfig ;
24
+ openrouter ? : V4ProviderConfig ;
25
+ togetherai ? : V4ProviderConfig ;
26
26
}
27
27
28
28
/**
You can’t perform that action at this time.
0 commit comments