Spaces:
Sleeping
Sleeping
Update app/services/llm_engine.py
Browse files
app/services/llm_engine.py
CHANGED
|
@@ -179,17 +179,18 @@ class LLMEngine:
|
|
| 179 |
"is_correct": true
|
| 180 |
}}
|
| 181 |
"""
|
|
|
|
| 182 |
try:
|
|
|
|
| 183 |
response_content = await self._execute_with_retry(
|
| 184 |
-
messages=
|
| 185 |
-
model="llama-3.
|
| 186 |
-
|
| 187 |
)
|
|
|
|
| 188 |
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
print(f"ERROR Evaluate answer: {e}")
|
| 192 |
-
return {"score": 0, "feedback": "Error menilai.", "is_correct": False}
|
| 193 |
|
| 194 |
async def casual_chat(self, user_text: str, history: list = [], is_role_empty: bool = False):
|
| 195 |
|
|
|
|
| 179 |
"is_correct": true
|
| 180 |
}}
|
| 181 |
"""
|
| 182 |
+
#
|
| 183 |
try:
|
| 184 |
+
# Perhatikan: Kita panggil _execute_with_retry, bukan self.client.create
|
| 185 |
response_content = await self._execute_with_retry(
|
| 186 |
+
messages=messages,
|
| 187 |
+
model="llama-3.1-8b-instant", # Model ringan untuk chat
|
| 188 |
+
temperature=0.6
|
| 189 |
)
|
| 190 |
+
return response_content
|
| 191 |
|
| 192 |
+
except Exception as e:
|
| 193 |
+
return f"Maaf, error sistem: {str(e)}"
|
|
|
|
|
|
|
| 194 |
|
| 195 |
async def casual_chat(self, user_text: str, history: list = [], is_role_empty: bool = False):
|
| 196 |
|