feat: Add HTTP proxy support for OpenAI Embeddings node (#17173)

This commit is contained in:
KSG
2025-07-14 16:58:15 +09:00
committed by GitHub
parent 7195b3bd97
commit 232b8f6cb1

View File

@@ -10,6 +10,8 @@ import {
import type { ClientOptions } from 'openai';
import { logWrapper } from '@utils/logWrapper';
import { getProxyAgent } from '@utils/httpProxyAgent';
import { getConnectionHintNoticeField } from '@utils/sharedFields';
const modelParameter: INodeProperties = {
@@ -227,6 +229,12 @@ export class EmbeddingsOpenAi implements INodeType {
configuration.baseURL = credentials.url as string;
}
if (configuration.baseURL) {
configuration.fetchOptions = {
dispatcher: getProxyAgent(configuration.baseURL ?? 'https://api.openai.com/v1'),
};
}
const embeddings = new OpenAIEmbeddings({
modelName: this.getNodeParameter('model', itemIndex, 'text-embedding-3-small') as string,
openAIApiKey: credentials.apiKey as string,