import gradio as gr from utils.search_utils import find_relevant_bounty def chatbot_response(user_query): # Find the most relevant bounty bounty = find_relevant_bounty(user_query) if bounty: return ( f"Title: {bounty['title']}\n" f"Description: {bounty['description']}\n" f"Answer: {bounty['answer']}\n" f"Score: {bounty['score']}\n" ) else: return "No relevant bounties found." # Gradio interface interface = gr.Interface( fn=chatbot_response, inputs="text", outputs="text", title="Big Bounty Search Chatbot" ) if __name__ == "__main__": interface.launch()