mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 13:00:56 +03:00
Chore/upgrade llamaindex version (#2440)
* updates to loader to support file upload * adding a todo * upgrade llamaindex * update groq icon * update azure models * update llamaindex version --------- Co-authored-by: Henry <hzj94@hotmail.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { FlowiseMemory, ICommonObject, IMessage, INode, INodeData, INodeOutputsValue, INodeParams } from '../../../src/Interface'
|
||||
import { BaseNode, Metadata, BaseRetriever, LLM, ContextChatEngine, ChatMessage } from 'llamaindex'
|
||||
import { Metadata, BaseRetriever, LLM, ContextChatEngine, ChatMessage, NodeWithScore } from 'llamaindex'
|
||||
import { reformatSourceDocuments } from '../EngineUtils'
|
||||
|
||||
class ContextChatEngine_LlamaIndex implements INode {
|
||||
@@ -102,7 +102,7 @@ class ContextChatEngine_LlamaIndex implements INode {
|
||||
let text = ''
|
||||
let isStreamingStarted = false
|
||||
let sourceDocuments: ICommonObject[] = []
|
||||
let sourceNodes: BaseNode<Metadata>[] = []
|
||||
let sourceNodes: NodeWithScore<Metadata>[] = []
|
||||
const isStreamingEnabled = options.socketIO && options.socketIOClientId
|
||||
|
||||
if (isStreamingEnabled) {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { BaseNode, Metadata } from 'llamaindex'
|
||||
import { Metadata, NodeWithScore } from 'llamaindex'
|
||||
|
||||
export const reformatSourceDocuments = (sourceNodes: BaseNode<Metadata>[]) => {
|
||||
export const reformatSourceDocuments = (sourceNodes: NodeWithScore<Metadata>[]) => {
|
||||
const sourceDocuments = []
|
||||
for (const node of sourceNodes) {
|
||||
sourceDocuments.push({
|
||||
pageContent: (node as any).text,
|
||||
metadata: node.metadata
|
||||
pageContent: (node.node as any).text,
|
||||
metadata: node.node.metadata
|
||||
})
|
||||
}
|
||||
return sourceDocuments
|
||||
|
||||
@@ -6,8 +6,8 @@ import {
|
||||
TreeSummarize,
|
||||
Refine,
|
||||
SimpleResponseBuilder,
|
||||
BaseNode,
|
||||
Metadata
|
||||
Metadata,
|
||||
NodeWithScore
|
||||
} from 'llamaindex'
|
||||
import { reformatSourceDocuments } from '../EngineUtils'
|
||||
|
||||
@@ -69,7 +69,7 @@ class QueryEngine_LlamaIndex implements INode {
|
||||
|
||||
let text = ''
|
||||
let sourceDocuments: ICommonObject[] = []
|
||||
let sourceNodes: BaseNode<Metadata>[] = []
|
||||
let sourceNodes: NodeWithScore<Metadata>[] = []
|
||||
let isStreamingStarted = false
|
||||
const isStreamingEnabled = options.socketIO && options.socketIOClientId
|
||||
|
||||
|
||||
@@ -10,9 +10,9 @@ import {
|
||||
QueryEngineTool,
|
||||
LLMQuestionGenerator,
|
||||
SubQuestionQueryEngine,
|
||||
BaseNode,
|
||||
Metadata,
|
||||
serviceContextFromDefaults
|
||||
serviceContextFromDefaults,
|
||||
NodeWithScore
|
||||
} from 'llamaindex'
|
||||
import { reformatSourceDocuments } from '../EngineUtils'
|
||||
|
||||
@@ -86,7 +86,7 @@ class SubQuestionQueryEngine_LlamaIndex implements INode {
|
||||
|
||||
let text = ''
|
||||
let sourceDocuments: ICommonObject[] = []
|
||||
let sourceNodes: BaseNode<Metadata>[] = []
|
||||
let sourceNodes: NodeWithScore<Metadata>[] = []
|
||||
let isStreamingStarted = false
|
||||
const isStreamingEnabled = options.socketIO && options.socketIOClientId
|
||||
|
||||
|
||||
Reference in New Issue
Block a user