code: def get_search_documents(
      self,
      query,
      query_action=True,
      chunk=True,
      chunk_size=512,
      db_type="chroma",
      headsize=50,
      top_k_docs=-1,
  ):
      docs = self.run(query, headsize)
  
      chunk_sources = functools.partial(
          _chunk_sources,
          chunk=chunk,
          chunk_size=chunk_size,
          db_type=db_type,
      )
      docs = chunk_sources(docs)
  
      # choose chunk type
      if query_action:
          docs = [x for x in docs if x.metadata["chunk_id"] >= 0]
      else:
          docs = [x for x in docs if x.metadata["chunk_id"] == -1]
  
      # get score assuming search results scale with ranking
      delta = 0.05
      [
          x.metadata.update(
              score=0.1 + delta * x.metadata["chunk_id"]
              if x.metadata["chunk_id"] >= 0
              else -1
          )
          for x in docs
      ]
  
      # ensure see all results up to cutoff or mixing with non-web docs
      if top_k_docs >= 1:
          top_k_docs = max(top_k_docs, len(docs))
  
      return docs, top_k_docs
  
file_path: h2ogpt/src/serpapi.py
imports: import functools
  import typing
  import aiohttp
  from langchain.docstore.document import Document
  from langchain.utilities import SerpAPIWrapper
  from src.utils_langchain import _chunk_sources, add_parser, _add_meta
  from urllib.parse import urlparse
label_desc: Use image node_id 1 for calling the H2OSerpAPIWrapper obj's underlying member method code with example usage: obj.get_search_documents(query, query_action, chunk, chunk_size, db_type, headsize, top_k_docs) and returns: docs,  top_k_docs