MCPcopy
hub / github.com/LazyAGI/LazyLLM / search

Method search

lazyllm/tools/tools/search/tencent_search.py:25–35  ·  view source on GitHub ↗
(self, query: str)

Source from the content-addressed store, hash-verified

23 'tms', '2020-12-29', self._cred, '', profile=client_profile)
24
25 def search(self, query: str) -> List[Dict[str, Any]]:
26 res_dict = self._client.call_json(
27 'SearchPro', {'Query': query, 'Mode': 2}, headers=self._headers)
28 pages = res_dict.get('Response', {}).get('Pages') or []
29 out: List[Dict[str, Any]] = []
30 for p in pages:
31 title = p.get('Title') or p.get('title') or ''
32 url = p.get('Url') or p.get('url') or p.get('Link') or p.get('link') or ''
33 snippet = p.get('Snippet') or p.get('snippet') or p.get('Description') or p.get('description') or ''
34 out.append(_make_result(title=title, url=url, snippet=snippet, source=self.source_name))
35 return out

Callers

nothing calls this directly

Calls 3

_make_resultFunction · 0.85
appendMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected