Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -17,7 +17,6 @@ db = firestore.client()
|
|
17 |
# π OpenAI setup
|
18 |
openai_key = os.getenv("openai_key")
|
19 |
assistant_id = os.getenv("ASSISTANT_ID")
|
20 |
-
|
21 |
client = OpenAI(api_key=openai_key)
|
22 |
|
23 |
# π Streamlit Config
|
@@ -26,7 +25,6 @@ st.set_page_config(page_title="Carfind.co.za AI Assistant", layout="wide")
|
|
26 |
# π― Session + User ID
|
27 |
if "user_id" not in st.session_state:
|
28 |
st.session_state["user_id"] = str(uuid.uuid4())
|
29 |
-
|
30 |
user_id = st.session_state["user_id"]
|
31 |
|
32 |
# πΌοΈ Branding + Styling
|
@@ -141,7 +139,7 @@ with tab1:
|
|
141 |
time.sleep(0.5)
|
142 |
st.rerun()
|
143 |
|
144 |
-
# π What car is that? Tab
|
145 |
with tab2:
|
146 |
uploaded_image = st.file_uploader("Upload an image of a car and let Ai identify it for you", type=["jpg", "jpeg", "png"])
|
147 |
|
@@ -167,7 +165,7 @@ with tab2:
|
|
167 |
},
|
168 |
{
|
169 |
"type": "text",
|
170 |
-
"text": "Please identify this car from the image."
|
171 |
}
|
172 |
]
|
173 |
)
|
@@ -200,8 +198,8 @@ with tab2:
|
|
200 |
border-radius: 10px;
|
201 |
border-left: 6px solid #4CAF50;
|
202 |
box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
|
|
|
203 |
'>
|
204 |
-
<span style='font-size: 18px; font-weight: bold;'>π Identified Car Details:</span><br><br>
|
205 |
{assistant_message}
|
206 |
</div>
|
207 |
""", unsafe_allow_html=True)
|
|
|
17 |
# π OpenAI setup
|
18 |
openai_key = os.getenv("openai_key")
|
19 |
assistant_id = os.getenv("ASSISTANT_ID")
|
|
|
20 |
client = OpenAI(api_key=openai_key)
|
21 |
|
22 |
# π Streamlit Config
|
|
|
25 |
# π― Session + User ID
|
26 |
if "user_id" not in st.session_state:
|
27 |
st.session_state["user_id"] = str(uuid.uuid4())
|
|
|
28 |
user_id = st.session_state["user_id"]
|
29 |
|
30 |
# πΌοΈ Branding + Styling
|
|
|
139 |
time.sleep(0.5)
|
140 |
st.rerun()
|
141 |
|
142 |
+
# π "What car is that?" Tab
|
143 |
with tab2:
|
144 |
uploaded_image = st.file_uploader("Upload an image of a car and let Ai identify it for you", type=["jpg", "jpeg", "png"])
|
145 |
|
|
|
165 |
},
|
166 |
{
|
167 |
"type": "text",
|
168 |
+
"text": "Please identify this car from the image and include a full vehicle specification table, a short overview of the car, and who it's recommended for."
|
169 |
}
|
170 |
]
|
171 |
)
|
|
|
198 |
border-radius: 10px;
|
199 |
border-left: 6px solid #4CAF50;
|
200 |
box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
|
201 |
+
line-height: 1.6;
|
202 |
'>
|
|
|
203 |
{assistant_message}
|
204 |
</div>
|
205 |
""", unsafe_allow_html=True)
|