Spaces:
Running
Running
Vedika commited on
Update app.py
Browse files35 unmodified lines3637383940413 unmodified lines4546474849505142 unmodified lines9495969735 unmodified linesuser_message = data.get("message", "")attachments = data.get("attachments", [])system_prompt = data.get("system_prompt", "")max_tokens = data.get("max_tokens", 4096)temperature = data.get("temperature", 0.6)3 unmodified linesif system_prompt.strip():messages.append({"role": "system", "content": system_prompt})# 2. मल्टीमोडल इनपुटcontent_payload = []if user_message.strip():content_payload.append({"type": "text", "text": user_message})42 unmodified linesreturn Response("Internal Error: Unable to process request securely.", status=500)if __name__ == '__main__':app.run(host='0.0.0.0', port=7860)35 unmodified lines363738394041423 unmodified lines464748495051525354555657585942 unmodified lines10210310410535 unmodified linesuser_message = data.get("message", "")attachments = data.get("attachments", [])system_prompt = data.get("system_prompt", "")history = data.get("history", []) # <-- यहाँ मैंने हिस्ट्री को रिसीव करने का कोड जोड़ा हैmax_tokens = data.get("max_tokens", 4096)temperature = data.get("temperature", 0.6)3 unmodified linesif system_prompt.strip():messages.append({"role": "system", "content": system_prompt})# 2. पुरानी हिस्ट्री (Memory) जोड़ना ताकि अर्जुन पुरानी बातें याद रखे <-- यह ब्लॉक नया जोड़ा गया हैfor msg in history:role = msg.get("role", "user")content = msg.get("content", "")if content:messages.append({"role": role, "content": content})# 3. मल्टीमोडल इनपुट (करेंट मैसेज)content_payload = []if user_message.strip():content_payload.append({"type": "text", "text": user_message})42 unmodified linesreturn Response("Internal Error: Unable to process request securely.", status=500)if __name__ == '__main__':app.run(host='0.0.0.0', port=7860)
app.py+10-2