{
	"name": "form/nc/nc-rag/nc-rag.json",
	"layout": {
		"component": "nc-form",
		"attribute": {"id": "nc-rag"},
		"element": [
			{
				"component": "nc-row",
				"element": [
					{
						"component": "nc-col",
						"attribute": {"width": "auto"},
						"element": [
							{
								"component": "nc-label-input",
								"attribute": {
									"label": "Document path",
									"model": "rec.document_path",
									"hdr": "hdr.nc_rag.document_path"
								}
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {"width": "1.2em"},
						"element": [
							{
								"component": "nc-icon",
								"attribute": {
									"icon": "link",
									"style": "cursor: pointer;",
									"v-on:click": "openPath()"
								}
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {"width": "15em"},
						"element": [
							{
								"component": "nc-label-select",
								"attribute": {
									"label": "File type",
									"model": "rec.file_type",
									"option": "arr.file_type",
									"hdr": "hdr.nc_rag.file_type"
								}
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {"width": "12em"},
						"element": [
							{
								"component": "nc-label-select",
								"attribute": {
									"label": "Max depth",
									"model": "rec.max_depth",
									"option": "arr.max_depth",
									"hdr": "hdr.nc_rag.max_depth"
								}
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {"width": "auto", "class": ["nc-end-h"]},
						"element": [
							{
								"component": "nc-button",
								"attribute": {
									"class": ["nc-button-wide"],
									"primary": "primary",
									"v-on:click": "startMatch()",
									"icon": "play",
									"text": "Start match",
									"model": "hdr.nc_rag.start_match"
								}
							}
						]
					}
				]
			},
			{
				"component": "nc-row",
				"element": [
					{
						"component": "nc-col",
						"attribute": {"width": "auto"},
						"element": [
							{
								"component": "nc-label-input",
								"attribute": {
									"label": "Search",
									"model": "rec.search_text",
									"hdr": "hdr.nc_rag.search_text",
									"placeholder": "Filter results..."
								}
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {"width": "auto"},
						"element": [
							{
								"component": "nc-checkbox",
								"attribute": {
									"label": "Show preview",
									"model": "rec.show_preview",
									"hdr": "hdr.nc_rag.show_preview"
								}
							}
						]
					}
				]
			},
			{
				"component": "nc-divider"
			},
			{
				"component": "nc-tab",
				"attribute": {
					"model": "rec.tab",
					"option": "arr.tab",
					"v-on:change": "changeTab()"
				}
			},
			{
				"component": "nc-row",
				"element": [
					{
						"component": "nc-col",
						"attribute": {"id": "status_col"},
						"element": [
							{
								"component": "nc-text",
								"attribute": {
									"model": "rec.status",
									"class": "nc-rag-status"
								}
							}
						]
					}
				]
			},
			{
				"component": "nc-row",
				"element": [
					{
						"component": "nc-col",
						"attribute": {},
						"element": [
							{
								"component": "nc-grid",
								"attribute": {
									"id": "rag_result",
									"model": "grid.rag_result",
									"height": "50vh",
									":style": "{width: '100%'}",
									"v-show": "rec.tab === 'product_match'"
								}
							}
						]
					}
				]
			},
			{
				"component": "nc-row",
				"element": [
					{
						"component": "nc-col",
						"attribute": {},
						"element": [
							{
								"component": "nc-grid",
								"attribute": {
									"id": "dir_tree_info",
									"model": "grid.dir_tree_info",
									"height": "20vh",
									":style": "{width: '100%'}",
									"v-show": "rec.tab === 'product_match'"
								}
							}
						]
					}
				]
			},
			{
				"component": "nc-row",
				"attribute": {"class": ["nc-margin-top"]},
				"element": [
					{
						"component": "nc-col",
						"attribute": {"width": "75%"},
						"element": [
							{
								"component": "nc-label-textarea",
								"text": "Question",
								"attribute": {
									"model": "rec.chat_question",
									"height": "8em",
									"v-show": "rec.tab === 'rag_query'"
								}
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {"width": "25%"},
						"element": [
							{
								"component": "nc-label-textarea",
								"text": "Answer",
								"attribute": {
									"model": "rec.chat_answer",
									"height": "8em",
									"v-show": "rec.tab === 'rag_query'"
								}
							}
						]
					}
				]
			},
			{
				"component": "nc-row",
				"attribute": {"class": ["nc-margin-top"]},
				"element": [
					{
						"component": "nc-col",
						"attribute": {"width": "auto", "class": ["nc-end-h"]},
						"element": [
							{
								"component": "nc-button",
								"text": "Send",
								"attribute": {
									"class": ["nc-button-wide"],
									"color": "primary",
									"v-on:click": "queryRag()",
									"model": "hdr.nc_rag.query_rag",
									"v-show": "rec.tab === 'rag_query'"
								}
							}
						]
					}
				]
			}
		]
	}
}
