Implement CrewAIBaseModel and Update to ConfigDict (#29)

New CrewAIBaseModel:

Base for Agent, Crew, Task.
Includes generated, frozen UUID.
Adds hashing capability
Migrate to ConfigDict:

Replaces class Config with model_config, see this deprecation note .
Benefits:
Adds auditing capability with frozen UUIDs.
This commit is contained in:
Greyson LaLonde
2023-12-30 19:52:04 -05:00
committed by GitHub
parent 469874d858
commit 1f0001b644
5 changed files with 35 additions and 12 deletions

View File

@@ -1,11 +1,12 @@
from typing import Any, List, Optional
from pydantic import BaseModel, Field, model_validator
from pydantic import Field, model_validator
from crewai.agent import Agent
from crewai.base.model import CrewAIBaseModel
class Task(BaseModel):
class Task(CrewAIBaseModel):
"""Class that represent a task to be executed."""
description: str = Field(description="Description of the actual task.")