class_docstr: A recommendation environment which generates items with visible features
  randomly (parametric actions).
  The environment can be configured to be multi-user, i.e. different models
  will be learned independently for each user, by setting num_users_in_db
  parameter.
  To enable slate recommendation, the `slate_size` config parameter can be
  set as > 1.
class_docstr_tok: ["A","recommendation","environment","which","generates","items","with","visible","features","randomly","(","parametric","actions",")",".","The","environment","can","be","configured","to","be","multi-user",",","i.e",".","different","models","will","be","learned","independently","for","each","user",",","by","setting","num_users_in_db","parameter",".","To","enable","slate","recommendation",",","the","`","slate_size","`","config","parameter","can","be","set","as",">","1","."]
code: def _get_obs(self, response=None):
      # Sample D docs from infinity or our pre-existing docs.
      # Pick from a only-once-sampled docs DB.
      if self.num_docs_in_db is not None:
          if self.docs_db is None:
              self.docs_db = [
                  self._get_embedding()
                  for _ in range(self.num_docs_in_db)
              ]
          self.currently_suggested_docs = [
              self.docs_db[doc_idx].astype(np.float32)
              for doc_idx in np.random.choice(
                  self.num_docs_in_db,
                  size=(self.num_docs_to_select_from,),
                  replace=False,
              )
          ]
      # Pick from an infinite pool of docs.
      else:
          self.currently_suggested_docs = [
              self._get_embedding()
              for _ in range(self.num_docs_to_select_from)
          ]
  
      doc = {
          str(i): d for i, d in enumerate(self.currently_suggested_docs)
      }
  
      if not response:
          response = self.observation_space["response"].sample()
  
      return {
          "user": self.current_user.astype(np.float32),
          "doc": doc,
          "response": response,
      }
  
file_path: ray/python/ray/rllib/examples/env/bandit_envs_recommender_system.py
imports: import gymnasium
  import numpy
  from typing import Optional
  from ray.rllib.utils.numpy import softmax
label_desc: Use image node_id 5 for calling the ParametricRecSys obj's underlying member method code with example usage: obj._get_obs(response) and returns: dict