fjarsra commited on
Commit
652751d
·
verified ·
1 Parent(s): cd6915c

Update app/services/llm_engine.py

Browse files
Files changed (1) hide show
  1. app/services/llm_engine.py +8 -7
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=[{"role": "user", "content": prompt}],
185
- model="llama-3.3-70b-versatile",
186
- response_format={"type": "json_object"}
187
  )
 
188
 
189
- return json.loads(response_content)
190
- except:
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