import gradio as gr from weaviate_explorer import WeaviateExplorer weaviate_explorer = WeaviateExplorer() def search(query, video_player): shorts = weaviate_explorer.explore(query) video_player.value = shorts[0]["link"] return video_player, "\n\n".join([f"{r['title']}\n{r['link']}" for r in shorts]) video_player = gr.Video(label="Search Results") iface = gr.Interface(fn=search, inputs="text", outputs=[ video_player, "text" ]) iface.launch()