UNPKG

@n8n/n8n-nodes-langchain

Version:
93 lines (87 loc) • 4.45 kB
/** * Microsoft Foundry Chat Model Node - Version 1.1 * For advanced usage with an AI chain */ export interface LcLmChatAzureOpenAiV11Params { authentication?: 'azureOpenAiApi' | 'azureEntraCognitiveServicesOAuth2Api' | Expression<string>; /** * The Microsoft Foundry project that owns the deployment. Leave empty to use the project from the credential. A classic Azure OpenAI resource does not use it. */ project?: string | Expression<string>; /** * The deployment to use. Choose from the list (Microsoft Foundry credentials only), or enter the deployment name. * @builderHint Set the project parameter before you list deployments. The list needs a Microsoft Foundry credential. With a classic credential, use the id mode and enter the deployment name. * @searchListMethod searchModels * @default {"mode":"id","value":""} */ model?: { __rl: true; mode: 'list' | 'id'; value: string; cachedResultName?: string }; /** * The API family the deployment answers on. Azure does not report this, so set it to match the deployment: OpenAI for GPT and other OpenAI-compatible models, Anthropic for Claude. Anthropic needs a credential using the Azure AI Foundry endpoint type. * @default openai */ modelFamily?: 'openai' | 'anthropic' | Expression<string>; /** * Whether to call the deployment on the Responses API instead of Chat Completions. Azure does not tell us which one a deployment supports, so set this to match your deployment: leave it off for a chat-completions deployment, turn it on for a Responses-only one. Needs a credential using the Microsoft Foundry endpoint type. * @displayOptions.show { modelFamily: ["openai"] } * @default false */ responsesApiEnabled?: boolean | Expression<boolean>; /** * Additional options to add * @default {} */ options?: { /** Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim * @displayOptions.show { /modelFamily: ["openai"] } * @default 0 */ frequencyPenalty?: number | Expression<number>; /** The maximum number of tokens to generate in the completion. Most models have a context length of 2048 tokens (except for the newest models, which support 32,768). Use -1 for default. * @default -1 */ maxTokens?: number | Expression<number>; /** Response Format * @displayOptions.show { /modelFamily: ["openai"] } * @default text */ responseFormat?: 'text' | 'json_object' | Expression<string>; /** Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics * @displayOptions.show { /modelFamily: ["openai"] } * @default 0 */ presencePenalty?: number | Expression<number>; /** Controls randomness: Lowering results in less random completions. As the temperature approaches zero, the model will become deterministic and repetitive. * @displayOptions.show { /modelFamily: ["openai", "anthropic"] } * @default 0.7 */ temperature?: number | Expression<number>; /** Maximum amount of time a request is allowed to take in milliseconds * @default 60000 */ timeout?: number | Expression<number>; /** Maximum number of retries to attempt on failure * @default 2 */ maxRetries?: 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>; /** Optional additional JSON properties to include in the request body. Use this for parameters a deployment supports that the options above do not cover. * @default {} */ extraBody?: IDataObject | string | Expression<string>; }; } export interface LcLmChatAzureOpenAiV11Credentials { azureOpenAiApi: CredentialReference; azureEntraCognitiveServicesOAuth2Api: CredentialReference; } interface LcLmChatAzureOpenAiV11NodeBase { type: '@n8n/n8n-nodes-langchain.lmChatAzureOpenAi'; version: 1.1; } export type LcLmChatAzureOpenAiV11ParamsNode = LcLmChatAzureOpenAiV11NodeBase & { config: NodeConfig<LcLmChatAzureOpenAiV11Params> & { credentials?: LcLmChatAzureOpenAiV11Credentials }; }; export type LcLmChatAzureOpenAiV11Node = LcLmChatAzureOpenAiV11ParamsNode;