Skip to content

Commit

Permalink
fix: error handle about crewai
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu007 committed Aug 18, 2024
1 parent 53a2069 commit 9e2a4da
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/codeinterpreterapi/callbacks/markdown/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ def on_llm_start(self, serialized: Dict[str, Any], prompts: List[str], **kwargs:

def on_llm_end(self, response: LLMResult, **kwargs: Any) -> None:
self._write_header("LLM End")
self._write_to_file(response.llm_output)
if response.llm_output:
self._write_to_file(response.llm_output)
for generation in response.generations[0]:
self._write_to_file(f"```\n{generation.text}\n```\n\n")
self._write_to_file("---\n\n")
Expand Down
4 changes: 3 additions & 1 deletion src/codeinterpreterapi/crew/crew_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,10 @@ def run(self, inputs: Dict, plan_list: CodeInterpreterPlanList):
if plan_list is None:
return {}
tasks = self.create_tasks(final_goal=inputs["input"], plan_list=plan_list)
crew_inputs = {"input": inputs.get("input", "")}
my_crew = Crew(agents=self.agents, tasks=tasks)
result = my_crew.kickoff(inputs=inputs)
print("CodeInterpreterCrew.kickoff() crew_inputs=", crew_inputs)
result = my_crew.kickoff(inputs=crew_inputs)
return result


Expand Down

0 comments on commit 9e2a4da

Please sign in to comment.