mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 19:00:59 +03:00
lint fixes
This commit is contained in:
@@ -4,21 +4,15 @@ import { BaseChatModel } from '@langchain/core/language_models/chat_models'
|
|||||||
import { AIMessage, BaseMessage, HumanMessage } from '@langchain/core/messages'
|
import { AIMessage, BaseMessage, HumanMessage } from '@langchain/core/messages'
|
||||||
import { ChainValues } from '@langchain/core/utils/types'
|
import { ChainValues } from '@langchain/core/utils/types'
|
||||||
import { AgentStep } from '@langchain/core/agents'
|
import { AgentStep } from '@langchain/core/agents'
|
||||||
import {
|
import { renderTemplate, MessagesPlaceholder, HumanMessagePromptTemplate, PromptTemplate } from '@langchain/core/prompts'
|
||||||
renderTemplate,
|
|
||||||
MessagesPlaceholder,
|
|
||||||
HumanMessagePromptTemplate,
|
|
||||||
PromptTemplate
|
|
||||||
} from "@langchain/core/prompts";
|
|
||||||
import { RunnableSequence } from '@langchain/core/runnables'
|
import { RunnableSequence } from '@langchain/core/runnables'
|
||||||
import { ChatConversationalAgent } from 'langchain/agents'
|
import { ChatConversationalAgent } from 'langchain/agents'
|
||||||
import { getBaseClasses } from '../../../src/utils'
|
import { getBaseClasses } from '../../../src/utils'
|
||||||
import { ConsoleCallbackHandler, CustomChainHandler, additionalCallbacks } from '../../../src/handler'
|
import { ConsoleCallbackHandler, CustomChainHandler, additionalCallbacks } from '../../../src/handler'
|
||||||
import { FlowiseMemory, ICommonObject, IMessage, INode, INodeData, INodeParams } from '../../../src/Interface'
|
import { FlowiseMemory, ICommonObject, IMessage, INode, INodeData, INodeParams } from '../../../src/Interface'
|
||||||
import { AgentExecutor } from '../../../src/agents'
|
import { AgentExecutor } from '../../../src/agents'
|
||||||
import { ChatOpenAI } from '../../chatmodels/ChatOpenAI/FlowiseChatOpenAI'
|
import { addImagesToMessages, llmSupportsVision } from '../../../src/multiModalUtils'
|
||||||
import { addImagesToMessages, llmSupportsVision } from "../../../src/multiModalUtils";
|
import { IVisionChatModal } from '../../../src/IVisionChatModal'
|
||||||
import { IVisionChatModal } from "../../../src/IVisionChatModal";
|
|
||||||
|
|
||||||
const DEFAULT_PREFIX = `Assistant is a large language model trained by OpenAI.
|
const DEFAULT_PREFIX = `Assistant is a large language model trained by OpenAI.
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import { FlowiseMemory, ICommonObject, INode, INodeData, INodeParams, MessageCon
|
|||||||
import { ConsoleCallbackHandler, CustomChainHandler, additionalCallbacks } from '../../../src/handler'
|
import { ConsoleCallbackHandler, CustomChainHandler, additionalCallbacks } from '../../../src/handler'
|
||||||
import { getBaseClasses, handleEscapeCharacters } from '../../../src/utils'
|
import { getBaseClasses, handleEscapeCharacters } from '../../../src/utils'
|
||||||
import { IVisionChatModal } from '../../../src/IVisionChatModal'
|
import { IVisionChatModal } from '../../../src/IVisionChatModal'
|
||||||
import { MessageContent } from 'llamaindex'
|
|
||||||
|
|
||||||
let systemMessage = `The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.`
|
let systemMessage = `The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.`
|
||||||
const inputKey = 'input'
|
const inputKey = 'input'
|
||||||
|
|||||||
@@ -1,22 +1,17 @@
|
|||||||
import { BaseLanguageModel, BaseLanguageModelCallOptions } from "@langchain/core/language_models/base";
|
import { BaseLanguageModel, BaseLanguageModelCallOptions } from '@langchain/core/language_models/base'
|
||||||
import { BaseLLMOutputParser, BaseOutputParser } from "@langchain/core/output_parsers";
|
import { BaseLLMOutputParser, BaseOutputParser } from '@langchain/core/output_parsers'
|
||||||
import { HumanMessage } from "@langchain/core/messages";
|
import { HumanMessage } from '@langchain/core/messages'
|
||||||
import {
|
import { ChatPromptTemplate, FewShotPromptTemplate, HumanMessagePromptTemplate, PromptTemplate } from '@langchain/core/prompts'
|
||||||
ChatPromptTemplate,
|
import { OutputFixingParser } from 'langchain/output_parsers'
|
||||||
FewShotPromptTemplate,
|
import { LLMChain } from 'langchain/chains'
|
||||||
HumanMessagePromptTemplate,
|
import { ICommonObject, INode, INodeData, INodeOutputsValue, INodeParams } from '../../../src/Interface'
|
||||||
PromptTemplate
|
import { additionalCallbacks, ConsoleCallbackHandler, CustomChainHandler } from '../../../src/handler'
|
||||||
} from "@langchain/core/prompts";
|
import { getBaseClasses, handleEscapeCharacters } from '../../../src/utils'
|
||||||
import { OutputFixingParser } from "langchain/output_parsers";
|
import { checkInputs, Moderation, streamResponse } from '../../moderation/Moderation'
|
||||||
import { LLMChain } from "langchain/chains";
|
import { formatResponse, injectOutputParser } from '../../outputparsers/OutputParserHelpers'
|
||||||
import { ICommonObject, INode, INodeData, INodeOutputsValue, INodeParams } from "../../../src/Interface";
|
import { ChatOpenAI } from '../../chatmodels/ChatOpenAI/FlowiseChatOpenAI'
|
||||||
import { additionalCallbacks, ConsoleCallbackHandler, CustomChainHandler } from "../../../src/handler";
|
import { addImagesToMessages, llmSupportsVision } from '../../../src/multiModalUtils'
|
||||||
import { getBaseClasses, handleEscapeCharacters } from "../../../src/utils";
|
import { IVisionChatModal } from '../../../src/IVisionChatModal'
|
||||||
import { checkInputs, Moderation, streamResponse } from "../../moderation/Moderation";
|
|
||||||
import { formatResponse, injectOutputParser } from "../../outputparsers/OutputParserHelpers";
|
|
||||||
import { ChatOpenAI } from "../../chatmodels/ChatOpenAI/FlowiseChatOpenAI";
|
|
||||||
import { addImagesToMessages, llmSupportsVision } from "../../../src/multiModalUtils";
|
|
||||||
import { IVisionChatModal } from "../../../src/IVisionChatModal";
|
|
||||||
|
|
||||||
class LLMChain_Chains implements INode {
|
class LLMChain_Chains implements INode {
|
||||||
label: string
|
label: string
|
||||||
|
|||||||
@@ -103,38 +103,6 @@ class AzureChatOpenAI_ChatModels implements INode {
|
|||||||
step: 1,
|
step: 1,
|
||||||
optional: true,
|
optional: true,
|
||||||
additionalParams: true
|
additionalParams: true
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// label: 'Allow Image Uploads',
|
|
||||||
// name: 'allowImageUploads',
|
|
||||||
// type: 'boolean',
|
|
||||||
// description:
|
|
||||||
// 'Automatically uses gpt-4-vision-preview when image is being uploaded from chat. Only works with LLMChain, Conversation Chain, ReAct Agent, and Conversational Agent',
|
|
||||||
// default: false,
|
|
||||||
// optional: true
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// label: 'Image Resolution',
|
|
||||||
// description: 'This parameter controls the resolution in which the model views the image.',
|
|
||||||
// name: 'imageResolution',
|
|
||||||
// type: 'options',
|
|
||||||
// options: [
|
|
||||||
// {
|
|
||||||
// label: 'Low',
|
|
||||||
// name: 'low'
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// label: 'High',
|
|
||||||
// name: 'high'
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// label: 'Auto',
|
|
||||||
// name: 'auto'
|
|
||||||
// }
|
|
||||||
// ],
|
|
||||||
// default: 'low',
|
|
||||||
// optional: false,
|
|
||||||
// additionalParams: true
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -155,9 +123,6 @@ class AzureChatOpenAI_ChatModels implements INode {
|
|||||||
const azureOpenAIApiDeploymentName = getCredentialParam('azureOpenAIApiDeploymentName', credentialData, nodeData)
|
const azureOpenAIApiDeploymentName = getCredentialParam('azureOpenAIApiDeploymentName', credentialData, nodeData)
|
||||||
const azureOpenAIApiVersion = getCredentialParam('azureOpenAIApiVersion', credentialData, nodeData)
|
const azureOpenAIApiVersion = getCredentialParam('azureOpenAIApiVersion', credentialData, nodeData)
|
||||||
|
|
||||||
// const allowImageUploads = nodeData.inputs?.allowImageUploads as boolean
|
|
||||||
// const imageResolution = nodeData.inputs?.imageResolution as string
|
|
||||||
|
|
||||||
const obj: Partial<AzureOpenAIInput> & BaseLLMParams & Partial<OpenAIChatInput> = {
|
const obj: Partial<AzureOpenAIInput> & BaseLLMParams & Partial<OpenAIChatInput> = {
|
||||||
temperature: parseFloat(temperature),
|
temperature: parseFloat(temperature),
|
||||||
modelName,
|
modelName,
|
||||||
@@ -176,7 +141,7 @@ class AzureChatOpenAI_ChatModels implements INode {
|
|||||||
|
|
||||||
const multiModalOption: IMultiModalOption = {
|
const multiModalOption: IMultiModalOption = {
|
||||||
image: {
|
image: {
|
||||||
allowImageUploads: false,
|
allowImageUploads: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user