{
	"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": "1.2em" },
						"element": [
							{
								"component": "nc-icon",
								"attribute": {
									"icon": "link",
									"style": "cursor: pointer;",
									"v-on:click": "openPath('document')"
								}
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": { "width": "auto" },
						"element": [
							{
								"component": "nc-label-input",
								"attribute": {
									"model": "rec.document_path"
								}
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": { "width": "15em" },
						"element": [
							{
								"component": "nc-label-dropdown",
								"attribute": {
									"model": "rec.file_type"
								}
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": { "width": "12em" },
						"element": [
							{
								"component": "nc-label-dropdown",
								"attribute": {
									"model": "rec.max_depth",
									"hdr": "arr.max_depth"
								}
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": { "width": "auto", "class": ["nc-end-h"] },
						"element": [
							{
								"component": "nc-button",
								"text": "hdr.nc_rag.start_match",
								"attribute": {
									"color": "primary",
									"v-on:click": "startMatch()",
									"icon": "play"
								}
							}
						]
					}
				]
			},
			{
				"component": "nc-row",
				"element": [
					{
						"component": "nc-col",
						"attribute": { "width": "auto" },
						"element": [
							{
								"component": "nc-label-input",
								"attribute": {
									"model": "rec.search_text",
									"placeholder": "Filter results..."
								}
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": { "width": "auto" },
						"element": [
							{
								"component": "nc-checkbox",
								"text": "hdr.nc_rag.show_preview",
								"attribute": {
									"model": "rec.show_preview"
								}
							}
						]
					}
				]
			},
			{
				"component": "nc-divider"
			},
			{
				"component": "nc-tab",
				"attribute": {
					"model": "rec.tab",
					"v-on:change": "changeTab()"
				}
			},
			{
				"component": "nc-row",
				"attribute": { "v-if": "rec.tab === 'product_match'" },
				"element": [
					{
						"component": "nc-col",
						"attribute": { "width": "auto" },
						"element": [
							{
								"component": "nc-label",
								"attribute": {
									"model": "rec.status"
								}
							}
						]
					}
				]
			},
			{
				"component": "nc-row",
				"attribute": { "v-if": "rec.tab === 'product_match'" },
				"element": [
					{
						"component": "nc-col",
						"attribute": { "width": "auto" },
						"element": [
							{
								"component": "nc-grid",
								"attribute": {
									"id": "rag_result",
									"model": "grid.rag_result",
									":height": "gridHeight('rag_result')"
								}
							}
						]
					}
				]
			},
			{
				"component": "nc-row",
				"attribute": { "v-if": "rec.tab === 'product_match'", "class": ["nc-margin-top"] },
				"element": [
					{
						"component": "nc-col",
						"attribute": { "width": "auto" },
						"element": [
							{
								"component": "nc-grid",
								"attribute": {
									"id": "dir_tree_info",
									"model": "grid.dir_tree_info",
									":height": "gridHeight('dir_tree_info')"
								}
							}
						]
					}
				]
			},
			{
				"component": "nc-row",
				"attribute": { "v-if": "rec.tab === 'rag_query'", "class": ["nc-margin-top"] },
				"element": [
					{
						"component": "nc-col",
						"attribute": { "width": "75%" },
						"element": [
							{
								"component": "nc-label-textarea",
								"text": "hdr.nc_rag.chat_question",
								"attribute": {
									"model": "rec.chat_question",
									"height": "8em"
								}
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": { "width": "25%" },
						"element": [
							{
								"component": "nc-label-textarea",
								"text": "hdr.nc_rag.chat_answer",
								"attribute": {
									"model": "rec.chat_answer",
									"height": "8em"
								}
							}
						]
					}
				]
			},
			{
				"component": "nc-row",
				"attribute": { "v-if": "rec.tab === 'rag_query'", "class": ["nc-margin-top"] },
				"element": [
					{
						"component": "nc-col",
						"attribute": { "width": "auto", "class": ["nc-end-h"] },
						"element": [
							{
								"component": "nc-button",
								"text": "hdr.nc_rag.query_rag",
								"attribute": {
									"color": "primary",
									"v-on:click": "queryRag()"
								}
							}
						]
					}
				]
			},
			{
				"component": "nc-row",
				"attribute": { "v-if": "rec.tab === 'document_list'" },
				"element": [
					{
						"component": "nc-col",
						"attribute": { "width": "auto" },
						"element": [
							{
								"component": "nc-grid",
								"attribute": {
									"id": "document_list",
									"model": "grid.document_list",
									":height": "gridHeight('document_list')"
								}
							}
						]
					}
				]
			},
			{
				"component": "nc-row",
				"attribute": { "v-if": "rec.tab === 'product_list'" },
				"element": [
					{
						"component": "nc-col",
						"attribute": { "width": "auto" },
						"element": [
							{
								"component": "nc-grid",
								"attribute": {
									"id": "product_list",
									"model": "grid.product_list",
									":height": "gridHeight('product_list')"
								}
							}
						]
					}
				]
			}
		]
	}
}
