plutoa386 commited on
Commit
83f2727
·
1 Parent(s): 76197f3

added debug to check the object type of the return news object

Browse files
Files changed (1) hide show
  1. crew.py +2 -1
crew.py CHANGED
@@ -721,6 +721,7 @@ def run_crewai_news_patient(count: int = 5) -> dict:
721
  )
722
  result = crew.kickoff(inputs={"count": count})
723
  # CrewAI returns ToolOutput → .raw or str — parse if needed
 
724
  if isinstance(result, dict):
725
  return result
726
  else:
@@ -728,7 +729,7 @@ def run_crewai_news_patient(count: int = 5) -> dict:
728
  import json
729
  return json.loads(str(result))
730
  except:
731
- return {"status": "error", "message": "Failed to parse crew output", "raw": str(result)}
732
 
733
  def run_crewai_news_doctor(count: int = 5) -> dict:
734
  crew = Crew(
 
721
  )
722
  result = crew.kickoff(inputs={"count": count})
723
  # CrewAI returns ToolOutput → .raw or str — parse if needed
724
+
725
  if isinstance(result, dict):
726
  return result
727
  else:
 
729
  import json
730
  return json.loads(str(result))
731
  except:
732
+ return {"status": "error", "message": "Failed to parse crew output", "raw": str(result), "resulttype": type(result)}
733
 
734
  def run_crewai_news_doctor(count: int = 5) -> dict:
735
  crew = Crew(