fix : possible crash with planner agent if wrong format returned by llm

This commit is contained in:
martin legrand 2025-03-30 17:38:22 +02:00
parent 8ccb6f4d77
commit b34e343535
3 changed files with 2 additions and 2 deletions

View File

@ -74,6 +74,8 @@ class PlannerAgent(Agent):
def show_plan(self, json_plan):
agents_tasks = self.parse_agent_tasks(json_plan)
if agents_tasks == (None, None):
return
pretty_print(f"--- Plan ---", color="output")
for task_name, task in agents_tasks:
pretty_print(f"{task}", color="output")

View File

@ -155,7 +155,6 @@ class Browser:
for element in soup(['script', 'style']):
element.decompose()
text = soup.get_text()
lines = (line.strip() for line in text.splitlines())
chunks = (phrase.strip() for line in lines for phrase in line.split(" "))

View File

@ -2,7 +2,6 @@ import os
import sys
import torch
from transformers import pipeline
# adaptive-classifier==0.0.10
from adaptive_classifier import AdaptiveClassifier
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))