Chore/Update langchain version, openai, mistral, vertex, anthropic (#2180)

* update langchain version, openai, mistral, vertex, anthropic, introduced toolagent

* upgrade @google/generative-ai 0.7.0, replicate and faiss-node

* update cohere ver

* adding chatCohere to streaming

* update gemini to have image upload

* update google genai, remove aiplugin
This commit is contained in:
Henry Heng
2024-04-20 02:20:30 +01:00
committed by GitHub
parent f5be889ea8
commit 95beaba9d9
27 changed files with 1541 additions and 1008 deletions
@@ -18,8 +18,8 @@ export const utilGetUploadsConfig = async (chatflowid: string): Promise<any> =>
throw new InternalFlowiseError(StatusCodes.NOT_FOUND, `Chatflow ${chatflowid} not found`)
}
const uploadAllowedNodes = ['llmChain', 'conversationChain', 'mrklAgentChat', 'conversationalAgent']
const uploadProcessingNodes = ['chatOpenAI', 'chatAnthropic', 'awsChatBedrock', 'azureChatOpenAI']
const uploadAllowedNodes = ['llmChain', 'conversationChain', 'reactAgentChat', 'conversationalAgent', 'toolAgent']
const uploadProcessingNodes = ['chatOpenAI', 'chatAnthropic', 'awsChatBedrock', 'azureChatOpenAI', 'chatGoogleGenerativeAI']
const flowObj = JSON.parse(chatflow.flowData)
const imgUploadSizeAndTypes: IUploadFileSizeAndTypes[] = []
+16 -2
View File
@@ -1022,7 +1022,9 @@ export const isFlowValidForStream = (reactFlowNodes: IReactFlowNode[], endingNod
'chatOllama',
'awsChatBedrock',
'chatMistralAI',
'groqChat'
'groqChat',
'chatCohere',
'chatGoogleGenerativeAI'
],
LLMs: ['azureOpenAI', 'openAI', 'ollama']
}
@@ -1050,10 +1052,22 @@ export const isFlowValidForStream = (reactFlowNodes: IReactFlowNode[], endingNod
'csvAgent',
'airtableAgent',
'conversationalRetrievalAgent',
'openAIToolAgent'
'openAIToolAgent',
'toolAgent'
]
isValidChainOrAgent = whitelistAgents.includes(endingNodeData.name)
// Anthropic & Groq Function Calling streaming is still not supported - https://docs.anthropic.com/claude/docs/tool-use
const model = endingNodeData.inputs?.model
if (endingNodeData.name.includes('toolAgent')) {
if (typeof model === 'string' && (model.includes('chatAnthropic') || model.includes('groqChat'))) {
return false
} else if (typeof model === 'object' && 'id' in model && model['id'].includes('chatAnthropic')) {
return false
}
}
} else if (endingNodeData.category === 'Engine') {
// Engines that are available to stream
const whitelistEngine = ['contextChatEngine', 'simpleChatEngine', 'queryEngine', 'subQuestionQueryEngine']
isValidChainOrAgent = whitelistEngine.includes(endingNodeData.name)
}