Skip to content

Commit 44c6947

Browse files
authored
Remove snippet from WebResult since the web source does not provide it (#2843)
1 parent 09dd0ef commit 44c6947

File tree

5 files changed

+1
-15
lines changed

5 files changed

+1
-15
lines changed

app/backend/approaches/approach.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ class WebResult:
109109
id: Optional[str] = None
110110
title: Optional[str] = None
111111
url: Optional[str] = None
112-
snippet: Optional[str] = None
113112
activity: Optional[ActivityDetail] = None
114113

115114
def serialize_for_results(self) -> dict[str, Any]:
@@ -119,7 +118,6 @@ def serialize_for_results(self) -> dict[str, Any]:
119118
"ref_id": str(self.id),
120119
"title": self.title,
121120
"url": self.url,
122-
"snippet": self.snippet,
123121
"activity": asdict(self.activity) if self.activity else None,
124122
}
125123

@@ -797,7 +795,6 @@ def clean_source(s: str) -> str:
797795
"id": web.id,
798796
"title": web.title,
799797
"url": web.url,
800-
"snippet": clean_source(web.snippet or ""),
801798
"activity": asdict(web.activity) if web.activity else None,
802799
}
803800
)

app/frontend/src/components/SupportingContent/SupportingContent.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ export const SupportingContent = ({ supportingContent }: Props) => {
4242
) : (
4343
<h4 className={styles.supportingContentItemHeader}>{item.title ?? "Web result"}</h4>
4444
)}
45-
{item.snippet && <p className={styles.supportingContentItemText} dangerouslySetInnerHTML={{ __html: DOMPurify.sanitize(item.snippet) }} />}
4645
</li>
4746
))}
4847
</ul>

tests/mocks.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -491,13 +491,7 @@ def mock_retrieval_response_with_web():
491491
"sourcefile": "Benefit_Options.pdf",
492492
},
493493
),
494-
KnowledgeBaseWebReference(
495-
id=1,
496-
activity_source=2,
497-
url="https://contoso.example",
498-
title="Contoso site",
499-
snippet="Contoso policy overview",
500-
),
494+
KnowledgeBaseWebReference(id=1, activity_source=2, url="https://contoso.example", title="Contoso site"),
501495
],
502496
)
503497

tests/snapshots/test_app/test_ask_rtr_text_agent/knowledgebase_client1_web/result.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
"type": "web"
3232
},
3333
"id": 1,
34-
"snippet": "",
3534
"title": "Contoso site",
3635
"url": "https://contoso.example"
3736
}
@@ -75,7 +74,6 @@
7574
},
7675
"id": 1,
7776
"ref_id": "1",
78-
"snippet": null,
7977
"title": "Contoso site",
8078
"type": "web",
8179
"url": "https://contoso.example"

tests/snapshots/test_app/test_chat_text_agent/knowledgebase_client1_web/result.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
"type": "web"
3232
},
3333
"id": 1,
34-
"snippet": "",
3534
"title": "Contoso site",
3635
"url": "https://contoso.example"
3736
}
@@ -76,7 +75,6 @@
7675
},
7776
"id": 1,
7877
"ref_id": "1",
79-
"snippet": null,
8078
"title": "Contoso site",
8179
"type": "web",
8280
"url": "https://contoso.example"

0 commit comments

Comments
 (0)