374 lines
15 KiB
JSON
374 lines
15 KiB
JSON
{
|
|
"nodes": [
|
|
{
|
|
"id": "groqChat_0",
|
|
"position": {
|
|
"x": -853.9751777873863,
|
|
"y": 729.9149966558168
|
|
},
|
|
"type": "customNode",
|
|
"data": {
|
|
"id": "groqChat_0",
|
|
"label": "GroqChat",
|
|
"version": 3,
|
|
"name": "groqChat",
|
|
"type": "GroqChat",
|
|
"baseClasses": [
|
|
"GroqChat",
|
|
"BaseChatModel",
|
|
"BaseLanguageModel",
|
|
"Runnable"
|
|
],
|
|
"category": "Chat Models",
|
|
"description": "Wrapper around Groq API with LPU Inference Engine",
|
|
"inputParams": [
|
|
{
|
|
"label": "Connect Credential",
|
|
"name": "credential",
|
|
"type": "credential",
|
|
"credentialNames": [
|
|
"groqApi"
|
|
],
|
|
"optional": true,
|
|
"id": "groqChat_0-input-credential-credential"
|
|
},
|
|
{
|
|
"label": "Model Name",
|
|
"name": "modelName",
|
|
"type": "asyncOptions",
|
|
"loadMethod": "listModels",
|
|
"placeholder": "llama3-70b-8192",
|
|
"id": "groqChat_0-input-modelName-asyncOptions"
|
|
},
|
|
{
|
|
"label": "Temperature",
|
|
"name": "temperature",
|
|
"type": "number",
|
|
"step": 0.1,
|
|
"default": 0.9,
|
|
"optional": true,
|
|
"id": "groqChat_0-input-temperature-number"
|
|
}
|
|
],
|
|
"inputAnchors": [
|
|
{
|
|
"label": "Cache",
|
|
"name": "cache",
|
|
"type": "BaseCache",
|
|
"optional": true,
|
|
"id": "groqChat_0-input-cache-BaseCache"
|
|
}
|
|
],
|
|
"inputs": {
|
|
"cache": "",
|
|
"modelName": "meta-llama/llama-4-scout-17b-16e-instruct",
|
|
"temperature": "0.3"
|
|
},
|
|
"outputAnchors": [
|
|
{
|
|
"id": "groqChat_0-output-groqChat-GroqChat|BaseChatModel|BaseLanguageModel|Runnable",
|
|
"name": "groqChat",
|
|
"label": "GroqChat",
|
|
"description": "Wrapper around Groq API with LPU Inference Engine",
|
|
"type": "GroqChat | BaseChatModel | BaseLanguageModel | Runnable"
|
|
}
|
|
],
|
|
"outputs": {},
|
|
"selected": false
|
|
},
|
|
"width": 300,
|
|
"height": 521,
|
|
"selected": false,
|
|
"positionAbsolute": {
|
|
"x": -853.9751777873863,
|
|
"y": 729.9149966558168
|
|
},
|
|
"dragging": false
|
|
},
|
|
{
|
|
"id": "bufferWindowMemory_0",
|
|
"position": {
|
|
"x": -462.951092583539,
|
|
"y": 592.4237789688921
|
|
},
|
|
"type": "customNode",
|
|
"data": {
|
|
"id": "bufferWindowMemory_0",
|
|
"label": "Buffer Window Memory",
|
|
"version": 2,
|
|
"name": "bufferWindowMemory",
|
|
"type": "BufferWindowMemory",
|
|
"baseClasses": [
|
|
"BufferWindowMemory",
|
|
"BaseChatMemory",
|
|
"BaseMemory"
|
|
],
|
|
"category": "Memory",
|
|
"description": "Uses a window of size k to surface the last k back-and-forth to use as memory",
|
|
"inputParams": [
|
|
{
|
|
"label": "Size",
|
|
"name": "k",
|
|
"type": "number",
|
|
"default": "4",
|
|
"description": "Window of size k to surface the last k back-and-forth to use as memory.",
|
|
"id": "bufferWindowMemory_0-input-k-number"
|
|
},
|
|
{
|
|
"label": "Session Id",
|
|
"name": "sessionId",
|
|
"type": "string",
|
|
"description": "If not specified, a random id will be used. Learn <a target=\"_blank\" href=\"https://docs.flowiseai.com/memory#ui-and-embedded-chat\">more</a>",
|
|
"default": "",
|
|
"optional": true,
|
|
"additionalParams": true,
|
|
"id": "bufferWindowMemory_0-input-sessionId-string"
|
|
},
|
|
{
|
|
"label": "Memory Key",
|
|
"name": "memoryKey",
|
|
"type": "string",
|
|
"default": "chat_history",
|
|
"additionalParams": true,
|
|
"id": "bufferWindowMemory_0-input-memoryKey-string"
|
|
}
|
|
],
|
|
"inputAnchors": [],
|
|
"inputs": {
|
|
"k": "5",
|
|
"sessionId": "",
|
|
"memoryKey": "chat_history"
|
|
},
|
|
"outputAnchors": [
|
|
{
|
|
"id": "bufferWindowMemory_0-output-bufferWindowMemory-BufferWindowMemory|BaseChatMemory|BaseMemory",
|
|
"name": "bufferWindowMemory",
|
|
"label": "BufferWindowMemory",
|
|
"description": "Uses a window of size k to surface the last k back-and-forth to use as memory",
|
|
"type": "BufferWindowMemory | BaseChatMemory | BaseMemory"
|
|
}
|
|
],
|
|
"outputs": {},
|
|
"selected": false
|
|
},
|
|
"width": 300,
|
|
"height": 331,
|
|
"positionAbsolute": {
|
|
"x": -462.951092583539,
|
|
"y": 592.4237789688921
|
|
},
|
|
"selected": false,
|
|
"dragging": false
|
|
},
|
|
{
|
|
"id": "documentStoreVS_0",
|
|
"position": {
|
|
"x": -502.4400397551632,
|
|
"y": 1058.8723425753983
|
|
},
|
|
"type": "customNode",
|
|
"data": {
|
|
"id": "documentStoreVS_0",
|
|
"label": "Document Store (Vector)",
|
|
"version": 1,
|
|
"name": "documentStoreVS",
|
|
"type": "DocumentStoreVS",
|
|
"baseClasses": [
|
|
"DocumentStoreVS"
|
|
],
|
|
"category": "Vector Stores",
|
|
"description": "Search and retrieve documents from Document Store",
|
|
"inputParams": [
|
|
{
|
|
"label": "Select Store",
|
|
"name": "selectedStore",
|
|
"type": "asyncOptions",
|
|
"loadMethod": "listStores",
|
|
"id": "documentStoreVS_0-input-selectedStore-asyncOptions"
|
|
}
|
|
],
|
|
"inputAnchors": [],
|
|
"inputs": {
|
|
"selectedStore": "ed308d4d-bb05-480c-b399-d17edf5c0302"
|
|
},
|
|
"outputAnchors": [
|
|
{
|
|
"name": "output",
|
|
"label": "Output",
|
|
"type": "options",
|
|
"description": "",
|
|
"options": [
|
|
{
|
|
"id": "documentStoreVS_0-output-retriever-BaseRetriever",
|
|
"name": "retriever",
|
|
"label": "Retriever",
|
|
"description": "",
|
|
"type": "BaseRetriever"
|
|
},
|
|
{
|
|
"id": "documentStoreVS_0-output-vectorStore-VectorStore",
|
|
"name": "vectorStore",
|
|
"label": "Vector Store",
|
|
"description": "",
|
|
"type": "VectorStore"
|
|
}
|
|
],
|
|
"default": "retriever"
|
|
}
|
|
],
|
|
"outputs": {
|
|
"output": "retriever"
|
|
},
|
|
"selected": false
|
|
},
|
|
"width": 300,
|
|
"height": 312,
|
|
"positionAbsolute": {
|
|
"x": -502.4400397551632,
|
|
"y": 1058.8723425753983
|
|
},
|
|
"selected": false,
|
|
"dragging": false
|
|
},
|
|
{
|
|
"id": "conversationalRetrievalQAChain_0",
|
|
"position": {
|
|
"x": -74.84182984134901,
|
|
"y": 846.5506790761656
|
|
},
|
|
"type": "customNode",
|
|
"data": {
|
|
"id": "conversationalRetrievalQAChain_0",
|
|
"label": "Conversational Retrieval QA Chain",
|
|
"version": 3,
|
|
"name": "conversationalRetrievalQAChain",
|
|
"type": "ConversationalRetrievalQAChain",
|
|
"baseClasses": [
|
|
"ConversationalRetrievalQAChain",
|
|
"BaseChain",
|
|
"Runnable"
|
|
],
|
|
"category": "Chains",
|
|
"description": "Document QA - built on RetrievalQAChain to provide a chat history component",
|
|
"inputParams": [
|
|
{
|
|
"label": "Return Source Documents",
|
|
"name": "returnSourceDocuments",
|
|
"type": "boolean",
|
|
"optional": true,
|
|
"id": "conversationalRetrievalQAChain_0-input-returnSourceDocuments-boolean"
|
|
},
|
|
{
|
|
"label": "Rephrase Prompt",
|
|
"name": "rephrasePrompt",
|
|
"type": "string",
|
|
"description": "Using previous chat history, rephrase question into a standalone question",
|
|
"warning": "Prompt must include input variables: {chat_history} and {question}",
|
|
"rows": 4,
|
|
"additionalParams": true,
|
|
"optional": true,
|
|
"default": "Given the following conversation and a follow up question, rephrase the follow up question to be a standalone question.\n\nChat History:\n{chat_history}\nFollow Up Input: {question}\nStandalone Question:",
|
|
"id": "conversationalRetrievalQAChain_0-input-rephrasePrompt-string"
|
|
},
|
|
{
|
|
"label": "Response Prompt",
|
|
"name": "responsePrompt",
|
|
"type": "string",
|
|
"description": "Taking the rephrased question, search for answer from the provided context",
|
|
"warning": "Prompt must include input variable: {context}",
|
|
"rows": 4,
|
|
"additionalParams": true,
|
|
"optional": true,
|
|
"default": "I want you to act as a document that I am having a conversation with. Your name is \"AI Assistant\". Using the provided context, answer the user's question to the best of your ability using the resources provided.\nIf there is nothing in the context relevant to the question at hand, just say \"Hmm, I'm not sure\" and stop after that. Refuse to answer any question not about the info. Never break character.\n------------\n{context}\n------------\nREMEMBER: If there is no relevant information within the context, just say \"Hmm, I'm not sure\". Don't try to make up an answer. Never break character.",
|
|
"id": "conversationalRetrievalQAChain_0-input-responsePrompt-string"
|
|
}
|
|
],
|
|
"inputAnchors": [
|
|
{
|
|
"label": "Chat Model",
|
|
"name": "model",
|
|
"type": "BaseChatModel",
|
|
"id": "conversationalRetrievalQAChain_0-input-model-BaseChatModel"
|
|
},
|
|
{
|
|
"label": "Vector Store Retriever",
|
|
"name": "vectorStoreRetriever",
|
|
"type": "BaseRetriever",
|
|
"id": "conversationalRetrievalQAChain_0-input-vectorStoreRetriever-BaseRetriever"
|
|
},
|
|
{
|
|
"label": "Memory",
|
|
"name": "memory",
|
|
"type": "BaseMemory",
|
|
"optional": true,
|
|
"description": "If left empty, a default BufferMemory will be used",
|
|
"id": "conversationalRetrievalQAChain_0-input-memory-BaseMemory"
|
|
},
|
|
{
|
|
"label": "Input Moderation",
|
|
"description": "Detect text that could generate harmful output and prevent it from being sent to the language model",
|
|
"name": "inputModeration",
|
|
"type": "Moderation",
|
|
"optional": true,
|
|
"list": true,
|
|
"id": "conversationalRetrievalQAChain_0-input-inputModeration-Moderation"
|
|
}
|
|
],
|
|
"inputs": {
|
|
"model": "{{groqChat_0.data.instance}}",
|
|
"vectorStoreRetriever": "{{documentStoreVS_0.data.instance}}",
|
|
"memory": "{{bufferWindowMemory_0.data.instance}}",
|
|
"returnSourceDocuments": false,
|
|
"rephrasePrompt": "Given the following conversation and a follow up question, rephrase the follow up question to be a standalone question.\n\nChat History:\n{chat_history}\nFollow Up Input: {question}\nStandalone Question:",
|
|
"responsePrompt": "I want you to act as a technical support person for ROA, an ERP developed by Romfast company. You have access to the documents from your context, Your name is \"Maria\". Using the provided context and your general knowledge, answer the user's question to the best of your ability using the resources provided. I want you to give the answer for the program users, nontechnical, not for the programmer. I don't want to solve program errors, but to help users to solve their problems.\nKeep the answer as short as possible, but descriptive. Don't repeat the problem in your answer. You can make light jokes and greet people in funny ways. Never break character. don't greet the user on every message.\n------------\n{context}\n------------\nREMEMBER: If there is no relevant information within the context, just say \"Hmm, nu am informații despre acest subiect.\" and ask the user if he wishes for you to try to answer anyway. Don't try to make up an answer. Don't make up answers that aren't in the context. Never break character, unless the user writes the secret password: mariamaria\n\nAnswer only in Romanian and writes all the answers without diacritics. Write without diacritics and for the answers from the knowledge database.",
|
|
"inputModeration": ""
|
|
},
|
|
"outputAnchors": [
|
|
{
|
|
"id": "conversationalRetrievalQAChain_0-output-conversationalRetrievalQAChain-ConversationalRetrievalQAChain|BaseChain|Runnable",
|
|
"name": "conversationalRetrievalQAChain",
|
|
"label": "ConversationalRetrievalQAChain",
|
|
"description": "Document QA - built on RetrievalQAChain to provide a chat history component",
|
|
"type": "ConversationalRetrievalQAChain | BaseChain | Runnable"
|
|
}
|
|
],
|
|
"outputs": {},
|
|
"selected": false
|
|
},
|
|
"width": 300,
|
|
"height": 532,
|
|
"selected": false,
|
|
"dragging": false,
|
|
"positionAbsolute": {
|
|
"x": -74.84182984134901,
|
|
"y": 846.5506790761656
|
|
}
|
|
}
|
|
],
|
|
"edges": [
|
|
{
|
|
"source": "documentStoreVS_0",
|
|
"sourceHandle": "documentStoreVS_0-output-retriever-BaseRetriever",
|
|
"target": "conversationalRetrievalQAChain_0",
|
|
"targetHandle": "conversationalRetrievalQAChain_0-input-vectorStoreRetriever-BaseRetriever",
|
|
"type": "buttonedge",
|
|
"id": "documentStoreVS_0-documentStoreVS_0-output-retriever-BaseRetriever-conversationalRetrievalQAChain_0-conversationalRetrievalQAChain_0-input-vectorStoreRetriever-BaseRetriever"
|
|
},
|
|
{
|
|
"source": "bufferWindowMemory_0",
|
|
"sourceHandle": "bufferWindowMemory_0-output-bufferWindowMemory-BufferWindowMemory|BaseChatMemory|BaseMemory",
|
|
"target": "conversationalRetrievalQAChain_0",
|
|
"targetHandle": "conversationalRetrievalQAChain_0-input-memory-BaseMemory",
|
|
"type": "buttonedge",
|
|
"id": "bufferWindowMemory_0-bufferWindowMemory_0-output-bufferWindowMemory-BufferWindowMemory|BaseChatMemory|BaseMemory-conversationalRetrievalQAChain_0-conversationalRetrievalQAChain_0-input-memory-BaseMemory"
|
|
},
|
|
{
|
|
"source": "groqChat_0",
|
|
"sourceHandle": "groqChat_0-output-groqChat-GroqChat|BaseChatModel|BaseLanguageModel|Runnable",
|
|
"target": "conversationalRetrievalQAChain_0",
|
|
"targetHandle": "conversationalRetrievalQAChain_0-input-model-BaseChatModel",
|
|
"type": "buttonedge",
|
|
"id": "groqChat_0-groqChat_0-output-groqChat-GroqChat|BaseChatModel|BaseLanguageModel|Runnable-conversationalRetrievalQAChain_0-conversationalRetrievalQAChain_0-input-model-BaseChatModel"
|
|
}
|
|
]
|
|
} |