File tree Expand file tree Collapse file tree
x-pack/packages/kbn-langchain/server/language_models Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77
88import {
99 Content ,
10- Part ,
10+ EnhancedGenerateContentResponse ,
1111 FunctionCallPart ,
1212 FunctionResponsePart ,
13- POSSIBLE_ROLES ,
14- EnhancedGenerateContentResponse ,
1513 GenerateContentRequest ,
16- TextPart ,
17- InlineDataPart ,
1814 GenerateContentResult ,
15+ HarmBlockThreshold ,
16+ HarmCategory ,
17+ InlineDataPart ,
18+ POSSIBLE_ROLES ,
19+ Part ,
20+ TextPart ,
1921} from '@google/generative-ai' ;
2022import { ActionsClient } from '@kbn/actions-plugin/server' ;
2123import { PublicMethodsOf } from '@kbn/utility-types' ;
@@ -57,6 +59,12 @@ export class ActionsClientGeminiChatModel extends ChatGoogleGenerativeAI {
5759 ...props ,
5860 apiKey : 'asda' ,
5961 maxOutputTokens : props . maxTokens ?? 2048 ,
62+ safetySettings : [
63+ {
64+ category : HarmCategory . HARM_CATEGORY_HARASSMENT ,
65+ threshold : HarmBlockThreshold . BLOCK_LOW_AND_ABOVE ,
66+ } ,
67+ ] ,
6068 } ) ;
6169 // LangChain needs model to be defined for logging purposes
6270 this . model = props . model ?? this . model ;
You can’t perform that action at this time.
0 commit comments