Spaces:
Running
Running
Vedika commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -36,7 +36,6 @@ def chat():
|
|
| 36 |
user_message = data.get("message", "")
|
| 37 |
attachments = data.get("attachments", [])
|
| 38 |
system_prompt = data.get("system_prompt", "")
|
| 39 |
-
history = data.get("history", []) # <-- यहाँ मैंने हिस्ट्री को रिसीव करने का कोड जोड़ा है
|
| 40 |
max_tokens = data.get("max_tokens", 4096)
|
| 41 |
temperature = data.get("temperature", 0.6)
|
| 42 |
|
|
@@ -46,14 +45,7 @@ def chat():
|
|
| 46 |
if system_prompt.strip():
|
| 47 |
messages.append({"role": "system", "content": system_prompt})
|
| 48 |
|
| 49 |
-
# 2.
|
| 50 |
-
for msg in history:
|
| 51 |
-
role = msg.get("role", "user")
|
| 52 |
-
content = msg.get("content", "")
|
| 53 |
-
if content:
|
| 54 |
-
messages.append({"role": role, "content": content})
|
| 55 |
-
|
| 56 |
-
# 3. मल्टीमोडल इनपुट (करेंट मैसेज)
|
| 57 |
content_payload = []
|
| 58 |
if user_message.strip():
|
| 59 |
content_payload.append({"type": "text", "text": user_message})
|
|
|
|
| 36 |
user_message = data.get("message", "")
|
| 37 |
attachments = data.get("attachments", [])
|
| 38 |
system_prompt = data.get("system_prompt", "")
|
|
|
|
| 39 |
max_tokens = data.get("max_tokens", 4096)
|
| 40 |
temperature = data.get("temperature", 0.6)
|
| 41 |
|
|
|
|
| 45 |
if system_prompt.strip():
|
| 46 |
messages.append({"role": "system", "content": system_prompt})
|
| 47 |
|
| 48 |
+
# 2. मल्टीमोडल इनपुट
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
content_payload = []
|
| 50 |
if user_message.strip():
|
| 51 |
content_payload.append({"type": "text", "text": user_message})
|