Spaces:
Sleeping
Sleeping
| from firebase_admin import firestore | |
| def save_chat(user_id: str, user_input: str, ai_response: str): | |
| db = firestore.client() | |
| db.collection("chats").add({ | |
| "user_id": user_id, | |
| "input": user_input, | |
| "response": ai_response, | |
| "timestamp": firestore.SERVER_TIMESTAMP | |
| }) |