Skip to content

API Reference parrot.handlers.crew.models

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.handlers.crew.models

View source

Data models for AgentCrew API.

Defines structures for crew definitions, job management, and execution tracking.

The core definition models (ExecutionMode, AgentDefinition, FlowRelation, CrewDefinition) now live in parrot.models.crew_definition and are re-exported here for backward compatibility.

Alias AgentDefinition

Re-exported from parrot.models.crew_definition.AgentDefinition.

Alias CrewDefinition

Re-exported from parrot.models.crew_definition.CrewDefinition.

Class CrewJob

Represents an asynchronous crew execution job.

Parameter Type Default Description
job_id str
crew_id str
query Union[str, Dict[str, str]]
status JobStatus JobStatus.PENDING
result Optional[Any] None
error Optional[str] None
created_at datetime datetime.utcnow()
started_at Optional[datetime] None
completed_at Optional[datetime] None
user_id Optional[str] None
session_id Optional[str] None
execution_mode Optional[str] None
metadata Dict[str, Any] dict()

Fields:

Field Type Default Description
job_id str
crew_id str
query Union[str, Dict[str, str]]
status JobStatus JobStatus.PENDING
result Optional[Any] None
error Optional[str] None
created_at datetime field(default_factory=datetime.utcnow)
started_at Optional[datetime] None
completed_at Optional[datetime] None
user_id Optional[str] None
session_id Optional[str] None
execution_mode Optional[str] None
metadata Dict[str, Any] field(default_factory=dict)

Attributes:

Attribute Type Description
elapsed_time Optional[float] Calculate elapsed time in seconds.

Method CrewJob.to_dict

Convert to dictionary.

to_dict() -> Dict[str, Any]

Returns: Dict[str, Any]

Class CrewJobResponse

Response when creating a new job.

Fields:

Field Type Default Description
job_id str Unique job identifier for tracking
crew_id str ID of the crew being executed
status JobStatus Current job status
message str Human-readable message
created_at str Job creation timestamp
execution_mode ExecutionMode Execution mode used for this job

Class CrewJobStatusResponse

Response for job status check.

Fields:

Field Type Default Description
job_id str Job identifier
crew_id str Crew identifier
status JobStatus Current job status
result Optional[Any] None Result if completed
error Optional[str] None Error message if failed
elapsed_time Optional[float] None Execution time in seconds
metadata Dict[str, Any] Additional execution metadata
execution_mode Optional[ExecutionMode] None Execution mode used for this job

Class CrewListResponse

Response for listing crews.

Fields:

Field Type Default Description
crews List[Dict[str, Any]] List of crew definitions
total int Total number of crews

Class CrewQueryRequest

Request to query a crew.

Fields:

Field Type Default Description
crew_id str ID of the crew to query
query Union[str, Dict[str, str]] Query for the crew (string for all agents, dict for specific agents)
execution_mode Optional[ExecutionMode] None Override the crew's default execution mode
user_id Optional[str] None User identifier
session_id Optional[str] None Session identifier
synthesis_prompt Optional[str] None Optional synthesis prompt for parallel research mode
kwargs Dict[str, Any] Additional arguments for execution

Class ExecutionDetail

Full execution record with payload, extending :class:ExecutionSummary.

Attributes:

Attribute Type Description
session_id Optional[str] Session identifier associated with the execution.
payload Dict[str, Any] Full execution result payload.

Class ExecutionFilter

Filters for listing saved executions.

Fields:

Field Type Default Description
crew_name Optional[str] None Restrict results to a single crew name.
method Optional[str] None Restrict results to a single execution method (e.g. "run_flow").
date_from Optional[datetime] None Only include executions at or after this timestamp.
date_to Optional[datetime] None Only include executions at or before this timestamp.

Alias ExecutionMode

Re-exported from parrot.models.crew_definition.ExecutionMode.

Class ExecutionSummary

Summary of a saved execution for list responses.

Fields:

Field Type Default Description
id str Unique identifier of the saved execution record.
crew_name str Name of the crew that produced this execution.
method str Execution method used (e.g. "run_sequential").
prompt Optional[str] None Original prompt/query, if captured.
user_id Optional[str] None Identifier of the user who triggered the execution.
tenant str 'global' Tenant the execution belongs to. Defaults to "global".
timestamp datetime When the execution was persisted.
status str 'success' Execution status. Defaults to "success".

Alias FlowRelation

Re-exported from parrot.models.crew_definition.FlowRelation.

Class JobStatus

Status of async job execution.

Class PaginatedResponse

Paginated list response.

Fields:

Field Type Default Description
items List[ExecutionSummary] Page of execution summaries.
total int Total number of matching records (ignoring pagination).
limit int Page size used for this response.
offset int Number of records skipped before this page.

Class ReplayRequest

Request body for replaying a saved execution.

Currently empty — reserved as a future extension point (e.g. prompt overrides).

Class ScheduleRequest

Request body for scheduling a saved execution.

Fields:

Field Type Default Description
schedule_type str One of ONCE, DAILY, WEEKLY, MONTHLY, INTERVAL, CRON, CRONTAB.
schedule_config Dict[str, Any] Schedule configuration payload for the given type.
created_by Optional[int] None Identifier of the user creating the schedule.
created_email Optional[str] None Email of the user creating the schedule.
metadata Optional[Dict[str, Any]] None Additional metadata to store with the schedule.
callbacks Optional[List[Dict[str, Any]]] None Optional list of callback configurations.

Alias ToolNodeDefinition

Re-exported from parrot.models.crew_definition.ToolNodeDefinition.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally