Spaces:
Sleeping
Sleeping
mdimage
Browse files- README.md +4 -0
- app.py +8 -2
- screenshots/gobstart.png +0 -0
README.md
CHANGED
|
@@ -64,6 +64,7 @@ This is a simple chatbot that allows users to place orders through a chat interf
|
|
| 64 |
SMTP_PORT=your_smtp_port
|
| 65 |
EMAIL_ADDRESS=your_email@example.com
|
| 66 |
EMAIL_PASSWORD=your_email_password
|
|
|
|
| 67 |
```
|
| 68 |
|
| 69 |
5. **Run the Chatbot**
|
|
@@ -74,6 +75,9 @@ This is a simple chatbot that allows users to place orders through a chat interf
|
|
| 74 |
|
| 75 |
## Usage
|
| 76 |
|
|
|
|
|
|
|
|
|
|
| 77 |
1. **Start the Chatbot**
|
| 78 |
|
| 79 |
Run the `app.py` script to start the Gradio interface. Navigate to the URL provided by Gradio (e.g., `http://localhost:7860`) to start interacting with the chatbot.
|
|
|
|
| 64 |
SMTP_PORT=your_smtp_port
|
| 65 |
EMAIL_ADDRESS=your_email@example.com
|
| 66 |
EMAIL_PASSWORD=your_email_password
|
| 67 |
+
INTERACTIVE=1
|
| 68 |
```
|
| 69 |
|
| 70 |
5. **Run the Chatbot**
|
|
|
|
| 75 |
|
| 76 |
## Usage
|
| 77 |
|
| 78 |
+

|
| 79 |
+
[See the working demo here](https://huggingface.co/spaces/JanfNavf/GPT_order_bot)
|
| 80 |
+
|
| 81 |
1. **Start the Chatbot**
|
| 82 |
|
| 83 |
Run the `app.py` script to start the Gradio interface. Navigate to the URL provided by Gradio (e.g., `http://localhost:7860`) to start interacting with the chatbot.
|
app.py
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from completion_tools import OpenAITools
|
| 3 |
from contexts import store_types, pizza_shop_context
|
| 4 |
from email_sender import send_email
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
tools = OpenAITools()
|
|
|
|
| 7 |
|
| 8 |
with gr.Blocks() as demo:
|
| 9 |
appTitle = gr.Label("GPT Order Bot", color="#6EACDA")
|
|
@@ -14,8 +19,9 @@ with gr.Blocks() as demo:
|
|
| 14 |
context = gr.Dropdown(label="Store type", value=store_types[0], choices=store_types)
|
| 15 |
label = gr.Label("Set your Order Bot")
|
| 16 |
gr.Markdown("If you want to send confirmation email you must run it locally [GitHub repo](https://github.com/jorge-armando-navarro-flores/GPT_order_bot)")
|
| 17 |
-
email = gr.Textbox(label="Email", placeholder="Input your Email", interactive=
|
| 18 |
-
|
|
|
|
| 19 |
|
| 20 |
with gr.Column(scale=3):
|
| 21 |
chatbot = gr.Chatbot(pizza_shop_context, type="messages")
|
|
|
|
| 1 |
+
import os
|
| 2 |
import gradio as gr
|
| 3 |
from completion_tools import OpenAITools
|
| 4 |
from contexts import store_types, pizza_shop_context
|
| 5 |
from email_sender import send_email
|
| 6 |
+
from dotenv import load_dotenv
|
| 7 |
+
|
| 8 |
+
load_dotenv()
|
| 9 |
|
| 10 |
tools = OpenAITools()
|
| 11 |
+
interac = bool(int(os.environ.get("INTERACTIVE")))
|
| 12 |
|
| 13 |
with gr.Blocks() as demo:
|
| 14 |
appTitle = gr.Label("GPT Order Bot", color="#6EACDA")
|
|
|
|
| 19 |
context = gr.Dropdown(label="Store type", value=store_types[0], choices=store_types)
|
| 20 |
label = gr.Label("Set your Order Bot")
|
| 21 |
gr.Markdown("If you want to send confirmation email you must run it locally [GitHub repo](https://github.com/jorge-armando-navarro-flores/GPT_order_bot)")
|
| 22 |
+
email = gr.Textbox(label="Email", placeholder="Input your Email", interactive=interac)
|
| 23 |
+
print(type(interac))
|
| 24 |
+
send = gr.Button("Send Confirmation Email", interactive=interac)
|
| 25 |
|
| 26 |
with gr.Column(scale=3):
|
| 27 |
chatbot = gr.Chatbot(pizza_shop_context, type="messages")
|
screenshots/gobstart.png
ADDED
|