def product_identifier_func(query: str): """ Identifies products based on a given query and retrieves relevant details for each identified product. Parameters: query (str): The query string used to identify products. Returns: dict: A dictionary where the keys are product names and the values are details of each product. If no products are found, returns "No product found". """ product_understanding = product_identifier.run({"prompt_builder": {"question": query}}) try: product_list = literal_eval(product_understanding["llm"]["replies"][0]) except: return "No product found" results = {} for product in product_list: response = rag_pipe.run({"embedder": {"text": product}, "prompt_builder": {"question": product}}) try: results[product] = literal_eval(response["llm"]["replies"][0]) except: results[product] = {} return results