class_docstr: Static retrieval service client class.
  It implements the retrieval services interface, has a simple client to do KNN queries.
docstr: Get K-nearest neighbor chunks based on the input query
  
  Args:
      query (Union[List[str], str, torch.Tensor]): query str, list of str or token ids in torch.Tensor type
      neighbors (int): number of neighbors to query
docstr_tok: ["Get","K-nearest","neighbor","chunks","based","on","the","input","query","Args",":","query","(","Union","[","List","[","str","]",",","str",",","torch.Tensor","]",")",":","query","str",",","list","of","str","or","token","ids","in","torch.Tensor","type","neighbors","(","int",")",":","number","of","neighbors","to","query"]
code: def get_knn(
      self, query: Union[List[str], str, torch.Tensor], neighbors
  ):
      """Get K-nearest neighbor chunks based on the input query
  
      Args:
          query (Union[List[str], str, torch.Tensor]): query str, list of str or token ids in torch.Tensor type
          neighbors (int): number of neighbors to query
      """
  
      if isinstance(query, torch.Tensor):
          sentence_list = []
          for q in query:
              text = self.tokenizer.ids_to_text(q)
              sentence_list.append(text)
          query = sentence_list
      data = {"sentences": query}
      data["neighbors"] = neighbors
      result = request_data(data, self.service_ip, self.service_port)
      result = np.array(result)
      return result
  
imports: import abc
  import logging
  import threading
  from typing import List, Union
  import numpy
  import torch
  from nemo.collections.common.tokenizers.tokenizer_spec import TokenizerSpec
  from nemo.collections.nlp.modules.common.megatron.retrieval_services.util import request_data
label_desc: Use image node_id 2 for calling the FaissRetrievalService obj's underlying member method code with example usage: obj.get_knn(query, neighbors) and returns: result