Spaces:
Sleeping
Sleeping
bill.py
CHANGED
|
@@ -60,7 +60,7 @@ def check_related_keys(question, user_id):
|
|
| 60 |
bill_keys.update(bill.keys())
|
| 61 |
return [key for key in bill_keys if key.lower() in question.lower()]
|
| 62 |
|
| 63 |
-
def process_query(query, user_id):
|
| 64 |
user_data = load_user_data(user_id)
|
| 65 |
bill_info = user_data.get("bills", [])
|
| 66 |
related_keys = check_related_keys(query, user_id)
|
|
@@ -85,12 +85,21 @@ def process_query(query, user_id):
|
|
| 85 |
st.warning("Prea multe caractere în context, solicitarea nu va fi trimisă.")
|
| 86 |
return None
|
| 87 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
return context
|
| 89 |
|
| 90 |
def main():
|
| 91 |
-
|
| 92 |
st.title("Telecom Bill Chat with LLM Agent")
|
| 93 |
|
|
|
|
|
|
|
| 94 |
if "user_id" not in st.session_state:
|
| 95 |
st.session_state.user_id = None
|
| 96 |
|
|
|
|
| 60 |
bill_keys.update(bill.keys())
|
| 61 |
return [key for key in bill_keys if key.lower() in question.lower()]
|
| 62 |
|
| 63 |
+
def process_query(query, user_id, model):
|
| 64 |
user_data = load_user_data(user_id)
|
| 65 |
bill_info = user_data.get("bills", [])
|
| 66 |
related_keys = check_related_keys(query, user_id)
|
|
|
|
| 85 |
st.warning("Prea multe caractere în context, solicitarea nu va fi trimisă.")
|
| 86 |
return None
|
| 87 |
|
| 88 |
+
# Update this part to run the chosen model
|
| 89 |
+
if model == "4o":
|
| 90 |
+
# Code to run model 4o
|
| 91 |
+
st.write("Running model 4o")
|
| 92 |
+
elif model == "4o-mini":
|
| 93 |
+
# Code to run model 4o-mini
|
| 94 |
+
st.write("Running model 4o-mini")
|
| 95 |
+
|
| 96 |
return context
|
| 97 |
|
| 98 |
def main():
|
|
|
|
| 99 |
st.title("Telecom Bill Chat with LLM Agent")
|
| 100 |
|
| 101 |
+
# Create a sidebar menu to choose between models
|
| 102 |
+
model = st.sidebar.selectbox("Choose OpenAI Model", ["4o", "4o-mini"])
|
| 103 |
if "user_id" not in st.session_state:
|
| 104 |
st.session_state.user_id = None
|
| 105 |
|