mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-09 08:08:32 +00:00
fixed context
This commit is contained in:
@@ -750,9 +750,8 @@ class Crew(BaseModel):
|
|||||||
json_dict=stored_output["json_dict"],
|
json_dict=stored_output["json_dict"],
|
||||||
output_format=stored_output["output_format"],
|
output_format=stored_output["output_format"],
|
||||||
)
|
)
|
||||||
|
self.tasks[task_index].output = task_output
|
||||||
task_outputs = [task_output]
|
task_outputs = [task_output]
|
||||||
context = self._set_context(task, task_outputs)
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
if task.agent and task.agent.allow_delegation:
|
if task.agent and task.agent.allow_delegation:
|
||||||
agents_for_delegation = [
|
agents_for_delegation = [
|
||||||
@@ -941,18 +940,6 @@ class Crew(BaseModel):
|
|||||||
for agent in self.agents:
|
for agent in self.agents:
|
||||||
agent.interpolate_inputs(inputs)
|
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:
|
def _finish_execution(self, final_string_output: str) -> None:
|
||||||
if self.max_rpm:
|
if self.max_rpm:
|
||||||
self._rpm_controller.stop_rpm_counter()
|
self._rpm_controller.stop_rpm_counter()
|
||||||
|
|||||||
@@ -381,7 +381,7 @@ class Task(BaseModel):
|
|||||||
def _convert_with_instructions(
|
def _convert_with_instructions(
|
||||||
self, result: str, model: Type[BaseModel]
|
self, result: str, model: Type[BaseModel]
|
||||||
) -> Union[dict, BaseModel, str]:
|
) -> 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)
|
instructions = self._get_conversion_instructions(model, llm)
|
||||||
|
|
||||||
converter = self._create_converter(
|
converter = self._create_converter(
|
||||||
|
|||||||
Reference in New Issue
Block a user