Nest extraData by section for clearer embedding content

Homebox's location fields were flattened into single-purpose keys
(locationName/locationDescription), which gave EmbeddingService no
way to group related fields when rendering vector-store content.
extraData is now Map<String, Map<String, Object>>, letting
HomeboxItemClient express "location" as its own section; buildExtraData
renders each section as a header with indented fields instead of a flat
"Extradata: key: value" line.
This commit is contained in:
2026-07-21 01:04:19 +02:00
parent 29027d4515
commit 3736cc73ae
5 changed files with 36 additions and 18 deletions
@@ -18,7 +18,7 @@ class SearchResponseTest {
@Test
void shouldReturnNullWhenExtraDataKeyIsMissing() {
ServiceItem response = new ServiceItem(MOCK_ID, MOCK_TITLE, MOCK_DESCRIPTION, Map.of("key", "value"));
ServiceItem response = new ServiceItem(MOCK_ID, MOCK_TITLE, MOCK_DESCRIPTION, Map.of("key", Map.of("key", "value")));
assertThat(response.getExtra("missing")).isNull();
}
@@ -26,7 +26,8 @@ class SearchResponseTest {
@Test
void shouldReturnExtraDataValue() {
ServiceItem response = new ServiceItem(MOCK_ID, MOCK_TITLE, MOCK_DESCRIPTION, Map.of("key", "value"));
ServiceItem response = new ServiceItem(MOCK_ID, MOCK_TITLE, MOCK_DESCRIPTION, Map.of("key",
Map.of("key", "value")));
assertThat(response.id()).isEqualTo(MOCK_ID);
assertThat(response.getExtra("key")).contains("value");