mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 03:12:15 +00:00
feat(LangChain Nodes): Upgrade LangChain and improve proxy handling for LLM nodes (#16778)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import type { ILoadOptionsFunctions, INodeListSearchResult } from 'n8n-workflow';
|
||||
import OpenAI from 'openai';
|
||||
|
||||
import { getHttpProxyAgent } from '@utils/httpProxyAgent';
|
||||
import { getProxyAgent } from '@utils/httpProxyAgent';
|
||||
|
||||
export async function searchModels(
|
||||
this: ILoadOptionsFunctions,
|
||||
@@ -16,7 +16,9 @@ export async function searchModels(
|
||||
const openai = new OpenAI({
|
||||
baseURL,
|
||||
apiKey: credentials.apiKey as string,
|
||||
httpAgent: getHttpProxyAgent(),
|
||||
fetchOptions: {
|
||||
dispatcher: getProxyAgent(baseURL),
|
||||
},
|
||||
});
|
||||
const { data: models = [] } = await openai.models.list();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user