diff --git a/blockagi/chains/evaluate.py b/blockagi/chains/evaluate.py index de6bbe7..1358573 100644 --- a/blockagi/chains/evaluate.py +++ b/blockagi/chains/evaluate.py @@ -95,7 +95,7 @@ def _call(self, inputs: Dict[str, Any]) -> Dict[str, Any]: response = self.retry_llm(messages) - result = json.loads(response.content) + result = json.loads(response.content.strip("```json")) updated_findings = Findings( generated_objectives=[ diff --git a/blockagi/chains/narrate.py b/blockagi/chains/narrate.py index c9333e3..7d05aa3 100644 --- a/blockagi/chains/narrate.py +++ b/blockagi/chains/narrate.py @@ -148,4 +148,4 @@ def _call_chunk(self, inputs: Dict[str, Any]) -> Dict[str, Any]: response = self.retry_llm(messages) - return response.content + return response.content.strip("```json") diff --git a/blockagi/chains/plan.py b/blockagi/chains/plan.py index 3ee74b7..c6ba48c 100644 --- a/blockagi/chains/plan.py +++ b/blockagi/chains/plan.py @@ -100,7 +100,7 @@ def _call(self, inputs: Dict[str, Any]) -> Dict[str, Any]: args=task["args"], reasoning=task["reasoning"], ) - for task in json.loads(response.content) + for task in json.loads(response.content.strip("```json")) ] return {"research_tasks": research_tasks}