mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 15:00:57 +03:00
fix for concurrency
This commit is contained in:
@@ -21,6 +21,8 @@ export type CommonType = string | number | boolean | undefined | null
|
||||
|
||||
export type MessageType = 'apiMessage' | 'userMessage'
|
||||
|
||||
export type ImageDetail = 'auto' | 'low' | 'high'
|
||||
|
||||
/**
|
||||
* Others
|
||||
*/
|
||||
@@ -158,6 +160,21 @@ export interface IMultiModalOption {
|
||||
audio?: Record<string, any>
|
||||
}
|
||||
|
||||
export type MessageContentText = {
|
||||
type: 'text'
|
||||
text: string
|
||||
}
|
||||
|
||||
export type MessageContentImageUrl = {
|
||||
type: 'image_url'
|
||||
image_url:
|
||||
| string
|
||||
| {
|
||||
url: string
|
||||
detail?: ImageDetail
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Classes
|
||||
*/
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import { ICommonObject, IFileUpload, IMultiModalOption, INodeData } from './Interface'
|
||||
import { ICommonObject, IFileUpload, IMultiModalOption, INodeData, MessageContentImageUrl } from './Interface'
|
||||
import { BaseChatModel } from 'langchain/chat_models/base'
|
||||
import { ChatOpenAI as LangchainChatOpenAI } from 'langchain/chat_models/openai'
|
||||
import path from 'path'
|
||||
import { getStoragePath } from './utils'
|
||||
import fs from 'fs'
|
||||
import { MessageContent } from '@langchain/core/dist/messages'
|
||||
import { ChatOpenAI } from '../nodes/chatmodels/ChatOpenAI/FlowiseChatOpenAI'
|
||||
|
||||
export const injectChainNodeData = (nodeData: INodeData, options: ICommonObject) => {
|
||||
@@ -16,8 +15,12 @@ export const injectChainNodeData = (nodeData: INodeData, options: ICommonObject)
|
||||
}
|
||||
}
|
||||
|
||||
export const addImagesToMessages = (nodeData: INodeData, options: ICommonObject, multiModalOption?: IMultiModalOption): MessageContent => {
|
||||
const imageContent: MessageContent = []
|
||||
export const addImagesToMessages = (
|
||||
nodeData: INodeData,
|
||||
options: ICommonObject,
|
||||
multiModalOption?: IMultiModalOption
|
||||
): MessageContentImageUrl[] => {
|
||||
const imageContent: MessageContentImageUrl[] = []
|
||||
let model = nodeData.inputs?.model
|
||||
|
||||
if (model instanceof LangchainChatOpenAI && multiModalOption) {
|
||||
|
||||
Reference in New Issue
Block a user