File tree Expand file tree Collapse file tree 5 files changed +12
-5
lines changed Expand file tree Collapse file tree 5 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ const DANGER_CONFIG = {
14
14
disableFastLink : serverConfig . disableFastLink ,
15
15
customModels : serverConfig . customModels ,
16
16
defaultModel : serverConfig . defaultModel ,
17
+ visionModels : serverConfig . visionModels ,
17
18
} ;
18
19
19
20
declare global {
Original file line number Diff line number Diff line change @@ -40,7 +40,6 @@ export const getBuildConfig = () => {
40
40
buildMode,
41
41
isApp,
42
42
template : process . env . DEFAULT_INPUT_TEMPLATE ?? DEFAULT_INPUT_TEMPLATE ,
43
- visionModels : process . env . VISION_MODELS || "" ,
44
43
} ;
45
44
} ;
46
45
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ declare global {
23
23
DISABLE_FAST_LINK ?: string ; // disallow parse settings from url or not
24
24
CUSTOM_MODELS ?: string ; // to control custom models
25
25
DEFAULT_MODEL ?: string ; // to control default model in every new chat window
26
+ VISION_MODELS ?: string ; // to control vision models
26
27
27
28
// stability only
28
29
STABILITY_URL ?: string ;
@@ -128,6 +129,7 @@ export const getServerSideConfig = () => {
128
129
const disableGPT4 = ! ! process . env . DISABLE_GPT4 ;
129
130
let customModels = process . env . CUSTOM_MODELS ?? "" ;
130
131
let defaultModel = process . env . DEFAULT_MODEL ?? "" ;
132
+ let visionModels = process . env . VISION_MODELS ?? "" ;
131
133
132
134
if ( disableGPT4 ) {
133
135
if ( customModels ) customModels += "," ;
@@ -249,6 +251,7 @@ export const getServerSideConfig = () => {
249
251
disableFastLink : ! ! process . env . DISABLE_FAST_LINK ,
250
252
customModels,
251
253
defaultModel,
254
+ visionModels,
252
255
allowedWebDavEndpoints,
253
256
} ;
254
257
} ;
Original file line number Diff line number Diff line change @@ -131,6 +131,7 @@ const DEFAULT_ACCESS_STATE = {
131
131
disableFastLink : false ,
132
132
customModels : "" ,
133
133
defaultModel : "" ,
134
+ visionModels : "" ,
134
135
135
136
// tts config
136
137
edgeTTSVoiceName : "zh-CN-YunxiNeural" ,
@@ -145,7 +146,10 @@ export const useAccessStore = createPersistStore(
145
146
146
147
return get ( ) . needCode ;
147
148
} ,
148
-
149
+ getVisionModels ( ) {
150
+ this . fetch ( ) ;
151
+ return get ( ) . visionModels ;
152
+ } ,
149
153
edgeVoiceName ( ) {
150
154
this . fetch ( ) ;
151
155
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import { ServiceProvider } from "./constant";
6
6
// import { fetch as tauriFetch, ResponseType } from "@tauri-apps/api/http";
7
7
import { fetch as tauriStreamFetch } from "./utils/stream" ;
8
8
import { VISION_MODEL_REGEXES , EXCLUDE_VISION_MODEL_REGEXES } from "./constant" ;
9
- import { getClientConfig } from "./config/client " ;
9
+ import { useAccessStore } from "./store " ;
10
10
import { ModelSize } from "./typing" ;
11
11
12
12
export function trimTopic ( topic : string ) {
@@ -255,8 +255,8 @@ export function getMessageImages(message: RequestMessage): string[] {
255
255
}
256
256
257
257
export function isVisionModel ( model : string ) {
258
- const clientConfig = getClientConfig ( ) ;
259
- const envVisionModels = clientConfig ?. visionModels
258
+ const visionModels = useAccessStore . getState ( ) . visionModels ;
259
+ const envVisionModels = visionModels
260
260
?. split ( "," )
261
261
. map ( ( m ) => m . trim ( ) ) ;
262
262
if ( envVisionModels ?. includes ( model ) ) {
You can’t perform that action at this time.
0 commit comments