Feature/Add Neo4j GraphRag support (#3686)

* added: Neo4j database connectivity, Neo4j credentials, supports the usage of the GraphCypherQaChain node and modifies the FewShotPromptTemplate node to handle variables from the prefix field.

* Merge branch 'main' of github.com:FlowiseAI/Flowise into feature/graphragsupport

* revert pnpm-lock.yaml

* add: neo4j package

* Refactor GraphCypherQAChain: Update version to 1.0, remove memory input, and enhance prompt handling

- Changed version from 2.0 to 1.0.
- Removed the 'Memory' input parameter from the GraphCypherQAChain.
- Made 'cypherPrompt' optional and improved error handling for prompt validation.
- Updated the 'init' and 'run' methods to streamline input processing and response handling.
- Enhanced streaming response logic based on the 'returnDirect' flag.

* Refactor GraphCypherQAChain: Simplify imports and update init method signature

- Consolidated import statements for better readability.
- Removed the 'input' and 'options' parameters from the 'init' method, streamlining its signature to only accept 'nodeData'.

* add output, format final response, fix optional inputs

---------

Co-authored-by: Henry <hzj94@hotmail.com>
This commit is contained in:
Anthony Bryan Gavilan Vinces
2024-12-22 20:35:53 -05:00
committed by GitHub
parent 93f3a5d98a
commit a7c1ab881c
8 changed files with 34468 additions and 34040 deletions
@@ -86,7 +86,7 @@ class FewShotPromptTemplate_Prompts implements INode {
const templateFormat = nodeData.inputs?.templateFormat as TemplateFormat
const examplePrompt = nodeData.inputs?.examplePrompt as PromptTemplate
const inputVariables = getInputVariables(suffix)
const inputVariables = [...new Set([...getInputVariables(suffix), ...getInputVariables(prefix)])]
let examples: Example[] = []
if (examplesStr) {