Spaces:
Runtime error
Runtime error
| import gradio as gr | |
| import interpreter | |
| # Set your OpenAI API key | |
| interpreter.api_key = "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" | |
| # Define the chat function using the interpreter library | |
| def chat(input_text): | |
| response = interpreter.chat(input_text) | |
| return response | |
| # Create a Gradio interface | |
| iface = gr.Interface(fn=chat, inputs="text", outputs="text", live=True) | |
| # Launch the interface | |
| iface.launch() | |