mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 15:00:57 +03:00
253 lines
9.7 KiB
JSON
253 lines
9.7 KiB
JSON
{
|
|
"description": "Basic example of LLM Chain with a Prompt Template and LLM Model",
|
|
"nodes": [
|
|
{
|
|
"width": 300,
|
|
"height": 472,
|
|
"id": "openAI_0",
|
|
"position": {
|
|
"x": 618,
|
|
"y": 97
|
|
},
|
|
"type": "customNode",
|
|
"data": {
|
|
"id": "openAI_0",
|
|
"label": "OpenAI",
|
|
"name": "openAI",
|
|
"type": "OpenAI",
|
|
"baseClasses": ["OpenAI", "BaseLLM", "BaseLanguageModel"],
|
|
"category": "LLMs",
|
|
"description": "Wrapper around OpenAI large language models",
|
|
"inputParams": [
|
|
{
|
|
"label": "OpenAI Api Key",
|
|
"name": "openAIApiKey",
|
|
"type": "password",
|
|
"id": "openAI_0-input-openAIApiKey-password"
|
|
},
|
|
{
|
|
"label": "Model Name",
|
|
"name": "modelName",
|
|
"type": "options",
|
|
"options": [
|
|
{
|
|
"label": "text-davinci-003",
|
|
"name": "text-davinci-003"
|
|
},
|
|
{
|
|
"label": "text-davinci-002",
|
|
"name": "text-davinci-002"
|
|
},
|
|
{
|
|
"label": "text-curie-001",
|
|
"name": "text-curie-001"
|
|
},
|
|
{
|
|
"label": "text-babbage-001",
|
|
"name": "text-babbage-001"
|
|
}
|
|
],
|
|
"default": "text-davinci-003",
|
|
"optional": true,
|
|
"id": "openAI_0-input-modelName-options"
|
|
},
|
|
{
|
|
"label": "Temperature",
|
|
"name": "temperature",
|
|
"type": "number",
|
|
"default": 0.7,
|
|
"optional": true,
|
|
"id": "openAI_0-input-temperature-number"
|
|
}
|
|
],
|
|
"inputAnchors": [],
|
|
"inputs": {
|
|
"modelName": "text-davinci-003",
|
|
"temperature": 0.7
|
|
},
|
|
"outputAnchors": [
|
|
{
|
|
"id": "openAI_0-output-openAI-OpenAI|BaseLLM|BaseLanguageModel",
|
|
"name": "openAI",
|
|
"label": "OpenAI",
|
|
"type": "OpenAI | BaseLLM | BaseLanguageModel"
|
|
}
|
|
],
|
|
"outputs": {},
|
|
"selected": false
|
|
},
|
|
"selected": false,
|
|
"dragging": false,
|
|
"positionAbsolute": {
|
|
"x": 618,
|
|
"y": 97
|
|
}
|
|
},
|
|
{
|
|
"width": 300,
|
|
"height": 405,
|
|
"id": "llmChain_0",
|
|
"position": {
|
|
"x": 998.3768292410252,
|
|
"y": 426.849642225371
|
|
},
|
|
"type": "customNode",
|
|
"data": {
|
|
"id": "llmChain_0",
|
|
"label": "LLM Chain",
|
|
"name": "llmChain",
|
|
"type": "LLMChain",
|
|
"baseClasses": ["LLMChain", "BaseChain"],
|
|
"category": "Chains",
|
|
"description": "Chain to run queries against LLMs",
|
|
"inputParams": [
|
|
{
|
|
"label": "Chain Name",
|
|
"name": "chainName",
|
|
"type": "string",
|
|
"placeholder": "Name Your Chain",
|
|
"optional": true,
|
|
"id": "llmChain_0-input-chainName-string"
|
|
}
|
|
],
|
|
"inputAnchors": [
|
|
{
|
|
"label": "Language Model",
|
|
"name": "model",
|
|
"type": "BaseLanguageModel",
|
|
"id": "llmChain_0-input-model-BaseLanguageModel"
|
|
},
|
|
{
|
|
"label": "Prompt",
|
|
"name": "prompt",
|
|
"type": "BasePromptTemplate",
|
|
"id": "llmChain_0-input-prompt-BasePromptTemplate"
|
|
}
|
|
],
|
|
"inputs": {
|
|
"model": "{{openAI_0.data.instance}}",
|
|
"prompt": "{{promptTemplate_0.data.instance}}",
|
|
"chainName": ""
|
|
},
|
|
"outputAnchors": [
|
|
{
|
|
"name": "output",
|
|
"label": "Output",
|
|
"type": "options",
|
|
"options": [
|
|
{
|
|
"id": "llmChain_0-output-llmChain-LLMChain|BaseChain",
|
|
"name": "llmChain",
|
|
"label": "LLM Chain",
|
|
"type": "LLMChain | BaseChain"
|
|
},
|
|
{
|
|
"id": "llmChain_0-output-outputPrediction-string",
|
|
"name": "outputPrediction",
|
|
"label": "Output Prediction",
|
|
"type": "string"
|
|
}
|
|
],
|
|
"default": "llmChain"
|
|
}
|
|
],
|
|
"outputs": {
|
|
"output": "llmChain"
|
|
},
|
|
"selected": false
|
|
},
|
|
"selected": false,
|
|
"positionAbsolute": {
|
|
"x": 998.3768292410252,
|
|
"y": 426.849642225371
|
|
},
|
|
"dragging": false
|
|
},
|
|
{
|
|
"width": 300,
|
|
"height": 533,
|
|
"id": "promptTemplate_0",
|
|
"position": {
|
|
"x": 618.658978699234,
|
|
"y": 589.2586352262571
|
|
},
|
|
"type": "customNode",
|
|
"data": {
|
|
"id": "promptTemplate_0",
|
|
"label": "Prompt Template",
|
|
"name": "promptTemplate",
|
|
"type": "PromptTemplate",
|
|
"baseClasses": ["PromptTemplate", "BaseStringPromptTemplate", "BasePromptTemplate"],
|
|
"category": "Prompts",
|
|
"description": "Schema to represent a basic prompt for an LLM",
|
|
"inputParams": [
|
|
{
|
|
"label": "Template",
|
|
"name": "template",
|
|
"type": "string",
|
|
"rows": 4,
|
|
"placeholder": "What is a good name for a company that makes {product}?",
|
|
"id": "promptTemplate_0-input-template-string"
|
|
},
|
|
{
|
|
"label": "Format Prompt Values",
|
|
"name": "promptValues",
|
|
"type": "string",
|
|
"rows": 4,
|
|
"placeholder": "{\n \"input_language\": \"English\",\n \"output_language\": \"French\"\n}",
|
|
"optional": true,
|
|
"acceptVariable": true,
|
|
"list": true,
|
|
"id": "promptTemplate_0-input-promptValues-string"
|
|
}
|
|
],
|
|
"inputAnchors": [],
|
|
"inputs": {
|
|
"template": "What is a good name for a company that makes {product}?",
|
|
"promptValues": ""
|
|
},
|
|
"outputAnchors": [
|
|
{
|
|
"id": "promptTemplate_0-output-promptTemplate-PromptTemplate|BaseStringPromptTemplate|BasePromptTemplate",
|
|
"name": "promptTemplate",
|
|
"label": "PromptTemplate",
|
|
"type": "PromptTemplate | BaseStringPromptTemplate | BasePromptTemplate"
|
|
}
|
|
],
|
|
"outputs": {},
|
|
"selected": false
|
|
},
|
|
"selected": false,
|
|
"positionAbsolute": {
|
|
"x": 618.658978699234,
|
|
"y": 589.2586352262571
|
|
},
|
|
"dragging": false
|
|
}
|
|
],
|
|
"edges": [
|
|
{
|
|
"source": "openAI_0",
|
|
"sourceHandle": "openAI_0-output-openAI-OpenAI|BaseLLM|BaseLanguageModel",
|
|
"target": "llmChain_0",
|
|
"targetHandle": "llmChain_0-input-model-BaseLanguageModel",
|
|
"type": "buttonedge",
|
|
"id": "openAI_0-openAI_0-output-openAI-OpenAI|BaseLLM|BaseLanguageModel-llmChain_0-llmChain_0-input-model-BaseLanguageModel",
|
|
"data": {
|
|
"label": ""
|
|
}
|
|
},
|
|
{
|
|
"source": "promptTemplate_0",
|
|
"sourceHandle": "promptTemplate_0-output-promptTemplate-PromptTemplate|BaseStringPromptTemplate|BasePromptTemplate",
|
|
"target": "llmChain_0",
|
|
"targetHandle": "llmChain_0-input-prompt-BasePromptTemplate",
|
|
"type": "buttonedge",
|
|
"id": "promptTemplate_0-promptTemplate_0-output-promptTemplate-PromptTemplate|BaseStringPromptTemplate|BasePromptTemplate-llmChain_0-llmChain_0-input-prompt-BasePromptTemplate",
|
|
"data": {
|
|
"label": ""
|
|
}
|
|
}
|
|
]
|
|
}
|