Change openrag agent to ahve context about the knowledge filter
This commit is contained in:
parent
48d5e7c45e
commit
268bf95e7b
1 changed files with 340 additions and 61 deletions
|
|
@ -29,34 +29,6 @@
|
|||
"target": "Agent-Nfw7u",
|
||||
"targetHandle": "{œfieldNameœ:œtoolsœ,œidœ:œAgent-Nfw7uœ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}"
|
||||
},
|
||||
{
|
||||
"animated": false,
|
||||
"className": "",
|
||||
"data": {
|
||||
"sourceHandle": {
|
||||
"dataType": "ChatInput",
|
||||
"id": "ChatInput-ci8VE",
|
||||
"name": "message",
|
||||
"output_types": [
|
||||
"Message"
|
||||
]
|
||||
},
|
||||
"targetHandle": {
|
||||
"fieldName": "input_value",
|
||||
"id": "Agent-Nfw7u",
|
||||
"inputTypes": [
|
||||
"Message"
|
||||
],
|
||||
"type": "str"
|
||||
}
|
||||
},
|
||||
"id": "xy-edge__ChatInput-ci8VE{œdataTypeœ:œChatInputœ,œidœ:œChatInput-ci8VEœ,œnameœ:œmessageœ,œoutput_typesœ:[œMessageœ]}-Agent-Nfw7u{œfieldNameœ:œinput_valueœ,œidœ:œAgent-Nfw7uœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}",
|
||||
"selected": false,
|
||||
"source": "ChatInput-ci8VE",
|
||||
"sourceHandle": "{œdataTypeœ:œChatInputœ,œidœ:œChatInput-ci8VEœ,œnameœ:œmessageœ,œoutput_typesœ:[œMessageœ]}",
|
||||
"target": "Agent-Nfw7u",
|
||||
"targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œAgent-Nfw7uœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}"
|
||||
},
|
||||
{
|
||||
"animated": false,
|
||||
"className": "",
|
||||
|
|
@ -230,6 +202,62 @@
|
|||
{
|
||||
"animated": false,
|
||||
"className": "",
|
||||
"data": {
|
||||
"sourceHandle": {
|
||||
"dataType": "ChatInput",
|
||||
"id": "ChatInput-ci8VE",
|
||||
"name": "message",
|
||||
"output_types": [
|
||||
"Message"
|
||||
]
|
||||
},
|
||||
"targetHandle": {
|
||||
"fieldName": "input",
|
||||
"id": "Prompt Template-7kZsI",
|
||||
"inputTypes": [
|
||||
"Message"
|
||||
],
|
||||
"type": "str"
|
||||
}
|
||||
},
|
||||
"id": "xy-edge__ChatInput-ci8VE{œdataTypeœ:œChatInputœ,œidœ:œChatInput-ci8VEœ,œnameœ:œmessageœ,œoutput_typesœ:[œMessageœ]}-Prompt Template-7kZsI{œfieldNameœ:œinputœ,œidœ:œPrompt Template-7kZsIœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}",
|
||||
"selected": false,
|
||||
"source": "ChatInput-ci8VE",
|
||||
"sourceHandle": "{œdataTypeœ:œChatInputœ,œidœ:œChatInput-ci8VEœ,œnameœ:œmessageœ,œoutput_typesœ:[œMessageœ]}",
|
||||
"target": "Prompt Template-7kZsI",
|
||||
"targetHandle": "{œfieldNameœ:œinputœ,œidœ:œPrompt Template-7kZsIœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}"
|
||||
},
|
||||
{
|
||||
"animated": false,
|
||||
"className": "",
|
||||
"data": {
|
||||
"sourceHandle": {
|
||||
"dataType": "Prompt Template",
|
||||
"id": "Prompt Template-7kZsI",
|
||||
"name": "prompt",
|
||||
"output_types": [
|
||||
"Message"
|
||||
]
|
||||
},
|
||||
"targetHandle": {
|
||||
"fieldName": "input_value",
|
||||
"id": "Agent-Nfw7u",
|
||||
"inputTypes": [
|
||||
"Message"
|
||||
],
|
||||
"type": "str"
|
||||
}
|
||||
},
|
||||
"id": "xy-edge__Prompt Template-7kZsI{œdataTypeœ:œPrompt Templateœ,œidœ:œPrompt Template-7kZsIœ,œnameœ:œpromptœ,œoutput_typesœ:[œMessageœ]}-Agent-Nfw7u{œfieldNameœ:œinput_valueœ,œidœ:œAgent-Nfw7uœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}",
|
||||
"selected": false,
|
||||
"source": "Prompt Template-7kZsI",
|
||||
"sourceHandle": "{œdataTypeœ:œPrompt Templateœ,œidœ:œPrompt Template-7kZsIœ,œnameœ:œpromptœ,œoutput_typesœ:[œMessageœ]}",
|
||||
"target": "Agent-Nfw7u",
|
||||
"targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œAgent-Nfw7uœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}"
|
||||
},
|
||||
{
|
||||
"animated": false,
|
||||
"className": "not-running",
|
||||
"data": {
|
||||
"sourceHandle": {
|
||||
"dataType": "OpenSearchVectorStoreComponentMultimodalMultiEmbedding",
|
||||
|
|
@ -254,6 +282,34 @@
|
|||
"sourceHandle": "{œdataTypeœ:œOpenSearchVectorStoreComponentMultimodalMultiEmbeddingœ,œidœ:œOpenSearchVectorStoreComponentMultimodalMultiEmbedding-TyvvEœ,œnameœ:œcomponent_as_toolœ,œoutput_typesœ:[œToolœ]}",
|
||||
"target": "Agent-Nfw7u",
|
||||
"targetHandle": "{œfieldNameœ:œtoolsœ,œidœ:œAgent-Nfw7uœ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}"
|
||||
},
|
||||
{
|
||||
"animated": false,
|
||||
"className": "",
|
||||
"data": {
|
||||
"sourceHandle": {
|
||||
"dataType": "TextInput",
|
||||
"id": "TextInput-aHsQb",
|
||||
"name": "text",
|
||||
"output_types": [
|
||||
"Message"
|
||||
]
|
||||
},
|
||||
"targetHandle": {
|
||||
"fieldName": "filter",
|
||||
"id": "Prompt Template-7kZsI",
|
||||
"inputTypes": [
|
||||
"Message"
|
||||
],
|
||||
"type": "str"
|
||||
}
|
||||
},
|
||||
"id": "xy-edge__TextInput-aHsQb{œdataTypeœ:œTextInputœ,œidœ:œTextInput-aHsQbœ,œnameœ:œtextœ,œoutput_typesœ:[œMessageœ]}-Prompt Template-7kZsI{œfieldNameœ:œfilterœ,œidœ:œPrompt Template-7kZsIœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}",
|
||||
"selected": false,
|
||||
"source": "TextInput-aHsQb",
|
||||
"sourceHandle": "{œdataTypeœ:œTextInputœ,œidœ:œTextInput-aHsQbœ,œnameœ:œtextœ,œoutput_typesœ:[œMessageœ]}",
|
||||
"target": "Prompt Template-7kZsI",
|
||||
"targetHandle": "{œfieldNameœ:œfilterœ,œidœ:œPrompt Template-7kZsIœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}"
|
||||
}
|
||||
],
|
||||
"nodes": [
|
||||
|
|
@ -351,8 +407,8 @@
|
|||
"width": 320
|
||||
},
|
||||
"position": {
|
||||
"x": 503.8866998170472,
|
||||
"y": 2288.794090320999
|
||||
"x": 499.6078970988059,
|
||||
"y": 2370.091341967585
|
||||
},
|
||||
"selected": false,
|
||||
"type": "genericNode"
|
||||
|
|
@ -381,7 +437,7 @@
|
|||
"frozen": false,
|
||||
"icon": "Mcp",
|
||||
"key": "mcp_lf-starter_project",
|
||||
"last_updated": "2025-11-26T05:22:26.296Z",
|
||||
"last_updated": "2025-12-02T20:43:07.197Z",
|
||||
"legacy": false,
|
||||
"mcpServerName": "lf-starter_project",
|
||||
"metadata": {
|
||||
|
|
@ -433,7 +489,7 @@
|
|||
"value": "1098eea1-6649-4e1d-aed1-b77249fb8dd0"
|
||||
},
|
||||
"_frontend_node_folder_id": {
|
||||
"value": "131daebd-f11a-4072-9e20-1e1f903d01b0"
|
||||
"value": "69a7745e-dfb8-40a7-b5cb-5da3af0b10b6"
|
||||
},
|
||||
"_type": "Component",
|
||||
"code": {
|
||||
|
|
@ -601,7 +657,7 @@
|
|||
"width": 320
|
||||
},
|
||||
"position": {
|
||||
"x": 1508.8015756352295,
|
||||
"x": 1497.4887425692002,
|
||||
"y": 1384.557089807625
|
||||
},
|
||||
"selected": false,
|
||||
|
|
@ -927,8 +983,8 @@
|
|||
"width": 192
|
||||
},
|
||||
"position": {
|
||||
"x": 1599.1877452584524,
|
||||
"y": 2275.678637253258
|
||||
"x": 1082.2212594228977,
|
||||
"y": 2419.3721124836857
|
||||
},
|
||||
"selected": false,
|
||||
"type": "genericNode"
|
||||
|
|
@ -1279,7 +1335,7 @@
|
|||
],
|
||||
"frozen": false,
|
||||
"icon": "bot",
|
||||
"last_updated": "2025-11-26T05:22:26.298Z",
|
||||
"last_updated": "2025-12-02T20:43:34.986Z",
|
||||
"legacy": false,
|
||||
"metadata": {
|
||||
"code_hash": "d64b11c24a1c",
|
||||
|
|
@ -1329,7 +1385,7 @@
|
|||
"value": "1098eea1-6649-4e1d-aed1-b77249fb8dd0"
|
||||
},
|
||||
"_frontend_node_folder_id": {
|
||||
"value": "131daebd-f11a-4072-9e20-1e1f903d01b0"
|
||||
"value": "69a7745e-dfb8-40a7-b5cb-5da3af0b10b6"
|
||||
},
|
||||
"_type": "Component",
|
||||
"add_current_date_tool": {
|
||||
|
|
@ -1427,6 +1483,9 @@
|
|||
"real_time_refresh": true,
|
||||
"refresh_button": false,
|
||||
"required": false,
|
||||
"selected_metadata": {
|
||||
"icon": "OpenAI"
|
||||
},
|
||||
"show": true,
|
||||
"title_case": false,
|
||||
"toggle": false,
|
||||
|
|
@ -1692,7 +1751,26 @@
|
|||
"input_types": [],
|
||||
"name": "model_name",
|
||||
"options": [
|
||||
"gpt-4o"
|
||||
"gpt-4o-mini",
|
||||
"gpt-4o",
|
||||
"gpt-4.1",
|
||||
"gpt-4.1-mini",
|
||||
"gpt-4.1-nano",
|
||||
"gpt-4-turbo",
|
||||
"gpt-4-turbo-preview",
|
||||
"gpt-4",
|
||||
"gpt-3.5-turbo",
|
||||
"gpt-5.1",
|
||||
"gpt-5",
|
||||
"gpt-5-mini",
|
||||
"gpt-5-nano",
|
||||
"gpt-5-chat-latest",
|
||||
"o1",
|
||||
"o3-mini",
|
||||
"o3",
|
||||
"o3-pro",
|
||||
"o4-mini",
|
||||
"o4-mini-high"
|
||||
],
|
||||
"options_metadata": [],
|
||||
"override_skip": false,
|
||||
|
|
@ -1706,7 +1784,7 @@
|
|||
"trace_as_metadata": true,
|
||||
"track_in_telemetry": true,
|
||||
"type": "str",
|
||||
"value": "gpt-4o"
|
||||
"value": "gpt-4o-mini"
|
||||
},
|
||||
"n_messages": {
|
||||
"_input_type": "IntInput",
|
||||
|
|
@ -1770,6 +1848,7 @@
|
|||
"description": "Specify the name of the output field.",
|
||||
"display_name": "Name",
|
||||
"edit_mode": "inline",
|
||||
"formatter": "text",
|
||||
"name": "name",
|
||||
"type": "str"
|
||||
},
|
||||
|
|
@ -1778,6 +1857,7 @@
|
|||
"description": "Describe the purpose of the output field.",
|
||||
"display_name": "Description",
|
||||
"edit_mode": "popover",
|
||||
"formatter": "text",
|
||||
"name": "description",
|
||||
"type": "str"
|
||||
},
|
||||
|
|
@ -1786,6 +1866,7 @@
|
|||
"description": "Indicate the data type of the output field (e.g., str, int, float, bool, dict).",
|
||||
"display_name": "Type",
|
||||
"edit_mode": "inline",
|
||||
"formatter": "text",
|
||||
"name": "type",
|
||||
"options": [
|
||||
"str",
|
||||
|
|
@ -1801,6 +1882,7 @@
|
|||
"description": "Set to True if this output field should be a list of the specified type.",
|
||||
"display_name": "As List",
|
||||
"edit_mode": "inline",
|
||||
"formatter": "text",
|
||||
"name": "multiple",
|
||||
"type": "boolean"
|
||||
}
|
||||
|
|
@ -1994,7 +2076,7 @@
|
|||
],
|
||||
"frozen": false,
|
||||
"icon": "calculator",
|
||||
"last_updated": "2025-11-26T05:22:26.299Z",
|
||||
"last_updated": "2025-12-02T20:43:07.202Z",
|
||||
"legacy": false,
|
||||
"metadata": {
|
||||
"code_hash": "acbe2603b034",
|
||||
|
|
@ -2037,7 +2119,7 @@
|
|||
"value": "1098eea1-6649-4e1d-aed1-b77249fb8dd0"
|
||||
},
|
||||
"_frontend_node_folder_id": {
|
||||
"value": "131daebd-f11a-4072-9e20-1e1f903d01b0"
|
||||
"value": "69a7745e-dfb8-40a7-b5cb-5da3af0b10b6"
|
||||
},
|
||||
"_type": "Component",
|
||||
"code": {
|
||||
|
|
@ -2180,7 +2262,7 @@
|
|||
],
|
||||
"frozen": false,
|
||||
"icon": "binary",
|
||||
"last_updated": "2025-11-26T05:22:26.299Z",
|
||||
"last_updated": "2025-12-02T20:43:07.202Z",
|
||||
"legacy": false,
|
||||
"lf_version": "1.7.0.dev21",
|
||||
"metadata": {
|
||||
|
|
@ -2248,12 +2330,12 @@
|
|||
"value": "1098eea1-6649-4e1d-aed1-b77249fb8dd0"
|
||||
},
|
||||
"_frontend_node_folder_id": {
|
||||
"value": "131daebd-f11a-4072-9e20-1e1f903d01b0"
|
||||
"value": "69a7745e-dfb8-40a7-b5cb-5da3af0b10b6"
|
||||
},
|
||||
"_type": "Component",
|
||||
"api_base": {
|
||||
"_input_type": "MessageTextInput",
|
||||
"advanced": true,
|
||||
"advanced": false,
|
||||
"display_name": "OpenAI API Base URL",
|
||||
"dynamic": false,
|
||||
"info": "Base URL for the API. Leave empty for default.",
|
||||
|
|
@ -2460,9 +2542,7 @@
|
|||
"info": "Select the embedding model to use",
|
||||
"name": "model",
|
||||
"options": [
|
||||
"text-embedding-3-small",
|
||||
"text-embedding-3-large",
|
||||
"text-embedding-ada-002"
|
||||
"text-embedding-3-small"
|
||||
],
|
||||
"options_metadata": [],
|
||||
"override_skip": false,
|
||||
|
|
@ -2661,7 +2741,7 @@
|
|||
"dragging": false,
|
||||
"id": "EmbeddingModel-aIP4U",
|
||||
"measured": {
|
||||
"height": 369,
|
||||
"height": 451,
|
||||
"width": 320
|
||||
},
|
||||
"position": {
|
||||
|
|
@ -2715,8 +2795,9 @@
|
|||
],
|
||||
"frozen": false,
|
||||
"icon": "OpenSearch",
|
||||
"last_updated": "2025-11-26T05:22:41.532Z",
|
||||
"last_updated": "2025-12-02T21:06:38.281Z",
|
||||
"legacy": false,
|
||||
"lf_version": "1.7.0.dev21",
|
||||
"metadata": {
|
||||
"code_hash": "000397b17863",
|
||||
"dependencies": {
|
||||
|
|
@ -2762,7 +2843,7 @@
|
|||
"value": "1098eea1-6649-4e1d-aed1-b77249fb8dd0"
|
||||
},
|
||||
"_frontend_node_folder_id": {
|
||||
"value": "131daebd-f11a-4072-9e20-1e1f903d01b0"
|
||||
"value": "69a7745e-dfb8-40a7-b5cb-5da3af0b10b6"
|
||||
},
|
||||
"_type": "Component",
|
||||
"auth_mode": {
|
||||
|
|
@ -3202,7 +3283,7 @@
|
|||
"trace_as_metadata": true,
|
||||
"track_in_telemetry": false,
|
||||
"type": "query",
|
||||
"value": ""
|
||||
"value": "hisense"
|
||||
},
|
||||
"should_cache_vector_store": {
|
||||
"_input_type": "BoolInput",
|
||||
|
|
@ -3432,10 +3513,10 @@
|
|||
"width": 320
|
||||
},
|
||||
"position": {
|
||||
"x": 1098.7085719475467,
|
||||
"y": 1410.4984401198574
|
||||
"x": 1010.0149063694566,
|
||||
"y": 1404.0086597117045
|
||||
},
|
||||
"selected": true,
|
||||
"selected": false,
|
||||
"type": "genericNode"
|
||||
},
|
||||
{
|
||||
|
|
@ -3474,7 +3555,7 @@
|
|||
],
|
||||
"frozen": false,
|
||||
"icon": "binary",
|
||||
"last_updated": "2025-11-26T05:22:26.302Z",
|
||||
"last_updated": "2025-12-02T20:43:07.204Z",
|
||||
"legacy": false,
|
||||
"lf_version": "1.7.0.dev21",
|
||||
"metadata": {
|
||||
|
|
@ -3542,7 +3623,7 @@
|
|||
"value": "1098eea1-6649-4e1d-aed1-b77249fb8dd0"
|
||||
},
|
||||
"_frontend_node_folder_id": {
|
||||
"value": "131daebd-f11a-4072-9e20-1e1f903d01b0"
|
||||
"value": "69a7745e-dfb8-40a7-b5cb-5da3af0b10b6"
|
||||
},
|
||||
"_type": "Component",
|
||||
"api_base": {
|
||||
|
|
@ -4001,7 +4082,7 @@
|
|||
],
|
||||
"frozen": false,
|
||||
"icon": "binary",
|
||||
"last_updated": "2025-11-26T05:22:26.303Z",
|
||||
"last_updated": "2025-12-02T20:43:07.205Z",
|
||||
"legacy": false,
|
||||
"lf_version": "1.7.0.dev21",
|
||||
"metadata": {
|
||||
|
|
@ -4069,7 +4150,7 @@
|
|||
"value": "1098eea1-6649-4e1d-aed1-b77249fb8dd0"
|
||||
},
|
||||
"_frontend_node_folder_id": {
|
||||
"value": "131daebd-f11a-4072-9e20-1e1f903d01b0"
|
||||
"value": "69a7745e-dfb8-40a7-b5cb-5da3af0b10b6"
|
||||
},
|
||||
"_type": "Component",
|
||||
"api_base": {
|
||||
|
|
@ -4495,12 +4576,210 @@
|
|||
},
|
||||
"selected": false,
|
||||
"type": "genericNode"
|
||||
},
|
||||
{
|
||||
"data": {
|
||||
"id": "Prompt Template-7kZsI",
|
||||
"node": {
|
||||
"base_classes": [
|
||||
"Message"
|
||||
],
|
||||
"beta": false,
|
||||
"conditional_paths": [],
|
||||
"custom_fields": {
|
||||
"template": [
|
||||
"filter",
|
||||
"input"
|
||||
]
|
||||
},
|
||||
"description": "Create a prompt template with dynamic variables.",
|
||||
"display_name": "Prompt Template",
|
||||
"documentation": "https://docs.langflow.org/components-prompts",
|
||||
"edited": false,
|
||||
"error": null,
|
||||
"field_order": [
|
||||
"template",
|
||||
"tool_placeholder"
|
||||
],
|
||||
"frozen": false,
|
||||
"full_path": null,
|
||||
"icon": "braces",
|
||||
"is_composition": null,
|
||||
"is_input": null,
|
||||
"is_output": null,
|
||||
"legacy": false,
|
||||
"metadata": {
|
||||
"code_hash": "7382d03ce412",
|
||||
"dependencies": {
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "lfx",
|
||||
"version": "0.2.0.dev21"
|
||||
}
|
||||
],
|
||||
"total_dependencies": 1
|
||||
},
|
||||
"module": "lfx.components.models_and_agents.prompt.PromptComponent"
|
||||
},
|
||||
"minimized": false,
|
||||
"name": "",
|
||||
"output_types": [],
|
||||
"outputs": [
|
||||
{
|
||||
"allows_loop": false,
|
||||
"cache": true,
|
||||
"display_name": "Prompt",
|
||||
"group_outputs": false,
|
||||
"hidden": null,
|
||||
"loop_types": null,
|
||||
"method": "build_prompt",
|
||||
"name": "prompt",
|
||||
"options": null,
|
||||
"required_inputs": null,
|
||||
"selected": "Message",
|
||||
"tool_mode": true,
|
||||
"types": [
|
||||
"Message"
|
||||
],
|
||||
"value": "__UNDEFINED__"
|
||||
}
|
||||
],
|
||||
"pinned": false,
|
||||
"priority": 0,
|
||||
"replacement": null,
|
||||
"template": {
|
||||
"_type": "Component",
|
||||
"code": {
|
||||
"advanced": true,
|
||||
"dynamic": true,
|
||||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"info": "",
|
||||
"list": false,
|
||||
"load_from_db": false,
|
||||
"multiline": true,
|
||||
"name": "code",
|
||||
"password": false,
|
||||
"placeholder": "",
|
||||
"required": true,
|
||||
"show": true,
|
||||
"title_case": false,
|
||||
"type": "code",
|
||||
"value": "from lfx.base.prompts.api_utils import process_prompt_template\nfrom lfx.custom.custom_component.component import Component\nfrom lfx.inputs.inputs import DefaultPromptField\nfrom lfx.io import MessageTextInput, Output, PromptInput\nfrom lfx.schema.message import Message\nfrom lfx.template.utils import update_template_values\n\n\nclass PromptComponent(Component):\n display_name: str = \"Prompt Template\"\n description: str = \"Create a prompt template with dynamic variables.\"\n documentation: str = \"https://docs.langflow.org/components-prompts\"\n icon = \"braces\"\n trace_type = \"prompt\"\n name = \"Prompt Template\"\n priority = 0 # Set priority to 0 to make it appear first\n\n inputs = [\n PromptInput(name=\"template\", display_name=\"Template\"),\n MessageTextInput(\n name=\"tool_placeholder\",\n display_name=\"Tool Placeholder\",\n tool_mode=True,\n advanced=True,\n info=\"A placeholder input for tool mode.\",\n ),\n ]\n\n outputs = [\n Output(display_name=\"Prompt\", name=\"prompt\", method=\"build_prompt\"),\n ]\n\n async def build_prompt(self) -> Message:\n prompt = Message.from_template(**self._attributes)\n self.status = prompt.text\n return prompt\n\n def _update_template(self, frontend_node: dict):\n prompt_template = frontend_node[\"template\"][\"template\"][\"value\"]\n custom_fields = frontend_node[\"custom_fields\"]\n frontend_node_template = frontend_node[\"template\"]\n _ = process_prompt_template(\n template=prompt_template,\n name=\"template\",\n custom_fields=custom_fields,\n frontend_node_template=frontend_node_template,\n )\n return frontend_node\n\n async def update_frontend_node(self, new_frontend_node: dict, current_frontend_node: dict):\n \"\"\"This function is called after the code validation is done.\"\"\"\n frontend_node = await super().update_frontend_node(new_frontend_node, current_frontend_node)\n template = frontend_node[\"template\"][\"template\"][\"value\"]\n # Kept it duplicated for backwards compatibility\n _ = process_prompt_template(\n template=template,\n name=\"template\",\n custom_fields=frontend_node[\"custom_fields\"],\n frontend_node_template=frontend_node[\"template\"],\n )\n # Now that template is updated, we need to grab any values that were set in the current_frontend_node\n # and update the frontend_node with those values\n update_template_values(new_template=frontend_node, previous_template=current_frontend_node[\"template\"])\n return frontend_node\n\n def _get_fallback_input(self, **kwargs):\n return DefaultPromptField(**kwargs)\n"
|
||||
},
|
||||
"filter": {
|
||||
"advanced": false,
|
||||
"display_name": "filter",
|
||||
"dynamic": false,
|
||||
"field_type": "str",
|
||||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"info": "",
|
||||
"input_types": [
|
||||
"Message"
|
||||
],
|
||||
"list": false,
|
||||
"load_from_db": false,
|
||||
"multiline": true,
|
||||
"name": "filter",
|
||||
"placeholder": "",
|
||||
"required": false,
|
||||
"show": true,
|
||||
"title_case": false,
|
||||
"type": "str",
|
||||
"value": ""
|
||||
},
|
||||
"input": {
|
||||
"advanced": false,
|
||||
"display_name": "input",
|
||||
"dynamic": false,
|
||||
"field_type": "str",
|
||||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"info": "",
|
||||
"input_types": [
|
||||
"Message"
|
||||
],
|
||||
"list": false,
|
||||
"load_from_db": false,
|
||||
"multiline": true,
|
||||
"name": "input",
|
||||
"placeholder": "",
|
||||
"required": false,
|
||||
"show": true,
|
||||
"title_case": false,
|
||||
"type": "str",
|
||||
"value": ""
|
||||
},
|
||||
"template": {
|
||||
"_input_type": "PromptInput",
|
||||
"advanced": false,
|
||||
"display_name": "Template",
|
||||
"dynamic": false,
|
||||
"info": "",
|
||||
"list": false,
|
||||
"list_add_label": "Add More",
|
||||
"name": "template",
|
||||
"override_skip": false,
|
||||
"placeholder": "",
|
||||
"required": false,
|
||||
"show": true,
|
||||
"title_case": false,
|
||||
"tool_mode": false,
|
||||
"trace_as_input": true,
|
||||
"track_in_telemetry": false,
|
||||
"type": "prompt",
|
||||
"value": "This is Knowledge filter - use it as a context of what to search on the database, unless it's empty: {filter}\n\nChat input: {input}"
|
||||
},
|
||||
"tool_placeholder": {
|
||||
"_input_type": "MessageTextInput",
|
||||
"advanced": true,
|
||||
"display_name": "Tool Placeholder",
|
||||
"dynamic": false,
|
||||
"info": "A placeholder input for tool mode.",
|
||||
"input_types": [
|
||||
"Message"
|
||||
],
|
||||
"list": false,
|
||||
"list_add_label": "Add More",
|
||||
"load_from_db": false,
|
||||
"name": "tool_placeholder",
|
||||
"override_skip": false,
|
||||
"placeholder": "",
|
||||
"required": false,
|
||||
"show": true,
|
||||
"title_case": false,
|
||||
"tool_mode": true,
|
||||
"trace_as_input": true,
|
||||
"trace_as_metadata": true,
|
||||
"track_in_telemetry": false,
|
||||
"type": "str",
|
||||
"value": ""
|
||||
}
|
||||
},
|
||||
"tool_mode": false
|
||||
},
|
||||
"showNode": true,
|
||||
"type": "Prompt Template"
|
||||
},
|
||||
"dragging": false,
|
||||
"id": "Prompt Template-7kZsI",
|
||||
"measured": {
|
||||
"height": 435,
|
||||
"width": 320
|
||||
},
|
||||
"position": {
|
||||
"x": 1496.7915215019298,
|
||||
"y": 2019.0970114283145
|
||||
},
|
||||
"selected": false,
|
||||
"type": "genericNode"
|
||||
}
|
||||
],
|
||||
"viewport": {
|
||||
"x": -159.31786606392757,
|
||||
"y": -442.1474480017346,
|
||||
"zoom": 0.5404166566474254
|
||||
"x": -112.66146214316689,
|
||||
"y": -568.6025760472323,
|
||||
"zoom": 0.5303711249852255
|
||||
}
|
||||
},
|
||||
"description": "OpenRAG OpenSearch Agent",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue