fixed context

This commit is contained in:
Lorenze Jay
2024-07-11 07:38:49 -07:00
parent ce4e28fc79
commit 28929e1c5f
2 changed files with 2 additions and 15 deletions

View File

@@ -750,9 +750,8 @@ class Crew(BaseModel):
json_dict=stored_output["json_dict"],
output_format=stored_output["output_format"],
)
self.tasks[task_index].output = task_output
task_outputs = [task_output]
context = self._set_context(task, task_outputs)
else:
if task.agent and task.agent.allow_delegation:
agents_for_delegation = [
@@ -941,18 +940,6 @@ class Crew(BaseModel):
for agent in self.agents:
agent.interpolate_inputs(inputs)
def _format_output(
self, output: List[TaskOutput], token_usage: Optional[Dict[str, Any]]
) -> CrewOutput:
"""
Formats the output of the crew execution.
"""
return CrewOutput(
output=output,
tasks_output=[task.output for task in self.tasks if task and task.output],
token_usage=token_usage,
)
def _finish_execution(self, final_string_output: str) -> None:
if self.max_rpm:
self._rpm_controller.stop_rpm_counter()

View File

@@ -381,7 +381,7 @@ class Task(BaseModel):
def _convert_with_instructions(
self, result: str, model: Type[BaseModel]
) -> Union[dict, BaseModel, str]:
llm = self.agent.function_calling_llm or self.agent.llm
llm = self.agent.function_calling_llm or self.agent.llm # type: ignore # Item "None" of "BaseAgent | None" has no attribute "function_calling_llm"
instructions = self._get_conversion_instructions(model, llm)
converter = self._create_converter(