CrewAgent (crew/agent.py)

cognithor · src/cognithor/crew/agent.py · python · Apache-2.0
ai

Frozen Pydantic v2 model declaring an agent's role, goal, tools, LLM config, and runtime limits for crew orchestration.

# Source: https://github.com/Alex8791-cyber/cognithor | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
# Provided via justclaw.it.com; keep this notice with the code.
"""CrewAgent — declarative Pydantic model for a Crew participant."""

from __future__ import annotations

from typing import Any

from pydantic import BaseModel, ConfigDict, Field

# Forward-compat stub (Spec §1.2): the spec allows `llm: str | LLMConfig`. For
# v1.0 LLMConfig is an opaque dict — concrete schema (temperature, seed, …)
# lands in a later minor release. Using PEP 695 `type` keeps the public type
# stable so adding a real BaseModel later is a pure type-widening (non-breaking).
type LLMConfig = dict[str, Any]


class CrewAgent(BaseModel):
    """Declarative description 

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key