Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -14,6 +14,19 @@ ONB_GUIDELINES = {
|
|
14 |
"contact": "الاتصال بنا على الرقم 249-123-456-789 أو عبر البريد الإلكتروني [email protected]."
|
15 |
}
|
16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
# Map Arabic menu options to English keys
|
18 |
OPTION_TO_KEY = {
|
19 |
"التحقق من الرصيد": "balance",
|
@@ -43,9 +56,6 @@ def respond(option: str):
|
|
43 |
else:
|
44 |
return "عذرًا، لم يتم التعرف على الخيار المحدد."
|
45 |
|
46 |
-
# Arabic menu options
|
47 |
-
menu_options = list(OPTION_TO_KEY.keys())
|
48 |
-
|
49 |
# Omdurman National Bank-specific interface
|
50 |
with gr.Blocks(css=".gradio-container {direction: rtl;}") as demo:
|
51 |
gr.Markdown("# <center>بنك أم درمان الوطني - المساعد المصرفي</center>")
|
@@ -53,17 +63,25 @@ with gr.Blocks(css=".gradio-container {direction: rtl;}") as demo:
|
|
53 |
with gr.Tab("المحادثة"):
|
54 |
gr.Markdown("## اختر أحد الخيارات التالية:")
|
55 |
|
56 |
-
#
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
|
|
64 |
|
65 |
# Output textbox for responses
|
66 |
output = gr.Textbox(label="الرد", interactive=False)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
|
68 |
with gr.Tab("الإرشادات المصرفية"):
|
69 |
gr.Markdown("## إرشادات بنك أم درمان الوطني")
|
|
|
14 |
"contact": "الاتصال بنا على الرقم 249-123-456-789 أو عبر البريد الإلكتروني [email protected]."
|
15 |
}
|
16 |
|
17 |
+
# Arabic menu options
|
18 |
+
menu_options = [
|
19 |
+
"التحقق من الرصيد",
|
20 |
+
"الإبلاغ عن فقدان البطاقة",
|
21 |
+
"شروط الحصول على قرض",
|
22 |
+
"تحويل الأموال",
|
23 |
+
"فتح حساب جديد",
|
24 |
+
"أسعار الفائدة",
|
25 |
+
"فروع البنك",
|
26 |
+
"ساعات العمل",
|
27 |
+
"الاتصال بالبنك"
|
28 |
+
]
|
29 |
+
|
30 |
# Map Arabic menu options to English keys
|
31 |
OPTION_TO_KEY = {
|
32 |
"التحقق من الرصيد": "balance",
|
|
|
56 |
else:
|
57 |
return "عذرًا، لم يتم التعرف على الخيار المحدد."
|
58 |
|
|
|
|
|
|
|
59 |
# Omdurman National Bank-specific interface
|
60 |
with gr.Blocks(css=".gradio-container {direction: rtl;}") as demo:
|
61 |
gr.Markdown("# <center>بنك أم درمان الوطني - المساعد المصرفي</center>")
|
|
|
63 |
with gr.Tab("المحادثة"):
|
64 |
gr.Markdown("## اختر أحد الخيارات التالية:")
|
65 |
|
66 |
+
# Dropdown menu for questions
|
67 |
+
dropdown = gr.Dropdown(
|
68 |
+
choices=menu_options,
|
69 |
+
label="اختر سؤالك",
|
70 |
+
interactive=True
|
71 |
+
)
|
72 |
+
|
73 |
+
# Submit button
|
74 |
+
submit_btn = gr.Button("إرسال")
|
75 |
|
76 |
# Output textbox for responses
|
77 |
output = gr.Textbox(label="الرد", interactive=False)
|
78 |
+
|
79 |
+
# Link dropdown and button to response function
|
80 |
+
submit_btn.click(
|
81 |
+
fn=respond,
|
82 |
+
inputs=dropdown,
|
83 |
+
outputs=output
|
84 |
+
)
|
85 |
|
86 |
with gr.Tab("الإرشادات المصرفية"):
|
87 |
gr.Markdown("## إرشادات بنك أم درمان الوطني")
|