MCPcopy
hub / github.com/SqueezeAILab/LLMCompiler / search

Method search

src/docstore/wikipedia.py:241–253  ·  view source on GitHub ↗

Search for a term in the docstore, and if found save.

(self, term: str)

Source from the content-addressed store, hash-verified

239 self.one_sentence = one_sentence
240
241 def search(self, term: str) -> str:
242 """Search for a term in the docstore, and if found save."""
243 result = self.docstore.search(term)
244 if self.one_sentence:
245 result = result.split(". ")[0]
246 if self.char_limit is not None:
247 result = result[: self.char_limit]
248 if isinstance(result, Document):
249 self.document = result
250 return self._summary
251 else:
252 self.document = None
253 return result
254
255 async def asearch(self, term: str) -> str:
256 """Search for a term in the docstore, and if found save."""

Callers

nothing calls this directly

Calls 1

searchMethod · 0.45

Tested by

no test coverage detected