@@ -106,6 +106,9 @@ export class GeminiProApi implements LLMApi {
106106 // if (visionModel && messages.length > 1) {
107107 // options.onError?.(new Error("Multiturn chat is not enabled for models/gemini-pro-vision"));
108108 // }
109+
110+ const accessStore = useAccessStore . getState ( ) ;
111+
109112 const modelConfig = {
110113 ...useAppConfig . getState ( ) . modelConfig ,
111114 ...useChatStore . getState ( ) . currentSession ( ) . mask . modelConfig ,
@@ -127,19 +130,19 @@ export class GeminiProApi implements LLMApi {
127130 safetySettings : [
128131 {
129132 category : "HARM_CATEGORY_HARASSMENT" ,
130- threshold : "BLOCK_ONLY_HIGH" ,
133+ threshold : accessStore . googleSafetySettings ,
131134 } ,
132135 {
133136 category : "HARM_CATEGORY_HATE_SPEECH" ,
134- threshold : "BLOCK_ONLY_HIGH" ,
137+ threshold : accessStore . googleSafetySettings ,
135138 } ,
136139 {
137140 category : "HARM_CATEGORY_SEXUALLY_EXPLICIT" ,
138- threshold : "BLOCK_ONLY_HIGH" ,
141+ threshold : accessStore . googleSafetySettings ,
139142 } ,
140143 {
141144 category : "HARM_CATEGORY_DANGEROUS_CONTENT" ,
142- threshold : "BLOCK_ONLY_HIGH" ,
145+ threshold : accessStore . googleSafetySettings ,
143146 } ,
144147 ] ,
145148 } ;
0 commit comments