fix bug LLM
Browse files- app/llm.py +2 -0
- app/main.py +1 -0
app/llm.py
CHANGED
|
@@ -455,6 +455,8 @@ class LLMClient:
|
|
| 455 |
|
| 456 |
response = await self.generate_text(prompt, **kwargs)
|
| 457 |
|
|
|
|
|
|
|
| 458 |
try:
|
| 459 |
import re
|
| 460 |
json_match = re.search(r'\[.*\]', response, re.DOTALL)
|
|
|
|
| 455 |
|
| 456 |
response = await self.generate_text(prompt, **kwargs)
|
| 457 |
|
| 458 |
+
logger.info(f"[LLM][RAW] Kết quả trả về từ generate_text: {response}")
|
| 459 |
+
|
| 460 |
try:
|
| 461 |
import re
|
| 462 |
json_match = re.search(r'\[.*\]', response, re.DOTALL)
|
app/main.py
CHANGED
|
@@ -195,6 +195,7 @@ async def process_message(message_data: Dict[str, Any]):
|
|
| 195 |
command, remaining_text = extract_command(message_text)
|
| 196 |
# Sử dụng LLM để phân tích message_text và extract keywords, mục đích, hành vi vi phạm
|
| 197 |
llm_analysis = await llm_client.analyze(message_text)
|
|
|
|
| 198 |
muc_dich = None
|
| 199 |
hanh_vi_vi_pham = None
|
| 200 |
if isinstance(llm_analysis, dict):
|
|
|
|
| 195 |
command, remaining_text = extract_command(message_text)
|
| 196 |
# Sử dụng LLM để phân tích message_text và extract keywords, mục đích, hành vi vi phạm
|
| 197 |
llm_analysis = await llm_client.analyze(message_text)
|
| 198 |
+
logger.info(f"[LLM][RAW] Kết quả trả về từ analyze: {llm_analysis}")
|
| 199 |
muc_dich = None
|
| 200 |
hanh_vi_vi_pham = None
|
| 201 |
if isinstance(llm_analysis, dict):
|