Spaces:
Build error
Build error
Update services/chat_service.py
Browse files- services/chat_service.py +3 -2
services/chat_service.py
CHANGED
|
@@ -10,7 +10,7 @@ class ConversationManager:
|
|
| 10 |
"""Manages conversation history and context"""
|
| 11 |
def __init__(self):
|
| 12 |
self.conversations: Dict[str, List[Dict[str, Any]]] = {}
|
| 13 |
-
self.max_history =
|
| 14 |
|
| 15 |
def add_interaction(
|
| 16 |
self,
|
|
@@ -137,7 +137,7 @@ class ChatService:
|
|
| 137 |
for h in recent_history
|
| 138 |
)
|
| 139 |
context_parts.append(f"Letzte Interaktionen:\n{history_text}")
|
| 140 |
-
|
| 141 |
return "\n\n".join(context_parts)
|
| 142 |
|
| 143 |
async def chat(
|
|
@@ -231,6 +231,7 @@ class ChatService:
|
|
| 231 |
) -> str:
|
| 232 |
"""Generate response using the language model"""
|
| 233 |
try:
|
|
|
|
| 234 |
inputs = self.tokenizer(
|
| 235 |
prompt,
|
| 236 |
return_tensors="pt",
|
|
|
|
| 10 |
"""Manages conversation history and context"""
|
| 11 |
def __init__(self):
|
| 12 |
self.conversations: Dict[str, List[Dict[str, Any]]] = {}
|
| 13 |
+
self.max_history = 1
|
| 14 |
|
| 15 |
def add_interaction(
|
| 16 |
self,
|
|
|
|
| 137 |
for h in recent_history
|
| 138 |
)
|
| 139 |
context_parts.append(f"Letzte Interaktionen:\n{history_text}")
|
| 140 |
+
print("\n\n".join(context_parts))
|
| 141 |
return "\n\n".join(context_parts)
|
| 142 |
|
| 143 |
async def chat(
|
|
|
|
| 231 |
) -> str:
|
| 232 |
"""Generate response using the language model"""
|
| 233 |
try:
|
| 234 |
+
print(prompt)
|
| 235 |
inputs = self.tokenizer(
|
| 236 |
prompt,
|
| 237 |
return_tensors="pt",
|