def get_suggestions()

in backend/matching-engine/services/multimodal_text_to_image_match_service.py [0:0]


    def get_suggestions(self, num_items: int = 60) -> List[Item]:
        """Get suggestions for search queries."""
        text_prompts = (
            [Item(id=word, text=word, image=None) for word in self.prompt_texts]
            if self.allows_text_input
            else []
        )
        image_prompts = (
            [
                Item(id=image_url, text="", image=image_url)
                for image_url in self.prompt_images
            ]
            if self.allows_image_input
            else []
        )

        prompts = text_prompts + image_prompts

        return random.sample(
            prompts,
            min(num_items, len(prompts)),
        )