Spaces:
Sleeping
Sleeping
Added button to turn help on or off
Browse files
app.py
CHANGED
|
@@ -17,12 +17,17 @@ context = read_dataset(dataset)
|
|
| 17 |
|
| 18 |
st.title("Adrega AI Help")
|
| 19 |
user_input = st.text_input('Ask me a question')
|
|
|
|
| 20 |
|
| 21 |
if st.button("Submit"):
|
| 22 |
if user_input:
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
]
|
| 27 |
|
| 28 |
completion = client.chat.completions.create(
|
|
|
|
| 17 |
|
| 18 |
st.title("Adrega AI Help")
|
| 19 |
user_input = st.text_input('Ask me a question')
|
| 20 |
+
include_context = = st.checkbox('Search in Help')
|
| 21 |
|
| 22 |
if st.button("Submit"):
|
| 23 |
if user_input:
|
| 24 |
+
if include_context:
|
| 25 |
+
messages = [
|
| 26 |
+
{"role": "system", "content": f"Context: {context}"},
|
| 27 |
+
{"role": "user", "content": user_input}
|
| 28 |
+
]
|
| 29 |
+
else: messages = [
|
| 30 |
+
{"role": "user", "content": user_input}
|
| 31 |
]
|
| 32 |
|
| 33 |
completion = client.chat.completions.create(
|