chore: renaming inject_trigger_input to allow_crewai_trigger_context (#3353)

* chore: renaming inject_trigger_input to allow_crewai_trigger_context

* test: add missing cassetes
This commit is contained in:
Lucas Gomide
2025-08-18 18:57:21 -03:00
committed by GitHub
parent a1b3edd79c
commit a4f65e4870
13 changed files with 1352 additions and 1939 deletions

View File

@@ -642,7 +642,7 @@ class Crew(FlowTrackable, BaseModel):
self._inputs = inputs
self._interpolate_inputs(inputs)
self._set_tasks_callbacks()
self._set_inject_trigger_input_for_first_task()
self._set_allow_crewai_trigger_context_for_first_task()
i18n = I18N(prompt_file=self.prompt_file)
@@ -1513,9 +1513,9 @@ class Crew(FlowTrackable, BaseModel):
for ks in knowledges:
ks.reset()
def _set_inject_trigger_input_for_first_task(self):
def _set_allow_crewai_trigger_context_for_first_task(self):
crewai_trigger_payload = self._inputs and self._inputs.get("crewai_trigger_payload")
able_to_inject = self.tasks and self.tasks[0].inject_trigger_input is None
able_to_inject = self.tasks and self.tasks[0].allow_crewai_trigger_context is None
if self.process == Process.sequential and crewai_trigger_payload and able_to_inject:
self.tasks[0].inject_trigger_input = True
self.tasks[0].allow_crewai_trigger_context = True

View File

@@ -72,7 +72,7 @@ class Task(BaseModel):
output_pydantic: Pydantic model for task output.
security_config: Security configuration including fingerprinting.
tools: List of tools/resources limited for task execution.
inject_trigger_input: Optional flag to control crewai_trigger_payload injection.
allow_crewai_trigger_context: Optional flag to control crewai_trigger_payload injection.
None (default): Auto-inject for first task only.
True: Always inject trigger payload for this task.
False: Never inject trigger payload, even for first task.
@@ -167,7 +167,7 @@ class Task(BaseModel):
end_time: Optional[datetime.datetime] = Field(
default=None, description="End time of the task execution"
)
inject_trigger_input: Optional[bool] = Field(
allow_crewai_trigger_context: Optional[bool] = Field(
default=None,
description="Whether this task should append 'Trigger Payload: {crewai_trigger_payload}' to the task description when crewai_trigger_payload exists in crew inputs.",
)
@@ -558,7 +558,7 @@ class Task(BaseModel):
"""
description = self.description
should_inject = self.inject_trigger_input
should_inject = self.allow_crewai_trigger_context
if should_inject and self.agent:
crew = getattr(self.agent, 'crew', None)