Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ChatCloudflareWorkersAI, type CloudflareWorkersAIInput } from '@langchain/cloudflare'
import { ICommonObject, INode, INodeData, INodeParams } from '../../../src/Interface'
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
import { checkDenyList } from '../../../src/httpSecurity'

class ChatCloudflareWorkersAI_ChatModels implements INode {
label: string
Expand Down Expand Up @@ -70,6 +71,7 @@ class ChatCloudflareWorkersAI_ChatModels implements INode {
}

if (baseUrl) {
await checkDenyList(baseUrl)
obj.baseUrl = baseUrl
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../
import { getModels, MODEL_TYPE } from '../../../src/modelLoader'
import { GoogleGenerativeAIChatInput } from '@langchain/google-genai'
import { ChatGoogleGenerativeAI } from './FlowiseChatGoogleGenerativeAI'
import { checkDenyList } from '../../../src/httpSecurity'

class GoogleGenerativeAI_ChatModels implements INode {
label: string
Expand Down Expand Up @@ -275,7 +276,10 @@ class GoogleGenerativeAI_ChatModels implements INode {
if (topK) obj.topK = parseFloat(topK)
if (cache) obj.cache = cache
if (temperature) obj.temperature = parseFloat(temperature)
if (baseUrl) obj.baseUrl = baseUrl
if (baseUrl) {
await checkDenyList(baseUrl)
obj.baseUrl = baseUrl
}
if (thinkingLevel) {
obj.thinkingConfig = {
thinkingLevel: thinkingLevel,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { BaseLLMParams } from '@langchain/core/language_models/llms'
import { ICommonObject, IMultiModalOption, INode, INodeData, INodeParams } from '../../../src/Interface'
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
import { ChatOpenAI } from '../ChatOpenAI/FlowiseChatOpenAI'
import { checkDenyList } from '../../../src/httpSecurity'

class ChatLitellm_ChatModels implements INode {
label: string
Expand Down Expand Up @@ -126,6 +127,7 @@ class ChatLitellm_ChatModels implements INode {
}

if (basePath) {
await checkDenyList(basePath)
obj.configuration = {
baseURL: basePath
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { ChatOpenAI, ChatOpenAIFields } from '@langchain/openai'
import { BaseCache } from '@langchain/core/caches'
import { ICommonObject, INode, INodeData, INodeParams } from '../../../src/Interface'
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
import { checkDenyList } from '../../../src/httpSecurity'

class ChatLocalAI_ChatModels implements INode {
label: string
Expand Down Expand Up @@ -123,7 +124,10 @@ class ChatLocalAI_ChatModels implements INode {
obj.openAIApiKey = localAIApiKey
obj.apiKey = localAIApiKey
}
if (basePath) obj.configuration = { baseURL: basePath }
if (basePath) {
await checkDenyList(basePath)
obj.configuration = { baseURL: basePath }
}

const model = new ChatOpenAI(obj)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { CallbackManager, CallbackManagerForLLMRun } from '@langchain/core/callb
import { ChatResult } from '@langchain/core/outputs'
import { FailedAttemptHandler } from '@langchain/core/utils/async_caller'
import { getBaseClasses, INode, INodeData, INodeParams } from '../../../src'
import { checkDenyList } from '../../../src/httpSecurity'

export interface ChatNemoGuardrailsCallOptions extends BaseChatModelCallOptions {
/**
Expand Down Expand Up @@ -109,6 +110,7 @@ class ChatNemoGuardrailsChatModel implements INode {
async init(nodeData: INodeData): Promise<any> {
const configurationId = nodeData.inputs?.configurationId
const baseUrl = nodeData.inputs?.baseUrl
if (baseUrl) await checkDenyList(baseUrl)
const obj: Partial<ChatNemoGuardrailsInput> = {
configurationId: configurationId,
baseUrl: baseUrl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { BaseCache } from '@langchain/core/caches'
import { ChatOpenAI, ChatOpenAIFields } from '@langchain/openai'
import { ICommonObject, INode, INodeData, INodeParams } from '../../../src/Interface'
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
import { checkDenyList } from '../../../src/httpSecurity'

class ChatNvdiaNIM_ChatModels implements INode {
label: string
Expand Down Expand Up @@ -158,6 +159,8 @@ class ChatNvdiaNIM_ChatModels implements INode {
}
}

if (basePath) await checkDenyList(basePath)

if (basePath || parsedBaseOptions) {
obj.configuration = {
baseURL: basePath,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { BaseCache } from '@langchain/core/caches'
import { ICommonObject, IMultiModalOption, INode, INodeData, INodeParams } from '../../../src/Interface'
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
import { ChatOllama } from './FlowiseChatOllama'
import { checkDenyList } from '../../../src/httpSecurity'

class ChatOllama_ChatModels implements INode {
label: string
Expand Down Expand Up @@ -252,8 +253,11 @@ class ChatOllama_ChatModels implements INode {

const cache = nodeData.inputs?.cache as BaseCache

const activeBaseUrl = baseUrl || 'http://localhost:11434'
await checkDenyList(activeBaseUrl)

const obj: ChatOllamaInput & BaseChatModelParams = {
baseUrl,
baseUrl: activeBaseUrl,
temperature: parseFloat(temperature),
model: modelName,
streaming: streaming ?? true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { INode, INodeData, INodeParams } from '../../../src/Interface'
import { getBaseClasses } from '../../../src/utils'
import { OllamaParams, Ollama } from 'llamaindex'
import { checkDenyList } from '../../../src/httpSecurity'

class ChatOllama_LlamaIndex_ChatModels implements INode {
label: string
Expand Down Expand Up @@ -192,6 +193,8 @@ class ChatOllama_LlamaIndex_ChatModels implements INode {
const stop = nodeData.inputs?.stop as string
const tfsZ = nodeData.inputs?.tfsZ as string

if (baseUrl) await checkDenyList(baseUrl)

const obj: OllamaParams = {
model: modelName,
options: {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { ChatOpenAI, ChatOpenAIFields } from '@langchain/openai'
import { BaseCache } from '@langchain/core/caches'
import { ICommonObject, INode, INodeData, INodeParams } from '../../../src/Interface'
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
import { checkDenyList } from '../../../src/httpSecurity'

class ChatOpenAICustom_ChatModels implements INode {
label: string
Expand Down Expand Up @@ -160,6 +161,8 @@ class ChatOpenAICustom_ChatModels implements INode {
}
}

if (basePath) await checkDenyList(basePath)

if (basePath || parsedBaseOptions) {
obj.configuration = {
baseURL: basePath,
Expand Down
Loading