mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-09 08:08:32 +00:00
fix: fix trainig_data error (#820)
* fix: fix trainig_data error * fix: fix lack crew on agent * fix: fix lack crew on agent executor
This commit is contained in:
committed by
GitHub
parent
c005ec3f78
commit
da9cc5f097
@@ -250,7 +250,7 @@ class CrewAgentExecutor(AgentExecutor):
|
||||
if self.should_ask_for_human_input:
|
||||
human_feedback = self._ask_human_input(output.return_values["output"])
|
||||
|
||||
if self.crew._train:
|
||||
if self.crew and self.crew._train:
|
||||
self._handle_crew_training_output(output, human_feedback)
|
||||
|
||||
# Making sure we only ask for it once, so disabling for the next thought loop
|
||||
@@ -268,7 +268,7 @@ class CrewAgentExecutor(AgentExecutor):
|
||||
return
|
||||
|
||||
else:
|
||||
if self.crew._train:
|
||||
if self.crew and self.crew._train:
|
||||
self._handle_crew_training_output(output)
|
||||
|
||||
yield output
|
||||
@@ -323,9 +323,10 @@ class CrewAgentExecutor(AgentExecutor):
|
||||
agent_id = str(self.crew_agent.id)
|
||||
|
||||
if (
|
||||
training_data := CrewTrainingHandler(TRAINING_DATA_FILE).load()
|
||||
CrewTrainingHandler(TRAINING_DATA_FILE).load()
|
||||
and not self.should_ask_for_human_input
|
||||
):
|
||||
training_data = CrewTrainingHandler(TRAINING_DATA_FILE).load()
|
||||
if training_data.get(agent_id):
|
||||
training_data[agent_id][self.crew._train_iteration][
|
||||
"improved_output"
|
||||
|
||||
Reference in New Issue
Block a user