import gradio as gr from qdrant import qdrant_manager from openai_manager import openai_manager def generate(keywords): try: keywords_list = list(map(lambda x: x.strip(), keywords.split(","))) except: keywords_list = [] gr.Warning("Please use ',' to separate Keywords") print("kewords", " ".join(keywords_list)) embedding = openai_manager.get_embeddings("hello my name is zinou") points = qdrant_manager.search_point(query_vector=embedding[0]) return openai_manager.shots(points, " ".join(keywords_list)) iface = gr.Interface(fn=generate, inputs="text", outputs="text") iface.launch()