def get_documents(
      self,
      query: str,
      original_query: str,
      num_documents: Optional[int] = None,
      num_ir_documents: Optional[int] = None,
  ) -> environment_pb2.GetDocumentsResponse:
    """Get k best documents from search environment for given query.

    Args:
      query: str, Query for the retrieval.
      original_query: str, Original query.
      num_documents: Number of documents to retrieve.
      num_ir_documents: Number of documents to retrieve from underlying IR.

    Returns:
      The k top scoring documents as a list of common_pb2.Documents.
    """
    retrieval_mode = environment_pb2.RetrievalRequestType.Value(
        common_flags.RETRIEVAL_MODE.value)
    reader_mode = environment_pb2.ReaderRequestType.Value(
        common_flags.READER_MODE.value)

    if not num_documents:
      num_documents = common_flags.NUM_DOCUMENTS_TO_RETRIEVE.value
    if not num_ir_documents:
      num_ir_documents = num_documents
    req_query = environment_pb2.Query(
        query_with_operations=query, query=original_query)
    request = environment_pb2.GetDocumentsRequest(
        request_type=retrieval_mode,
        query=req_query,
        max_num_results=num_documents,
        max_num_ir_results=num_ir_documents,
        reader_request_type=reader_mode)
    docs = self._call_rpc(stub_method=self._stub.GetDocuments, request=request)
    return docs
Get k best documents from search environment for given query.

    Args:
      query: str, Query for the retrieval.
      original_query: str, Original query.
      num_documents: Number of documents to retrieve.
      num_ir_documents: Number of documents to retrieve from underlying IR.

    Returns:
      The k top scoring documents as a list of common_pb2.Documents.
    
language/search_agents/muzero/server.py