Agent working

This commit is contained in:
Cyber MacGeddon 2025-07-20 16:14:52 +01:00
parent fca082879a
commit ac383d4452
2 changed files with 13 additions and 6 deletions

View file

@ -80,11 +80,12 @@ class AgentManager:
i += 1
# Try to parse as JSON
try:
final_answer = json.loads(json_text)
except json.JSONDecodeError:
# Not valid JSON, treat as regular text
final_answer = json_text
# try:
# final_answer = json.loads(json_text)
# except json.JSONDecodeError:
# # Not valid JSON, treat as regular text
# final_answer = json_text
final_answer = json_text
else:
# Regular text answer
while i < len(lines):
@ -263,6 +264,9 @@ class AgentManager:
if isinstance(resp, str):
resp = resp.strip()
else:
resp = str(resp)
resp = resp.strip()
logger.info(f"resp: {resp}")

View file

@ -6,6 +6,10 @@ import json
import re
import sys
import functools
import logging
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)
from ... base import AgentService, TextCompletionClientSpec, PromptClientSpec
from ... base import GraphRagClientSpec, ToolClientSpec
@ -297,6 +301,5 @@ class Processor(AgentService):
)
def run():
Processor.launch(default_ident, __doc__)