mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 17:01:00 +03:00
add debug
This commit is contained in:
@@ -0,0 +1 @@
|
|||||||
|
DEBUG=true
|
||||||
@@ -12,6 +12,14 @@ Install:
|
|||||||
npm i flowise-components
|
npm i flowise-components
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Debug
|
||||||
|
|
||||||
|
To view all the logs, create an `.env` file and add:
|
||||||
|
|
||||||
|
```
|
||||||
|
DEBUG=true
|
||||||
|
```
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
Source code in this repository is made available under the [MIT License](https://github.com/FlowiseAI/Flowise/blob/master/LICENSE.md).
|
Source code in this repository is made available under the [MIT License](https://github.com/FlowiseAI/Flowise/blob/master/LICENSE.md).
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ class ConversationalAgent_Agents implements INode {
|
|||||||
|
|
||||||
const obj: InitializeAgentExecutorOptions = {
|
const obj: InitializeAgentExecutorOptions = {
|
||||||
agentType: 'chat-conversational-react-description',
|
agentType: 'chat-conversational-react-description',
|
||||||
verbose: true
|
verbose: process.env.DEBUG === 'true' ? true : false
|
||||||
}
|
}
|
||||||
|
|
||||||
const agentArgs: any = {}
|
const agentArgs: any = {}
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ class MRKLAgentChat_Agents implements INode {
|
|||||||
tools = tools.flat()
|
tools = tools.flat()
|
||||||
const executor = await initializeAgentExecutorWithOptions(tools, model, {
|
const executor = await initializeAgentExecutorWithOptions(tools, model, {
|
||||||
agentType: 'chat-zero-shot-react-description',
|
agentType: 'chat-zero-shot-react-description',
|
||||||
verbose: true
|
verbose: process.env.DEBUG === 'true' ? true : false
|
||||||
})
|
})
|
||||||
return executor
|
return executor
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ class MRKLAgentLLM_Agents implements INode {
|
|||||||
|
|
||||||
const executor = await initializeAgentExecutorWithOptions(tools, model, {
|
const executor = await initializeAgentExecutorWithOptions(tools, model, {
|
||||||
agentType: 'zero-shot-react-description',
|
agentType: 'zero-shot-react-description',
|
||||||
verbose: true
|
verbose: process.env.DEBUG === 'true' ? true : false
|
||||||
})
|
})
|
||||||
return executor
|
return executor
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-1
@@ -40,7 +40,9 @@ class ConversationalRetrievalQAChain_Chains implements INode {
|
|||||||
const model = nodeData.inputs?.model as BaseLanguageModel
|
const model = nodeData.inputs?.model as BaseLanguageModel
|
||||||
const vectorStoreRetriever = nodeData.inputs?.vectorStoreRetriever as BaseRetriever
|
const vectorStoreRetriever = nodeData.inputs?.vectorStoreRetriever as BaseRetriever
|
||||||
|
|
||||||
const chain = ConversationalRetrievalQAChain.fromLLM(model, vectorStoreRetriever)
|
const chain = ConversationalRetrievalQAChain.fromLLM(model, vectorStoreRetriever, {
|
||||||
|
verbose: process.env.DEBUG === 'true' ? true : false
|
||||||
|
})
|
||||||
return chain
|
return chain
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -62,10 +62,10 @@ class LLMChain_Chains implements INode {
|
|||||||
const promptValues = prompt.promptValues as ICommonObject
|
const promptValues = prompt.promptValues as ICommonObject
|
||||||
|
|
||||||
if (output === this.name) {
|
if (output === this.name) {
|
||||||
const chain = new LLMChain({ llm: model, prompt })
|
const chain = new LLMChain({ llm: model, prompt, verbose: process.env.DEBUG === 'true' ? true : false })
|
||||||
return chain
|
return chain
|
||||||
} else if (output === 'outputPrediction') {
|
} else if (output === 'outputPrediction') {
|
||||||
const chain = new LLMChain({ llm: model, prompt })
|
const chain = new LLMChain({ llm: model, prompt, verbose: process.env.DEBUG === 'true' ? true : false })
|
||||||
const inputVariables = chain.prompt.inputVariables as string[] // ["product"]
|
const inputVariables = chain.prompt.inputVariables as string[] // ["product"]
|
||||||
const res = await runPrediction(inputVariables, chain, input, promptValues)
|
const res = await runPrediction(inputVariables, chain, input, promptValues)
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ class RetrievalQAChain_Chains implements INode {
|
|||||||
const model = nodeData.inputs?.model as BaseLanguageModel
|
const model = nodeData.inputs?.model as BaseLanguageModel
|
||||||
const vectorStoreRetriever = nodeData.inputs?.vectorStoreRetriever as BaseRetriever
|
const vectorStoreRetriever = nodeData.inputs?.vectorStoreRetriever as BaseRetriever
|
||||||
|
|
||||||
const chain = RetrievalQAChain.fromLLM(model, vectorStoreRetriever)
|
const chain = RetrievalQAChain.fromLLM(model, vectorStoreRetriever, { verbose: process.env.DEBUG === 'true' ? true : false })
|
||||||
return chain
|
return chain
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -82,7 +82,8 @@ const getSQLDBChain = async (databaseType: 'sqlite', dbFilePath: string, llm: Ba
|
|||||||
|
|
||||||
const obj: SqlDatabaseChainInput = {
|
const obj: SqlDatabaseChainInput = {
|
||||||
llm,
|
llm,
|
||||||
database: db
|
database: db,
|
||||||
|
verbose: process.env.DEBUG === 'true' ? true : false
|
||||||
}
|
}
|
||||||
|
|
||||||
const chain = new SqlDatabaseChain(obj)
|
const chain = new SqlDatabaseChain(obj)
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ class VectorDBQAChain_Chains implements INode {
|
|||||||
const model = nodeData.inputs?.model as BaseLanguageModel
|
const model = nodeData.inputs?.model as BaseLanguageModel
|
||||||
const vectorStore = nodeData.inputs?.vectorStore as VectorStore
|
const vectorStore = nodeData.inputs?.vectorStore as VectorStore
|
||||||
|
|
||||||
const chain = VectorDBQAChain.fromLLM(model, vectorStore)
|
const chain = VectorDBQAChain.fromLLM(model, vectorStore, { verbose: process.env.DEBUG === 'true' ? true : false })
|
||||||
return chain
|
return chain
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
"express": "^4.17.3",
|
"express": "^4.17.3",
|
||||||
"form-data": "^4.0.0",
|
"form-data": "^4.0.0",
|
||||||
"graphql": "^16.6.0",
|
"graphql": "^16.6.0",
|
||||||
"langchain": "^0.0.73",
|
"langchain": "^0.0.78",
|
||||||
"linkifyjs": "^4.1.1",
|
"linkifyjs": "^4.1.1",
|
||||||
"mammoth": "^1.5.1",
|
"mammoth": "^1.5.1",
|
||||||
"moment": "^2.29.3",
|
"moment": "^2.29.3",
|
||||||
|
|||||||
@@ -1,2 +1,8 @@
|
|||||||
|
import dotenv from 'dotenv'
|
||||||
|
import path from 'path'
|
||||||
|
|
||||||
|
const envPath = path.join(__dirname, '..', '..', '.env')
|
||||||
|
dotenv.config({ path: envPath })
|
||||||
|
|
||||||
export * from './Interface'
|
export * from './Interface'
|
||||||
export * from './utils'
|
export * from './utils'
|
||||||
|
|||||||
Reference in New Issue
Block a user