@n8n/n8n-nodes-langchain
Version:
68 lines (62 loc) • 3.46 kB
text/typescript
/**
* Google Gemini Chat Model Node - Version 1.2
* Run Gemini models, with optional adjustable safety filters
*/
export interface LcLmChatGoogleGeminiV12Params {
/**
* The model which will generate the completion. <a href="https://developers.generativeai.google/api/rest/generativelanguage/models/list">Learn more</a>.
* @builderHint This node declares no model-list lookup, so its models cannot be listed, even with a connected credential. For a new choice, use current Google provider catalog information and choose a Gemini 3.x or newer model ID with the "models/" prefix. Do not choose Gemini 2.x or older. Keep a working or explicitly requested model unless provider evidence shows it is unavailable or unsuitable. When choosing a new model, select a current stable model supported by this node version, the configured API, and the required operation. Use the declared model-list lookup with the connected credential when available. Gateway credits can restrict that list. For a new choice without credentials, use current provider catalog information. Choose a model that fits the task and budget. Copy the exact model ID. Do not rely on node defaults, invent model IDs, or treat an unfamiliar model as invalid.
* @default models/gemini-3-flash-preview
*/
modelName?: string | Expression<string>;
/**
* Additional options to add
* @default {}
*/
options?: {
/** The maximum number of tokens to generate in the completion
* @default 2048
*/
maxOutputTokens?: number | Expression<number>;
/** Controls randomness: Lowering results in less random completions. As the temperature approaches zero, the model will become deterministic and repetitive.
* @default 0.4
*/
temperature?: number | Expression<number>;
/** Used to remove "long tail" low probability responses. Defaults to -1, which disables it.
* @default 32
*/
topK?: number | Expression<number>;
/** Controls diversity via nucleus sampling: 0.5 means half of all likelihood-weighted options are considered. We generally recommend altering this or temperature but not both.
* @default 1
*/
topP?: number | Expression<number>;
/** Safety Settings
* @default {"values":{"category":"HARM_CATEGORY_HARASSMENT","threshold":"HARM_BLOCK_THRESHOLD_UNSPECIFIED"}}
*/
safetySettings?: {
/** Values
*/
values?: Array<{
/** The category of harmful content to block
* @default HARM_CATEGORY_UNSPECIFIED
*/
category?: 'HARM_CATEGORY_HARASSMENT' | 'HARM_CATEGORY_HATE_SPEECH' | 'HARM_CATEGORY_SEXUALLY_EXPLICIT' | 'HARM_CATEGORY_DANGEROUS_CONTENT' | Expression<string>;
/** The threshold of harmful content to block
* @default HARM_BLOCK_THRESHOLD_UNSPECIFIED
*/
threshold?: 'HARM_BLOCK_THRESHOLD_UNSPECIFIED' | 'BLOCK_LOW_AND_ABOVE' | 'BLOCK_MEDIUM_AND_ABOVE' | 'BLOCK_ONLY_HIGH' | 'BLOCK_NONE' | Expression<string>;
}>;
};
};
}
export interface LcLmChatGoogleGeminiV12Credentials {
googlePalmApi: CredentialReference;
}
interface LcLmChatGoogleGeminiV12NodeBase {
type: '@n8n/n8n-nodes-langchain.lmChatGoogleGemini';
version: 1.2;
}
export type LcLmChatGoogleGeminiV12ParamsNode = LcLmChatGoogleGeminiV12NodeBase & {
config: NodeConfig<LcLmChatGoogleGeminiV12Params> & { credentials?: LcLmChatGoogleGeminiV12Credentials };
};
export type LcLmChatGoogleGeminiV12Node = LcLmChatGoogleGeminiV12ParamsNode;