Merge pull request #1611 from FlowiseAI/feature/LlamaIndex

Feature/llama index
This commit is contained in:
Henry Heng
2024-02-02 20:00:21 +00:00
committed by GitHub
44 changed files with 4048 additions and 75 deletions
+12 -2
View File
@@ -482,7 +482,12 @@ export class App {
const isEndingNode = endingNodeData?.outputs?.output === 'EndingNode'
if (!isEndingNode) {
if (endingNodeData && endingNodeData.category !== 'Chains' && endingNodeData.category !== 'Agents') {
if (
endingNodeData &&
endingNodeData.category !== 'Chains' &&
endingNodeData.category !== 'Agents' &&
endingNodeData.category !== 'Engine'
) {
return res.status(500).send(`Ending node must be either a Chain or Agent`)
}
}
@@ -1690,7 +1695,12 @@ export class App {
const isEndingNode = endingNodeData?.outputs?.output === 'EndingNode'
if (!isEndingNode) {
if (endingNodeData && endingNodeData.category !== 'Chains' && endingNodeData.category !== 'Agents') {
if (
endingNodeData &&
endingNodeData.category !== 'Chains' &&
endingNodeData.category !== 'Agents' &&
endingNodeData.category !== 'Engine'
) {
return res.status(500).send(`Ending node must be either a Chain or Agent`)
}
+13 -1
View File
@@ -818,7 +818,16 @@ export const findAvailableConfigs = (reactFlowNodes: IReactFlowNode[], component
*/
export const isFlowValidForStream = (reactFlowNodes: IReactFlowNode[], endingNodeData: INodeData) => {
const streamAvailableLLMs = {
'Chat Models': ['azureChatOpenAI', 'chatOpenAI', 'chatAnthropic', 'chatOllama', 'awsChatBedrock', 'chatMistralAI'],
'Chat Models': [
'azureChatOpenAI',
'chatOpenAI',
'chatOpenAI_LlamaIndex',
'chatAnthropic',
'chatAnthropic_LlamaIndex',
'chatOllama',
'awsChatBedrock',
'chatMistralAI'
],
LLMs: ['azureOpenAI', 'openAI', 'ollama']
}
@@ -841,6 +850,9 @@ export const isFlowValidForStream = (reactFlowNodes: IReactFlowNode[], endingNod
// Agent that are available to stream
const whitelistAgents = ['openAIFunctionAgent', 'csvAgent', 'airtableAgent', 'conversationalRetrievalAgent']
isValidChainOrAgent = whitelistAgents.includes(endingNodeData.name)
} else if (endingNodeData.category === 'Engine') {
const whitelistEngine = ['contextChatEngine', 'simpleChatEngine', 'queryEngine', 'subQuestionQueryEngine']
isValidChainOrAgent = whitelistEngine.includes(endingNodeData.name)
}
// If no output parser, flow is available to stream