From 288a48c4591bad783bf51a8db913ab000408f54b Mon Sep 17 00:00:00 2001 From: CaroFG Date: Thu, 29 Feb 2024 10:49:27 +0100 Subject: [PATCH] Add documentTemplate to embedders --- docs-scraper.config.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs-scraper.config.json b/docs-scraper.config.json index f8bd2568f9..4e5aee1971 100644 --- a/docs-scraper.config.json +++ b/docs-scraper.config.json @@ -29,7 +29,8 @@ "default": { "source": "openAi", "apiKey": "embedderApiKey", - "model": "text-embedding-ada-002" + "model": "text-embedding-ada-002", + "documentTemplate": "{% if doc.hierarchy_lvl0 != null %}Starting with the theme '{{doc.hierarchy_lvl0}}'. {% endif %}{% if doc.hierarchy_lvl1 != null %}A document titled '{{doc.hierarchy_lvl1}}'. {% endif %}{% if doc.hierarchy_lvl2 != null %}Under the section '{{doc.hierarchy_lvl2}}'. {% endif %}{% if doc.hierarchy_lvl3 != null %}This is further divided into '{{doc.hierarchy_lvl3}}'. {% endif %}{% if doc.hierarchy_lvl4 != null %}Which includes '{{doc.hierarchy_lvl4}}'. {% endif %}{% if doc.hierarchy_lvl5 != null %}Specifically focusing on '{{doc.hierarchy_lvl5}}'. {% endif %}{% if doc.anchor != null %}It's about {{doc.anchor}}. {% endif %}{% if doc.content != null %}It discusses {{doc.content|truncatewords: 200}}{% endif %}" } }, "searchableAttributes": [