This commit is contained in:
jasonliusz 2025-03-05 17:40:54 +01:00 committed by GitHub
commit 865a2df858
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 166 additions and 19 deletions

View file

@ -1,6 +1,7 @@
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */ /* eslint-disable n8n-nodes-base/node-dirname-against-convention */
import { ChatOpenAI, type ClientOptions } from '@langchain/openai'; import { ChatOpenAI, type ClientOptions } from '@langchain/openai';
import { HttpsProxyAgent } from 'https-proxy-agent';
import { import {
NodeConnectionType, NodeConnectionType,
type INodeType, type INodeType,
@ -353,6 +354,14 @@ export class LmChatOpenAi implements INodeType {
configuration.baseURL = credentials.url as string; configuration.baseURL = credentials.url as string;
} }
// set ODE_TLS_REJECT_UNAUTHORIZED to '0' value in order to skip SSL trust issue(i.e. self cert)
// This works by setting the value in terminal as following:
// export https_proxy=http://127.0.0.1:9091 NODE_TLS_REJECT_UNAUTHORIZED=0
const httpProxy = process.env.http_proxy ?? process.env.https_proxy;
if (httpProxy) {
configuration.httpAgent = new HttpsProxyAgent(httpProxy);
}
// Extra options to send to OpenAI, that are not directly supported by LangChain // Extra options to send to OpenAI, that are not directly supported by LangChain
const modelKwargs: { const modelKwargs: {
response_format?: object; response_format?: object;

View file

@ -173,6 +173,7 @@
"form-data": "catalog:", "form-data": "catalog:",
"generate-schema": "2.6.0", "generate-schema": "2.6.0",
"html-to-text": "9.0.5", "html-to-text": "9.0.5",
"https-proxy-agent": "^7.0.6",
"jsdom": "23.0.1", "jsdom": "23.0.1",
"langchain": "0.3.11", "langchain": "0.3.11",
"lodash": "catalog:", "lodash": "catalog:",

View file

@ -605,6 +605,9 @@ importers:
html-to-text: html-to-text:
specifier: 9.0.5 specifier: 9.0.5
version: 9.0.5 version: 9.0.5
https-proxy-agent:
specifier: ^7.0.6
version: 7.0.6
jsdom: jsdom:
specifier: 23.0.1 specifier: 23.0.1
version: 23.0.1 version: 23.0.1
@ -867,6 +870,9 @@ importers:
'@n8n_io/license-sdk': '@n8n_io/license-sdk':
specifier: 2.17.0 specifier: 2.17.0
version: 2.17.0 version: 2.17.0
'@ngrok/ngrok':
specifier: 1.4.1
version: 1.4.1
'@oclif/core': '@oclif/core':
specifier: 4.0.7 specifier: 4.0.7
version: 4.0.7 version: 4.0.7
@ -4623,6 +4629,87 @@ packages:
'@ngneat/falso@7.2.0': '@ngneat/falso@7.2.0':
resolution: {integrity: sha512-283EXBFd05kCbGuGSXgmvhCsQYEYzvD/eJaE7lxd05qRB0tgREvZX7TRlJ1KSp8nHxoK6Ws029G1Y30mt4IVAA==} resolution: {integrity: sha512-283EXBFd05kCbGuGSXgmvhCsQYEYzvD/eJaE7lxd05qRB0tgREvZX7TRlJ1KSp8nHxoK6Ws029G1Y30mt4IVAA==}
'@ngrok/ngrok-android-arm-eabi@1.4.1':
resolution: {integrity: sha512-KQe59T8PhFg5XvWypcOCIgUakk/A9ipD1UvSgGuLI7pYIiVcx6oyW12RxCJr6cfdO0K5GrbUG6dlEXSmDD4jBg==}
engines: {node: '>= 10'}
cpu: [arm]
os: [android]
'@ngrok/ngrok-android-arm64@1.4.1':
resolution: {integrity: sha512-WPYJenabIArkGmeVhBcIVtgXmLK297pfJCYHP1Tnw220ANEXFdo7EW4dZoP0AA0gxciFHGYnQUMOn1Meo0IQFQ==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [android]
'@ngrok/ngrok-darwin-arm64@1.4.1':
resolution: {integrity: sha512-hJW+ZDJ0uV7PieZAdZHdzR/WBRctjOkLzFqHTxSuNbmBr9uIg6PGf1dB2lySszK1wyKZL7wvh4GedQ4vSU5lkw==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [darwin]
'@ngrok/ngrok-darwin-universal@1.4.1':
resolution: {integrity: sha512-rUZKl/vr2cALpT1Ng91h8Jf5OfDtF+zNEC65AFWthPkHJpPQCLvuEC9hyF8XI52Bv45ORRb1YKR3hdhjZ4WGHQ==}
engines: {node: '>= 10'}
os: [darwin]
'@ngrok/ngrok-darwin-x64@1.4.1':
resolution: {integrity: sha512-UKIkRpsGBywAqvwz8L6R8ITz+xxPoZ58LSFhZoMAWm2alGOdA2js1eHZwwVTSz96/tmmSRE/H+r69TvtuL0lXA==}
engines: {node: '>= 10'}
cpu: [x64]
os: [darwin]
'@ngrok/ngrok-freebsd-x64@1.4.1':
resolution: {integrity: sha512-v1xXqmu3f4W1PQt+NKlqXgLcpULYCSwStKGRSdgXljg1bRdOnW3ZdjbGzrIdKwQ7OcwZP34KbP13G+hqcTxo5Q==}
engines: {node: '>= 10'}
cpu: [x64]
os: [freebsd]
'@ngrok/ngrok-linux-arm-gnueabihf@1.4.1':
resolution: {integrity: sha512-yEeiVAGQNUErkSpOI1EZI+X3AkHCGd8yzqfjHamnhEONkwxLcWuTiUfcwFeMVtE9jyLfvQxctldPXXAjvaI/QA==}
engines: {node: '>= 10'}
cpu: [arm]
os: [linux]
'@ngrok/ngrok-linux-arm64-gnu@1.4.1':
resolution: {integrity: sha512-Fb2uju769eO/yOrWdbMvCXNczbXHnqNmN5TCYvqQbPdscFgrsNaJcVr2SmWOfBq+OcLWYbx6mXE1ki5yOZKU9w==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [linux]
'@ngrok/ngrok-linux-arm64-musl@1.4.1':
resolution: {integrity: sha512-nMTTZkUnwCzeIVDkoUdNqBKe6ArYXRWGjC4iXinfPOdENkb/tZ/eAjVdg+8bQ5PJgl/n/TbdZKNj//Jz2x8fdw==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [linux]
'@ngrok/ngrok-linux-x64-gnu@1.4.1':
resolution: {integrity: sha512-IfDaYd9ZGk7F0szHql5Tr3rlLBlhuKbbNXDVkujGy/njA4/YnckfsZilGEtgnR7aYgHo3NqppfEw+AOmlDytCw==}
engines: {node: '>= 10'}
cpu: [x64]
os: [linux]
'@ngrok/ngrok-linux-x64-musl@1.4.1':
resolution: {integrity: sha512-Ze6wb2umg6hfJhxOrFQhiyIZOf9YjSRkefnaQdAaONrIKxiFsu5SIKQbp7MQRnm8wabB9i0OI0Q/TVBsxo/HLw==}
engines: {node: '>= 10'}
cpu: [x64]
os: [linux]
'@ngrok/ngrok-win32-ia32-msvc@1.4.1':
resolution: {integrity: sha512-FV3dwGpbh1h2fJ7h+Od8vFRrR9RxqBUAI+ELxQxropDxwYp6rWGKFnfE+JUcT79fEH3OpA0ElULrIDrLgK7bgg==}
engines: {node: '>= 10'}
cpu: [ia32]
os: [win32]
'@ngrok/ngrok-win32-x64-msvc@1.4.1':
resolution: {integrity: sha512-Zr1Dyel4M3cA1kjT/N5ftTiCdoPnVv/VbyE6AKKemP9DDFkTlpdvMwSXikm/ypNtCNFEs/+q8CBZPhhaKktl8A==}
engines: {node: '>= 10'}
cpu: [x64]
os: [win32]
'@ngrok/ngrok@1.4.1':
resolution: {integrity: sha512-KZ7/T4UOY3BqJBdweJPeebKW34YzIH+a2y4o7yqTIowoi6dw3sMj140o1Q8FvpPbH5J6lr2TWVCWdgSTYvHNgw==}
engines: {node: '>= 10'}
'@nodelib/fs.scandir@2.1.5': '@nodelib/fs.scandir@2.1.5':
resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==}
engines: {node: '>= 8'} engines: {node: '>= 8'}
@ -6567,6 +6654,10 @@ packages:
resolution: {integrity: sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==} resolution: {integrity: sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==}
engines: {node: '>= 14'} engines: {node: '>= 14'}
agent-base@7.1.3:
resolution: {integrity: sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==}
engines: {node: '>= 14'}
agentkeepalive@4.2.1: agentkeepalive@4.2.1:
resolution: {integrity: sha512-Zn4cw2NEqd+9fiSVWMscnjyQ1a8Yfoc5oBajLeo5w+YBHgDUcEBY2hS4YpTz6iN5f/2zQiktcuM6tS8x1p9dpA==} resolution: {integrity: sha512-Zn4cw2NEqd+9fiSVWMscnjyQ1a8Yfoc5oBajLeo5w+YBHgDUcEBY2hS4YpTz6iN5f/2zQiktcuM6tS8x1p9dpA==}
engines: {node: '>= 8.0.0'} engines: {node: '>= 8.0.0'}
@ -9052,12 +9143,8 @@ packages:
resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==}
engines: {node: '>= 6'} engines: {node: '>= 6'}
https-proxy-agent@7.0.2: https-proxy-agent@7.0.6:
resolution: {integrity: sha512-NmLNjm6ucYwtcUmL7JQC1ZQ57LmHP4lT15FQ8D61nak1rO6DH+fz5qNK2Ap5UN4ZapYICE3/0KodcLYSPsPbaA==} resolution: {integrity: sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==}
engines: {node: '>= 14'}
https-proxy-agent@7.0.5:
resolution: {integrity: sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==}
engines: {node: '>= 14'} engines: {node: '>= 14'}
human-signals@1.1.1: human-signals@1.1.1:
@ -16893,6 +16980,61 @@ snapshots:
seedrandom: 3.0.5 seedrandom: 3.0.5
uuid: 8.3.2 uuid: 8.3.2
'@ngrok/ngrok-android-arm-eabi@1.4.1':
optional: true
'@ngrok/ngrok-android-arm64@1.4.1':
optional: true
'@ngrok/ngrok-darwin-arm64@1.4.1':
optional: true
'@ngrok/ngrok-darwin-universal@1.4.1':
optional: true
'@ngrok/ngrok-darwin-x64@1.4.1':
optional: true
'@ngrok/ngrok-freebsd-x64@1.4.1':
optional: true
'@ngrok/ngrok-linux-arm-gnueabihf@1.4.1':
optional: true
'@ngrok/ngrok-linux-arm64-gnu@1.4.1':
optional: true
'@ngrok/ngrok-linux-arm64-musl@1.4.1':
optional: true
'@ngrok/ngrok-linux-x64-gnu@1.4.1':
optional: true
'@ngrok/ngrok-linux-x64-musl@1.4.1':
optional: true
'@ngrok/ngrok-win32-ia32-msvc@1.4.1':
optional: true
'@ngrok/ngrok-win32-x64-msvc@1.4.1':
optional: true
'@ngrok/ngrok@1.4.1':
optionalDependencies:
'@ngrok/ngrok-android-arm-eabi': 1.4.1
'@ngrok/ngrok-android-arm64': 1.4.1
'@ngrok/ngrok-darwin-arm64': 1.4.1
'@ngrok/ngrok-darwin-universal': 1.4.1
'@ngrok/ngrok-darwin-x64': 1.4.1
'@ngrok/ngrok-freebsd-x64': 1.4.1
'@ngrok/ngrok-linux-arm-gnueabihf': 1.4.1
'@ngrok/ngrok-linux-arm64-gnu': 1.4.1
'@ngrok/ngrok-linux-arm64-musl': 1.4.1
'@ngrok/ngrok-linux-x64-gnu': 1.4.1
'@ngrok/ngrok-linux-x64-musl': 1.4.1
'@ngrok/ngrok-win32-ia32-msvc': 1.4.1
'@ngrok/ngrok-win32-x64-msvc': 1.4.1
'@nodelib/fs.scandir@2.1.5': '@nodelib/fs.scandir@2.1.5':
dependencies: dependencies:
'@nodelib/fs.stat': 2.0.5 '@nodelib/fs.stat': 2.0.5
@ -17400,7 +17542,7 @@ snapshots:
'@redocly/ajv': 8.11.2 '@redocly/ajv': 8.11.2
'@redocly/config': 0.12.1 '@redocly/config': 0.12.1
colorette: 1.4.0 colorette: 1.4.0
https-proxy-agent: 7.0.5 https-proxy-agent: 7.0.6
js-levenshtein: 1.1.6 js-levenshtein: 1.1.6
js-yaml: 4.1.0 js-yaml: 4.1.0
lodash.isequal: 4.5.0 lodash.isequal: 4.5.0
@ -19488,6 +19630,8 @@ snapshots:
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
agent-base@7.1.3: {}
agentkeepalive@4.2.1: agentkeepalive@4.2.1:
dependencies: dependencies:
debug: 4.4.0(supports-color@8.1.1) debug: 4.4.0(supports-color@8.1.1)
@ -22138,7 +22282,7 @@ snapshots:
gaxios@6.6.0(encoding@0.1.13): gaxios@6.6.0(encoding@0.1.13):
dependencies: dependencies:
extend: 3.0.2 extend: 3.0.2
https-proxy-agent: 7.0.5 https-proxy-agent: 7.0.6
is-stream: 2.0.1 is-stream: 2.0.1
node-fetch: 2.7.0(encoding@0.1.13) node-fetch: 2.7.0(encoding@0.1.13)
uuid: 9.0.1 uuid: 9.0.1
@ -22567,16 +22711,9 @@ snapshots:
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
https-proxy-agent@7.0.2: https-proxy-agent@7.0.6:
dependencies: dependencies:
agent-base: 7.1.0 agent-base: 7.1.3
debug: 4.4.0(supports-color@8.1.1)
transitivePeerDependencies:
- supports-color
https-proxy-agent@7.0.5:
dependencies:
agent-base: 7.1.0
debug: 4.4.0(supports-color@8.1.1) debug: 4.4.0(supports-color@8.1.1)
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
@ -23443,7 +23580,7 @@ snapshots:
form-data: 4.0.0 form-data: 4.0.0
html-encoding-sniffer: 4.0.0 html-encoding-sniffer: 4.0.0
http-proxy-agent: 7.0.0 http-proxy-agent: 7.0.0
https-proxy-agent: 7.0.5 https-proxy-agent: 7.0.6
is-potential-custom-element-name: 1.0.1 is-potential-custom-element-name: 1.0.1
nwsapi: 2.2.7 nwsapi: 2.2.7
parse5: 7.1.2 parse5: 7.1.2
@ -26394,7 +26531,7 @@ snapshots:
fastest-levenshtein: 1.0.16 fastest-levenshtein: 1.0.16
generic-pool: 3.9.0 generic-pool: 3.9.0
glob: 10.4.5 glob: 10.4.5
https-proxy-agent: 7.0.2 https-proxy-agent: 7.0.6
jsonwebtoken: 9.0.2 jsonwebtoken: 9.0.2
mime-types: 2.1.35 mime-types: 2.1.35
mkdirp: 1.0.4 mkdirp: 1.0.4