Find
Search dashboard pages and product views.
Repositories
Evidence Refs
Run Artifacts
Trace Refs
Replay Entry
Search dashboard pages and product views.
These are repository signals used to attribute this repo to the product. They are not code written by the agent; they are matched package, middleware, environment, API, or UI locations found in the repository.
| Repository Signal | Matched Source | Matched Code Location | Preview |
|---|---|---|---|
source | fetch_web_pages(): an aiohttp ClientSession fetches each result URL concurrentlythen returns [trafilatura.extract(page) for page in html_web_pages]. | backend/sensei_search/base_agent.pyline 189 | Preview |
source | import trafilatura. | backend/sensei_search/base_agent.pyline 9 | Preview |
1from __future__ import annotations2 3import asyncio4import uuid5from abc import ABC, abstractmethod6from enum import Enum7from typing import Dict, List, Literal, Optional, Protocol, Union8 9import trafilatura # type: ignore[import]10from aiohttp import ClientSession, ClientTimeout11from pydantic import BaseModel, Field12from typing_extensions import TypedDict13 14from sensei_search.chat_store import ChatHistoryItem, ChatStore, ThreadMetadata15from sensei_search.logger import logger16from sensei_search.models import MediumImage, MediumVideo, MetaData, WebResult17from sensei_search.tools import GeneralResult, TopResults18 19FETCH_WEBPAGE_TIMEOUT = 320 21 181 async def emit_related_questions(self, related_questions: List[str]) -> None:182 """183 Send the related questions to the frontend.184 """185 await self.emitter.emit(186 EventEnum.related_questions.value, {"data": related_questions}187 )188 189 async def fetch_web_pages(self, results: List[GeneralResult]) -> List[str]:190 """191 Fetch the web page contents for the search results.192 """193 194 async def fetch_page(url: str, session: ClientSession) -> str:195 try:196 async with session.get(url) as response:197 return await response.text()198 except asyncio.TimeoutError:199 logger.warning(f"Timeout occurred when fetching {url}")200 except Exception as e:201 logger.exception(f"Error fetching {url}: {e}")202 return ""203 204 timeout = ClientTimeout(total=FETCH_WEBPAGE_TIMEOUT)205 async with ClientSession(timeout=timeout) as session:206 tasks = [fetch_page(result["url"], session) for result in results]207 html_web_pages = await asyncio.gather(*tasks)208 return [trafilatura.extract(page) for page in html_web_pages]209 210 async def save_chat_history(211 self,212 user_message: str,213 answer: str,214 medium_results: TopResults,215 general_results: List[GeneralResult],216 metadata: MetaData,217 ) -> None:218 """219 Save the chat history to Redis.220 """