Spaces:
Configuration error
Configuration error
| #Agent1 translate raw logs into summaries | |
| import json | |
| import ollama | |
| def parse_log(raw_log): | |
| """Agent 1: Translates JSON into a summary.""" | |
| prompt = f""" | |
| You are a Senior Log Parser. Your job is to read this raw JSON log and output a ONE SENTENCE summary of the activity. | |
| Do not explain the JSON. Just state what happened, focusing on the IP, the user (if any), and the action. Give a two sentence description. | |
| Log Data: {json.dumps(raw_log)} | |
| """ | |
| response = ollama.chat(model='qwen2:7b', messages=[{'role': 'user', 'content': prompt}]) | |
| return response['message']['content'] |