import gradio as gr from gemini_sdk import GeminiChat # Replace with actual Gemini library if available # Set your Gemini API key gemini_api_key = "AIzaSyApFLfSfK9iodZ6pmxos_x-FLIleh0xaMM" # Initialize the Gemini Chat instance chatbot = GeminiChat(api_key=gemini_api_key) # Function to handle chatbot interaction def chatbot_response(user_input): try: # Send user input to the Gemini model and get the response response = chatbot.query(user_input) return response except Exception as e: return f"Error: {str(e)}" # Create the Gradio interface iface = gr.Interface( fn=chatbot_response, inputs=gr.Textbox(label="Enter your question"), outputs=gr.Textbox(label="Chatbot Response"), title="Real Estate Chatbot", description="Ask the chatbot about real estate listings, house details, or anything related to real estate." ) # Launch the interface iface.launch()