mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-22 21:01:17 +03:00
ff2381741e
* 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>
13 lines
376 B
TypeScript
13 lines
376 B
TypeScript
import { Metadata, NodeWithScore } from 'llamaindex'
|
|
|
|
export const reformatSourceDocuments = (sourceNodes: NodeWithScore<Metadata>[]) => {
|
|
const sourceDocuments = []
|
|
for (const node of sourceNodes) {
|
|
sourceDocuments.push({
|
|
pageContent: (node.node as any).text,
|
|
metadata: node.node.metadata
|
|
})
|
|
}
|
|
return sourceDocuments
|
|
}
|