Update app.py
Browse files
app.py
CHANGED
|
@@ -3,7 +3,6 @@ import openai
|
|
| 3 |
import gradio as gr
|
| 4 |
|
| 5 |
|
| 6 |
-
|
| 7 |
# Set up OpenAI API credentials
|
| 8 |
api_key = os.environ.get("OPENAI_API_KEY")
|
| 9 |
openai.api_key = api_key
|
|
@@ -60,13 +59,10 @@ def openai_chat_history(input, history):
|
|
| 60 |
conversation_prompt = "Welcome to ChatRobo, kindly type in your enquiries: "
|
| 61 |
|
| 62 |
# Set up the Gradio interface
|
| 63 |
-
textbox = gr.components.Input(type="text", label=conversation_prompt)
|
| 64 |
-
textbox_output = gr.outputs.Textbox(label="ChatRobo Output")
|
| 65 |
-
|
| 66 |
block = gr.Interface(
|
| 67 |
fn=openai_chat_history,
|
| 68 |
-
inputs=
|
| 69 |
-
outputs=
|
| 70 |
)
|
| 71 |
|
| 72 |
# Launch the Gradio interface
|
|
|
|
| 3 |
import gradio as gr
|
| 4 |
|
| 5 |
|
|
|
|
| 6 |
# Set up OpenAI API credentials
|
| 7 |
api_key = os.environ.get("OPENAI_API_KEY")
|
| 8 |
openai.api_key = api_key
|
|
|
|
| 59 |
conversation_prompt = "Welcome to ChatRobo, kindly type in your enquiries: "
|
| 60 |
|
| 61 |
# Set up the Gradio interface
|
|
|
|
|
|
|
|
|
|
| 62 |
block = gr.Interface(
|
| 63 |
fn=openai_chat_history,
|
| 64 |
+
inputs=[gr.inputs.Textbox(placeholder=conversation_prompt)],
|
| 65 |
+
outputs=[gr.outputs.Textbox(label="ChatRobo Output")]
|
| 66 |
)
|
| 67 |
|
| 68 |
# Launch the Gradio interface
|