← Về thư mục
skills/research-lookup/scripts/research_lookup.py
- ResearchLookup · class · L133-L976 — class ResearchLookup
- init · method · L143-L236 — def init( self, force_backend: str | None = None, *, academic: bool | None = None, target_references: int = DEFAULT_TARGET_REFERENCES, search_mode: str = "basic", max_results: int = DEFAULT_MAX_RESULTS, include_domains: list[str] | None = None, after_date: str | None = None, extract_limit: int | None = None, extract_batch_size: int = DEFAULT_EXTRACT_BATCH_SIZE, processor: str = "pro-fast", chat_model: str = "core", previous_interaction_id: str | None = None, allow_perplexity_fallback: bool = False, manuscript_context: dict[str, Any] | None = None, cli_timeout: int = 300, research_timeout: int = 3600, )
- _select_backend · method · L238-L247 — def _select_backend(self, query: str) -> str
- _is_academic_query · method · L249-L253 — def _is_academic_query(self, query: str) -> bool
- _query_with_context · method · L255-L265 — def _query_with_context(self, query: str) -> str
- _run_parallel_cli · method · L267-L297 — def _run_parallel_cli( self, args: list[str], *, timeout: int | None = None ) -> dict[str, Any]
- _usage_counts · method · L300-L306 — def _usage_counts(payloads: list[dict[str, Any]]) -> list[dict[str, Any]]
- _search_once · method · L308-L368 — def _search_once( self, *, objective: str, keyword_queries: tuple[str, ...], facet: str, academic_domains: bool, mode: str, session_id: str | None = None, apply_after_date: bool = True, ) -> tuple[dict[str, Any], dict[str, Any], list[dict[str, Any]]]
- _rank_sources_for_extraction · method · L370-L378 — def _rank_sources_for_extraction( self, sources: list[dict[str, Any]] ) -> list[dict[str, Any]]
- _extract_sources · method · L380-L447 — def _extract_sources( self, sources: list[dict[str, Any]], search_ledger: list[dict[str, Any]] ) -> tuple[list[dict[str, Any]], list[dict[str, Any]]]
- _parallel_search · method · L449-L600 — def _parallel_search(self, query: str) -> dict[str, Any]
- _find_report_text · method · L603-L622 — def _find_report_text(payload: Any) -> str
- _sources_from_payload · method · L625-L649 — def _sources_from_payload(payload: Any) -> list[dict[str, str]]
- walk · function · L628-L643 — def walk(value: Any) -> None
- _parallel_research · method · L651-L703 — def _parallel_research(self, query: str) -> dict[str, Any]
- _parallel_chat · method · L705-L759 — def _parallel_chat(self, query: str) -> dict[str, Any]
- _perplexity_lookup · method · L761-L829 — def _perplexity_lookup(self, query: str) -> dict[str, Any]
- _extract_api_citations · method · L832-L881 — def _extract_api_citations( response: dict[str, Any], choice: dict[str, Any] ) -> list[dict[str, str]]
- _extract_citations_from_text · method · L884-L908 — def _extract_citations_from_text(text: str) -> list[dict[str, str]]
- _failure_result · method · L911-L919 — def _failure_result(query: str, backend: str, exc: Exception) -> dict[str, Any]
- lookup · method · L921-L959 — def lookup(self, query: str) -> dict[str, Any]
- batch_lookup · method · L961-L976 — def batch_lookup( self, queries: list[str], delay: float = 1.0 ) -> list[dict[str, Any]]
- _load_context · function · L979-L985 — def _load_context(path: str | None) -> dict[str, Any]
- _split_domains · function · L988-L992 — def _split_domains(values: list[str] | None) -> list[str]
- _slug · function · L995-L996 — def _slug(text: str) -> str
- _render_human_result · function · L999-L1025 — def _render_human_result(result: dict[str, Any], index: int) -> str
- build_parser · function · L1028-L1141 — def build_parser() -> argparse.ArgumentParser
- main · function · L1144-L1200 — def main() -> int