Skip to content

features ¤

MODULE DESCRIPTION
agent

A collaborator specialized as an agent with an LLM model and tools.

brain

Handle the connection with the LLM model.

collaborator

Abstract class provides state management, graph setup, and async invocation/streaming

crew

Handle the communication of a team of agents to the world

duty

Duties that performs a collaborator

helpers

Utilities for the library

http_driver

Driver to create an api rest endpoint

muscle

Handle the actions defined by the brain

performance
runnables
skill
stream_conversor
team
CLASS DESCRIPTION
AgentBase

Base class for implementing agents in the crewmaster architecture.

DistributionStrategyInterface
RandomStrategy
SupervisionStrategy
TeamBase
AgentMessage
ClarificationRequested
CollaboratorBase

Abstract base class for all collaborator components.

CollaboratorConfig
CollaboratorInputClarification
CollaboratorInputFresh
CollaboratorOutputClarification
CollaboratorOutputContribution
CollaboratorOutputResponse
CollaboratorOutputResponseStructured
CollaboratorState
BrainSchemaBase
ClarificationSchemaBase
ComputationRequested
ComputationResult
ResultSchemaBase
SkillComputationDirect
SkillComputationWithClarification
SkillContribute
SkillInputSchemaBase
SkillStructuredResponse
CrewBase

Base class for managing a Crew with asynchronous invocation and streaming.

CrewConfig
CrewState
CrewInputFresh
CrewInputClarification
JsonSerializarFromCustomModels

A JSON serializer for custom Crewmaster models.

UserMessage
CrewDependencies
CrewRouterBase
HttpEventFilter

Define the type, time and format of the messages in the stream.

HttpInputFresh

New input originated by a user message.

HttpMetadata
PublicAccessStrategy
UserLogged
ATTRIBUTE DESCRIPTION
CollaboratorInput

CollaboratorOutput

FreshMessage

PublicMessage

BrainSchema

Skill

Union discriminada para Skill

SkillComputation

CrewInput

CrewOutput

CollaboratorInput module-attribute ¤

FreshMessage module-attribute ¤

PublicMessage module-attribute ¤

PublicMessage = Union[UserMessage, AgentMessage]

BrainSchema module-attribute ¤

BrainSchema = TypeVar('BrainSchema', bound=BrainSchemaBase)

Skill module-attribute ¤

Union discriminada para Skill

CrewInput module-attribute ¤

CrewOutput module-attribute ¤

CrewOutput = CollaboratorOutput

__all__ module-attribute ¤

__all__ = ['_build_config_for_runnable', 'AgentBase', 'AgentMessage', 'BrainSchema', 'BrainSchemaBase', 'ClarificationRequested', 'ClarificationSchemaBase', 'CollaboratorBase', 'CollaboratorConfig', 'CollaboratorInput', 'CollaboratorInputClarification', 'CollaboratorInputFresh', 'CollaboratorOutput', 'CollaboratorOutputClarification', 'CollaboratorOutputContribution', 'CollaboratorOutputResponse', 'CollaboratorOutputResponseStructured', 'CollaboratorState', 'ComputationRequested', 'ComputationResult', 'CrewBase', 'CrewConfig', 'CrewDependencies', 'CrewInput', 'CrewInputClarification', 'CrewInputFresh', 'CrewOutput', 'CrewRouterBase', 'CrewState', 'DistributionStrategyInterface', 'FreshMessage', 'HttpEventFilter', 'HttpInputFresh', 'HttpMetadata', 'JsonSerializarFromCustomModels', 'PublicAccessStrategy', 'PublicMessage', 'RandomStrategy', 'ResultSchemaBase', 'ResultSchemaBase', 'RunnableConfig', 'Skill', 'SkillComputation', 'SkillComputationDirect', 'SkillComputationWithClarification', 'SkillContribute', 'SkillInputSchemaBase', 'SkillStructuredResponse', 'stream_conversor', 'SupervisionStrategy', 'TeamBase', 'UserLogged', 'UserMessage']

AgentBase ¤

AgentBase(**data)

Base class for implementing agents in the crewmaster architecture.

This class orchestrates the collaboration between the "brain" and "muscle" components through a state-driven workflow. It sets up the execution graph, defines dependencies, and provides mechanisms for building instructions and handling team membership.

METHOD DESCRIPTION
astream_config_parsed

Asynchronously streams the output of the collaborator.

astream
async_invoke_config_parsed

Asynchronously invokes the collaborator with a parsed configuration.

ainvoke
invoke

Invokes the collaborator.

join_team

Assign the agent to a team and update instructions.

ATTRIBUTE DESCRIPTION
name

TYPE: str

job_description

TYPE: str

agent_name_intro

TYPE: str

public_bio

TYPE: Optional[str]

private_bio

TYPE: Optional[str]

directives

TYPE: Optional[str]

examples

TYPE: Optional[str]

team_membership

TYPE: Optional[TeamMembership]

options

TYPE: List[Skill]

options_built_in

TYPE: List[Skill]

history_strategy

TYPE: HistoryStrategyInterface

situation_builder

TYPE: Optional[SituationBuilderFn]

instructions_transformer

TYPE: Optional[InstructionsTransformerFn]

config_specs

Get the merged configuration specifications for the agent.

TYPE: List[ConfigurableFieldSpec]

name class-attribute instance-attribute ¤

name: str = 'agent'

job_description instance-attribute ¤

job_description: str

agent_name_intro class-attribute instance-attribute ¤

agent_name_intro: str = 'Your name is '

public_bio class-attribute instance-attribute ¤

public_bio: Optional[str] = None

private_bio class-attribute instance-attribute ¤

private_bio: Optional[str] = None

directives class-attribute instance-attribute ¤

directives: Optional[str] = None

examples class-attribute instance-attribute ¤

examples: Optional[str] = None

team_membership class-attribute instance-attribute ¤

team_membership: Optional[TeamMembership] = None

options class-attribute instance-attribute ¤

options: List[Skill] = []

options_built_in class-attribute instance-attribute ¤

options_built_in: List[Skill] = []

history_strategy class-attribute instance-attribute ¤

situation_builder class-attribute instance-attribute ¤

situation_builder: Optional[SituationBuilderFn] = None

instructions_transformer class-attribute instance-attribute ¤

instructions_transformer: Optional[InstructionsTransformerFn] = None

config_specs property ¤

config_specs: List[ConfigurableFieldSpec]

Get the merged configuration specifications for the agent.

RETURNS DESCRIPTION
List[ConfigurableFieldSpec]

List of configuration field specs.

astream_config_parsed async ¤

astream_config_parsed(input: CollaboratorInput, config_parsed: BaseModel, config_raw: RunnableConfig, run_manager: CallbackManagerForChainRun, **kwargs: Optional[Any]) -> AsyncIterator[Dict[str, Any]]

Asynchronously streams the output of the collaborator.

PARAMETER DESCRIPTION

input ¤

The input data for the collaborator.

TYPE: CollaboratorInput

config_parsed ¤

The parsed configuration.

TYPE: BaseModel

config_raw ¤

The raw runnable configuration.

TYPE: RunnableConfig

run_manager ¤

The run manager.

TYPE: CallbackManagerForChainRun

**kwargs ¤

Optional keyword arguments.

TYPE: Optional[Any] DEFAULT: {}

YIELDS DESCRIPTION
dict

The chunks of the output.

astream async ¤

astream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) -> AsyncIterator[Output]

async_invoke_config_parsed async ¤

async_invoke_config_parsed(input: CollaboratorInput, config_parsed: BaseModel, config_raw: RunnableConfig) -> CollaboratorOutput

Asynchronously invokes the collaborator with a parsed configuration.

PARAMETER DESCRIPTION

input ¤

The input data for the collaborator.

TYPE: CollaboratorInput

config_parsed ¤

The parsed configuration.

TYPE: BaseModel

config_raw ¤

The raw runnable configuration.

TYPE: RunnableConfig

RETURNS DESCRIPTION
CollaboratorOutput

The output of the collaborator.

TYPE: CollaboratorOutput

ainvoke async ¤

ainvoke(input: Input, config: Optional[RunnableConfig] = None) -> Output

invoke ¤

invoke(input: CollaboratorInput, config: RunnableConfig | None = None) -> CollaboratorOutput

Invokes the collaborator.

RAISES DESCRIPTION
Exception

Collaborator can only be called asynchronously.

join_team ¤

Assign the agent to a team and update instructions.

PARAMETER DESCRIPTION

team_membership ¤

The team membership object.

TYPE: TeamMembership

DistributionStrategyInterface ¤

METHOD DESCRIPTION
execute

execute abstractmethod ¤

execute() -> AgentBase

RandomStrategy ¤

METHOD DESCRIPTION
execute
ATTRIBUTE DESCRIPTION
members

TYPE: List[AgentBase]

members instance-attribute ¤

members: List[AgentBase]

execute ¤

execute() -> AgentBase

SupervisionStrategy ¤

METHOD DESCRIPTION
execute
ATTRIBUTE DESCRIPTION
supervisor

TYPE: AgentBase

supervisor instance-attribute ¤

supervisor: AgentBase

execute ¤

execute() -> AgentBase

TeamBase ¤

TeamBase(**data)
METHOD DESCRIPTION
astream_config_parsed

Asynchronously streams the output of the collaborator.

astream
async_invoke_config_parsed

Asynchronously invokes the collaborator with a parsed configuration.

ainvoke
invoke

Invokes the collaborator.

join_team
get_member_by_name
ATTRIBUTE DESCRIPTION
name

TYPE: str

job_description

TYPE: str

team_instructions

TYPE: str

distribution_strategy

TYPE: DistributionStrategyInterface

members

TYPE: List[AgentBase]

options_built_in

TYPE: List[Skill]

config_specs

TYPE: List[ConfigurableFieldSpec]

name class-attribute instance-attribute ¤

name: str = 'Team'

job_description instance-attribute ¤

job_description: str

team_instructions class-attribute instance-attribute ¤

team_instructions: str = 'You are part of a team of colleagues.Please use tool if you need to send a message to anyone.\n\nMembers:\n'

distribution_strategy instance-attribute ¤

distribution_strategy: DistributionStrategyInterface

members instance-attribute ¤

members: List[AgentBase]

options_built_in class-attribute instance-attribute ¤

options_built_in: List[Skill] = []

config_specs property ¤

config_specs: List[ConfigurableFieldSpec]

astream_config_parsed async ¤

astream_config_parsed(input: CollaboratorInput, config_parsed: BaseModel, config_raw: RunnableConfig, run_manager: CallbackManagerForChainRun, **kwargs: Optional[Any]) -> AsyncIterator[Dict[str, Any]]

Asynchronously streams the output of the collaborator.

PARAMETER DESCRIPTION

input ¤

The input data for the collaborator.

TYPE: CollaboratorInput

config_parsed ¤

The parsed configuration.

TYPE: BaseModel

config_raw ¤

The raw runnable configuration.

TYPE: RunnableConfig

run_manager ¤

The run manager.

TYPE: CallbackManagerForChainRun

**kwargs ¤

Optional keyword arguments.

TYPE: Optional[Any] DEFAULT: {}

YIELDS DESCRIPTION
dict

The chunks of the output.

astream async ¤

astream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) -> AsyncIterator[Output]

async_invoke_config_parsed async ¤

async_invoke_config_parsed(input: CollaboratorInput, config_parsed: BaseModel, config_raw: RunnableConfig) -> CollaboratorOutput

Asynchronously invokes the collaborator with a parsed configuration.

PARAMETER DESCRIPTION

input ¤

The input data for the collaborator.

TYPE: CollaboratorInput

config_parsed ¤

The parsed configuration.

TYPE: BaseModel

config_raw ¤

The raw runnable configuration.

TYPE: RunnableConfig

RETURNS DESCRIPTION
CollaboratorOutput

The output of the collaborator.

TYPE: CollaboratorOutput

ainvoke async ¤

ainvoke(input: Input, config: Optional[RunnableConfig] = None) -> Output

invoke ¤

invoke(input: CollaboratorInput, config: RunnableConfig | None = None) -> CollaboratorOutput

Invokes the collaborator.

RAISES DESCRIPTION
Exception

Collaborator can only be called asynchronously.

join_team ¤

join_team(team_membership: TeamMembership)

get_member_by_name ¤

get_member_by_name(agent_name: str) -> AgentBase

AgentMessage ¤

METHOD DESCRIPTION
is_lc_serializable
get_lc_namespace
ATTRIBUTE DESCRIPTION
author

TYPE: str

to

TYPE: str

id

TYPE: str

timestamp

TYPE: str

lc_attributes

TYPE: Dict

author instance-attribute ¤

author: str

to instance-attribute ¤

to: str

id class-attribute instance-attribute ¤

id: str = Field(default_factory=lambda: str(uuid4()))

timestamp class-attribute instance-attribute ¤

timestamp: str = Field(default_factory=isoformat)

lc_attributes property ¤

lc_attributes: Dict

is_lc_serializable classmethod ¤

is_lc_serializable() -> bool

get_lc_namespace classmethod ¤

get_lc_namespace() -> List[str]

ClarificationRequested ¤

METHOD DESCRIPTION
is_lc_serializable
get_lc_namespace
ATTRIBUTE DESCRIPTION
name

TYPE: str

clarification_id

TYPE: str

brain_args

TYPE: Dict[str, Any]

lc_attributes

TYPE: Dict

name instance-attribute ¤

name: str

clarification_id instance-attribute ¤

clarification_id: str

brain_args instance-attribute ¤

brain_args: Dict[str, Any]

lc_attributes property ¤

lc_attributes: Dict

is_lc_serializable classmethod ¤

is_lc_serializable() -> bool

get_lc_namespace classmethod ¤

get_lc_namespace() -> List[str]

CollaboratorBase ¤

Abstract base class for all collaborator components.

This class provides a foundational structure for any collaborator in the Crewmaster system. Collaborators are runnable units that can be part of a team and handle specific jobs.

ATTRIBUTE DESCRIPTION
job_description

A description of the collaborator's responsibility.

TYPE: str

METHOD DESCRIPTION
astream
ainvoke
join_team

Abstract method to make the collaborator join a team.

invoke

Invokes the collaborator.

async_invoke_config_parsed

Asynchronously invokes the collaborator with a parsed configuration.

astream_config_parsed

Asynchronously streams the output of the collaborator.

job_description instance-attribute ¤

job_description: str

Responsabilidad del colaborador

config_specs property ¤

config_specs: List[ConfigurableFieldSpec]

Required fields in the configuration for this runnable.

RETURNS DESCRIPTION
list

A list of ConfigurableFieldSpec objects.

astream async ¤

astream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) -> AsyncIterator[Output]

ainvoke async ¤

ainvoke(input: Input, config: Optional[RunnableConfig] = None) -> Output

join_team abstractmethod ¤

Abstract method to make the collaborator join a team.

PARAMETER DESCRIPTION

team_membership ¤

The team membership details to join.

TYPE: TeamMembership

invoke ¤

invoke(input: CollaboratorInput, config: RunnableConfig | None = None) -> CollaboratorOutput

Invokes the collaborator.

RAISES DESCRIPTION
Exception

Collaborator can only be called asynchronously.

async_invoke_config_parsed async ¤

async_invoke_config_parsed(input: CollaboratorInput, config_parsed: BaseModel, config_raw: RunnableConfig) -> CollaboratorOutput

Asynchronously invokes the collaborator with a parsed configuration.

PARAMETER DESCRIPTION

input ¤

The input data for the collaborator.

TYPE: CollaboratorInput

config_parsed ¤

The parsed configuration.

TYPE: BaseModel

config_raw ¤

The raw runnable configuration.

TYPE: RunnableConfig

RETURNS DESCRIPTION
CollaboratorOutput

The output of the collaborator.

TYPE: CollaboratorOutput

astream_config_parsed async ¤

astream_config_parsed(input: CollaboratorInput, config_parsed: BaseModel, config_raw: RunnableConfig, run_manager: CallbackManagerForChainRun, **kwargs: Optional[Any]) -> AsyncIterator[Dict[str, Any]]

Asynchronously streams the output of the collaborator.

PARAMETER DESCRIPTION

input ¤

The input data for the collaborator.

TYPE: CollaboratorInput

config_parsed ¤

The parsed configuration.

TYPE: BaseModel

config_raw ¤

The raw runnable configuration.

TYPE: RunnableConfig

run_manager ¤

The run manager.

TYPE: CallbackManagerForChainRun

**kwargs ¤

Optional keyword arguments.

TYPE: Optional[Any] DEFAULT: {}

YIELDS DESCRIPTION
dict

The chunks of the output.

CollaboratorConfig ¤

ATTRIBUTE DESCRIPTION
llm_srv

TYPE: BaseChatModel

use_cases_srv

TYPE: Any

user_name

TYPE: str

today

TYPE: str

llm_srv instance-attribute ¤

llm_srv: BaseChatModel

use_cases_srv instance-attribute ¤

use_cases_srv: Any

user_name class-attribute instance-attribute ¤

user_name: str = Field(...)

today instance-attribute ¤

today: str

CollaboratorInputClarification ¤

ATTRIBUTE DESCRIPTION
public_messages

TYPE: List[PublicMessage]

private_messages

TYPE: List[AgentMessage]

type

TYPE: Literal['input.clarification']

clarification_message

TYPE: ClarificationMessage

public_messages class-attribute instance-attribute ¤

public_messages: List[PublicMessage] = []

private_messages class-attribute instance-attribute ¤

private_messages: List[AgentMessage] = []

type class-attribute instance-attribute ¤

type: Literal['input.clarification'] = 'input.clarification'

clarification_message instance-attribute ¤

clarification_message: ClarificationMessage

CollaboratorInputFresh ¤

ATTRIBUTE DESCRIPTION
public_messages

TYPE: List[PublicMessage]

private_messages

TYPE: List[AgentMessage]

type

TYPE: Literal['input.fresh']

message

TYPE: UserMessage

public_messages class-attribute instance-attribute ¤

public_messages: List[PublicMessage] = []

private_messages class-attribute instance-attribute ¤

private_messages: List[AgentMessage] = []

type class-attribute instance-attribute ¤

type: Literal['input.fresh'] = 'input.fresh'

message instance-attribute ¤

message: UserMessage

CollaboratorOutputClarification ¤

ATTRIBUTE DESCRIPTION
type

TYPE: Literal['output.clarification']

clarification_context

TYPE: ClarificationContext

clarification_requested

TYPE: ClarificationRequested

type class-attribute instance-attribute ¤

type: Literal['output.clarification'] = 'output.clarification'

clarification_context instance-attribute ¤

clarification_context: ClarificationContext

clarification_requested instance-attribute ¤

clarification_requested: ClarificationRequested

CollaboratorOutputContribution ¤

ATTRIBUTE DESCRIPTION
type

TYPE: Literal['output.contribution']

contribution

TYPE: AgentMessage

type class-attribute instance-attribute ¤

type: Literal['output.contribution'] = 'output.contribution'

contribution instance-attribute ¤

contribution: AgentMessage

CollaboratorOutputResponse ¤

ATTRIBUTE DESCRIPTION
type

TYPE: Literal['output.response']

message

TYPE: AgentMessage

type class-attribute instance-attribute ¤

type: Literal['output.response'] = 'output.response'

message instance-attribute ¤

message: AgentMessage

CollaboratorOutputResponseStructured ¤

ATTRIBUTE DESCRIPTION
type

TYPE: Literal['output.response_structured']

payload

TYPE: Dict[str, Any]

structure

TYPE: str

message

TYPE: AgentMessage

type class-attribute instance-attribute ¤

type: Literal['output.response_structured'] = 'output.response_structured'

payload instance-attribute ¤

payload: Dict[str, Any]

structure instance-attribute ¤

structure: str

message instance-attribute ¤

message: AgentMessage

CollaboratorState ¤

ATTRIBUTE DESCRIPTION
public_messages

TYPE: List[PublicMessage]

private_messages

TYPE: List[AgentMessage]

fresh_message

TYPE: FreshMessage

output

TYPE: Optional[CollaboratorOutput]

computations_requested

TYPE: List[ComputationRequested]

computations_results

TYPE: List[ComputationResult]

next_step

TYPE: str

public_messages class-attribute instance-attribute ¤

public_messages: List[PublicMessage] = []

private_messages class-attribute instance-attribute ¤

private_messages: List[AgentMessage] = []

fresh_message instance-attribute ¤

fresh_message: FreshMessage

output class-attribute instance-attribute ¤

output: Optional[CollaboratorOutput] = None

computations_requested class-attribute instance-attribute ¤

computations_requested: List[ComputationRequested] = []

computations_results class-attribute instance-attribute ¤

computations_results: List[ComputationResult] = []

next_step class-attribute instance-attribute ¤

next_step: str = ''

BrainSchemaBase ¤

ATTRIBUTE DESCRIPTION
registry_id

TYPE: str

registry_id cached property ¤

registry_id: str

ClarificationSchemaBase ¤

ComputationRequested ¤

METHOD DESCRIPTION
is_lc_serializable
get_lc_namespace
lc_id

A unique identifier for this class for serialization purposes.

ATTRIBUTE DESCRIPTION
name

TYPE: str

brain_args

TYPE: Dict[str, Any]

computation_id

TYPE: str

lc_attributes

TYPE: Dict

name instance-attribute ¤

name: str

brain_args instance-attribute ¤

brain_args: Dict[str, Any]

computation_id instance-attribute ¤

computation_id: str

lc_attributes property ¤

lc_attributes: Dict

is_lc_serializable classmethod ¤

is_lc_serializable() -> bool

get_lc_namespace classmethod ¤

get_lc_namespace() -> List[str]

lc_id classmethod ¤

lc_id() -> list[str]

A unique identifier for this class for serialization purposes.

The unique identifier is a list of strings that describes the path to the object. For example, for the class langchain.llms.openai.OpenAI, the id is ["langchain", "llms", "openai", "OpenAI"].

ComputationResult ¤

METHOD DESCRIPTION
is_lc_serializable
get_lc_namespace
ATTRIBUTE DESCRIPTION
computation_id

TYPE: str

name

TYPE: str

skill_args

TYPE: SkillInputSchema

result

TYPE: ResultSchema

lc_attributes

TYPE: Dict

computation_id instance-attribute ¤

computation_id: str

name instance-attribute ¤

name: str

skill_args instance-attribute ¤

skill_args: SkillInputSchema

result instance-attribute ¤

result: ResultSchema

lc_attributes property ¤

lc_attributes: Dict

is_lc_serializable classmethod ¤

is_lc_serializable() -> bool

get_lc_namespace classmethod ¤

get_lc_namespace() -> List[str]

ResultSchemaBase ¤

SkillComputationDirect ¤

METHOD DESCRIPTION
ainvoke
as_tool
invoke
get_output_schema
get_input_schema
async_executor

Ejecución del computo del skill

async_invoke_config_parsed
ATTRIBUTE DESCRIPTION
name

TYPE: str

description

TYPE: str

brain_schema

TYPE: Type[BrainSchema]

type

TYPE: Literal['skill.computation']

require_clarification

TYPE: bool

result_schema

TYPE: Type[ResultSchema]

sub_type

TYPE: Literal['direct']

name instance-attribute ¤

name: str

description instance-attribute ¤

description: str

brain_schema instance-attribute ¤

brain_schema: Type[BrainSchema]

type class-attribute instance-attribute ¤

type: Literal['skill.computation'] = 'skill.computation'

require_clarification class-attribute instance-attribute ¤

require_clarification: bool = False

result_schema instance-attribute ¤

result_schema: Type[ResultSchema]

sub_type class-attribute instance-attribute ¤

sub_type: Literal['direct'] = 'direct'

ainvoke async ¤

ainvoke(input: Input, config: Optional[RunnableConfig] = None) -> Output

as_tool ¤

as_tool() -> Dict[str, Any]

invoke ¤

invoke(input: ComputationRequested, config: RunnableConfig | None = None) -> ComputationResult[BrainSchema, ResultSchema]

get_output_schema ¤

get_output_schema(config: Optional[RunnableConfig] = None) -> Type[ResultSchema]

get_input_schema ¤

get_input_schema(config: Optional[RunnableConfig] = None) -> Type[BrainSchema]

async_executor abstractmethod async ¤

async_executor(skill_args: BrainSchema, config: BaseModel) -> ResultSchema

Ejecución del computo del skill

Encargado de procesar los datos de entrada y generar el resultado.

RETURNS DESCRIPTION
ResultSchema

resultado de ejecutar el computo

TYPE: ResultSchema

async_invoke_config_parsed async ¤

async_invoke_config_parsed(input: ComputationRequested, config_parsed: BaseModel, config_raw: RunnableConfig) -> ComputationResult[BrainSchema, ResultSchema]

SkillComputationWithClarification ¤

METHOD DESCRIPTION
ainvoke
as_tool
invoke
get_output_schema
get_input_schema
merge_brain_with_clarification
async_executor

Ejecución del computo del skill

get_clarification_schema
async_invoke_config_parsed
ATTRIBUTE DESCRIPTION
name

TYPE: str

description

TYPE: str

brain_schema

TYPE: Type[BrainSchema]

type

TYPE: Literal['skill.computation']

require_clarification

TYPE: bool

result_schema

TYPE: Type[ResultSchema]

sub_type

TYPE: Literal['with-clarification']

clarification_schema

TYPE: Type[ClarificationSchema]

skill_input_schema

TYPE: Type[SkillInputSchema]

name instance-attribute ¤

name: str

description instance-attribute ¤

description: str

brain_schema instance-attribute ¤

brain_schema: Type[BrainSchema]

type class-attribute instance-attribute ¤

type: Literal['skill.computation'] = 'skill.computation'

require_clarification class-attribute instance-attribute ¤

require_clarification: bool = False

result_schema instance-attribute ¤

result_schema: Type[ResultSchema]

sub_type class-attribute instance-attribute ¤

sub_type: Literal['with-clarification'] = 'with-clarification'

clarification_schema instance-attribute ¤

clarification_schema: Type[ClarificationSchema]

skill_input_schema instance-attribute ¤

skill_input_schema: Type[SkillInputSchema]

ainvoke async ¤

ainvoke(input: Input, config: Optional[RunnableConfig] = None) -> Output

as_tool ¤

as_tool() -> Dict[str, Any]

invoke ¤

invoke(input: ComputationRequested, config: RunnableConfig | None = None) -> ComputationResult[BrainSchema, ResultSchema]

get_output_schema ¤

get_output_schema(config: Optional[RunnableConfig] = None) -> Type[ResultSchema]

get_input_schema ¤

get_input_schema(config: Optional[RunnableConfig] = None) -> Type[BrainSchema]

merge_brain_with_clarification abstractmethod ¤

merge_brain_with_clarification(brain_input: BrainSchema, clarification_input: ClarificationSchema) -> SkillInputSchema

async_executor abstractmethod async ¤

async_executor(skill_args: SkillInputSchema, config: BaseModel) -> ResultSchema

Ejecución del computo del skill

Encargado de procesar los datos de entrada y generar el resultado.

RETURNS DESCRIPTION
ResultSchema

resultado de ejecutar el computo

TYPE: ResultSchema

get_clarification_schema ¤

get_clarification_schema(config: Optional[RunnableConfig] = None) -> Type[ClarificationSchema]

async_invoke_config_parsed async ¤

async_invoke_config_parsed(input: ComputationRequestedWithClarification, config_parsed: BaseModel, config_raw: RunnableConfig) -> ComputationResult[SkillInputSchema, ResultSchema]

SkillContribute ¤

METHOD DESCRIPTION
as_tool
ATTRIBUTE DESCRIPTION
type

TYPE: Literal['skill.forward']

name

TYPE: str

description

TYPE: str

brain_schema

TYPE: Type[SendContribution]

type class-attribute instance-attribute ¤

type: Literal['skill.forward'] = 'skill.forward'

name class-attribute instance-attribute ¤

name: str = 'send_message_to_colleague'

description class-attribute instance-attribute ¤

description: str = 'Send a message to a colleague'

brain_schema class-attribute instance-attribute ¤

as_tool ¤

as_tool() -> Dict[str, Any]

SkillInputSchemaBase ¤

SkillStructuredResponse ¤

METHOD DESCRIPTION
as_tool
ATTRIBUTE DESCRIPTION
name

TYPE: str

description

TYPE: str

brain_schema

TYPE: Type[BrainSchema]

type

TYPE: Literal['skill.response_structured']

name instance-attribute ¤

name: str

description instance-attribute ¤

description: str

brain_schema instance-attribute ¤

brain_schema: Type[BrainSchema]

type class-attribute instance-attribute ¤

type: Literal['skill.response_structured'] = 'skill.response_structured'

as_tool ¤

as_tool() -> Dict[str, Any]

CrewBase ¤

Base class for managing a Crew with asynchronous invocation and streaming.

Handles interaction with a Team and manages Crew state, inputs, and outputs.

ATTRIBUTE DESCRIPTION
team

The team assigned to this Crew instance.

TYPE: TeamBase

METHOD DESCRIPTION
astream
ainvoke
invoke

Synchronous invocation is not supported; Crew must be invoked asynchronously.

async_invoke_config_parsed

Asynchronously invokes the Crew graph using a parsed configuration.

astream_config_parsed

Streams Crew execution results asynchronously using a parsed configuration.

team instance-attribute ¤

team: TeamBase

config_specs property ¤

config_specs: List[ConfigurableFieldSpec]

Returns all configuration dependencies required by the Crew and its Team.

RETURNS DESCRIPTION
List[ConfigurableFieldSpec]

List[ConfigurableFieldSpec]: Unique configuration specifications

List[ConfigurableFieldSpec]

for the Crew and Team.

astream async ¤

astream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) -> AsyncIterator[Output]

ainvoke async ¤

ainvoke(input: Input, config: Optional[RunnableConfig] = None) -> Output

invoke ¤

invoke(input: CrewInput, config: RunnableConfig | None = None) -> CrewOutput

Synchronous invocation is not supported; Crew must be invoked asynchronously.

RAISES DESCRIPTION
Exception

Always raises because synchronous calls are not allowed.

async_invoke_config_parsed async ¤

async_invoke_config_parsed(input: CrewInput, config_parsed: BaseModel, config_raw: RunnableConfig) -> CrewOutput

Asynchronously invokes the Crew graph using a parsed configuration.

PARAMETER DESCRIPTION

input ¤

Input data for the Crew.

TYPE: CrewInput

config_parsed ¤

Fully parsed configuration.

TYPE: BaseModel

config_raw ¤

Raw configuration data.

TYPE: RunnableConfig

RETURNS DESCRIPTION
CrewOutput

Output from the Crew after execution.

TYPE: CrewOutput

astream_config_parsed async ¤

astream_config_parsed(input: CrewInput, config_parsed: BaseModel, config_raw: RunnableConfig, run_manager: CallbackManagerForChainRun, **kwargs: Any) -> AsyncIterator[Dict[str, Any]]

Streams Crew execution results asynchronously using a parsed configuration.

PARAMETER DESCRIPTION

input ¤

Input for the Crew.

TYPE: CrewInput

config_parsed ¤

Parsed configuration object.

TYPE: BaseModel

config_raw ¤

Raw configuration object.

TYPE: RunnableConfig

run_manager ¤

Callback manager for streaming.

TYPE: CallbackManagerForChainRun

**kwargs ¤

Additional parameters for the streaming executor.

TYPE: Any DEFAULT: {}

YIELDS DESCRIPTION
AsyncIterator[Dict[str, Any]]

AsyncIterator[dict]: Streamed chunks of execution state containing output.

CrewConfig ¤

ATTRIBUTE DESCRIPTION
llm_srv

TYPE: BaseChatModel

use_cases_srv

TYPE: Any

user_name

TYPE: str

today

TYPE: str

checkpointer

TYPE: BaseCheckpointSaver

model_config

llm_srv instance-attribute ¤

llm_srv: BaseChatModel

use_cases_srv instance-attribute ¤

use_cases_srv: Any

user_name class-attribute instance-attribute ¤

user_name: str = Field(...)

today instance-attribute ¤

today: str

checkpointer instance-attribute ¤

checkpointer: BaseCheckpointSaver

model_config class-attribute instance-attribute ¤

model_config = ConfigDict(arbitrary_types_allowed=True)

CrewState ¤

ATTRIBUTE DESCRIPTION
public_messages

TYPE: List[PublicMessage]

clarification

TYPE: Optional[ClarificationPending]

input

TYPE: CrewInput

output

TYPE: Optional[CrewOutput]

public_messages class-attribute instance-attribute ¤

public_messages: List[PublicMessage] = []

clarification class-attribute instance-attribute ¤

clarification: Optional[ClarificationPending] = None

input instance-attribute ¤

input: CrewInput

output class-attribute instance-attribute ¤

output: Optional[CrewOutput] = None

CrewInputFresh ¤

ATTRIBUTE DESCRIPTION
type

TYPE: Literal['crew.input.fresh']

message

TYPE: UserMessage

type class-attribute instance-attribute ¤

type: Literal['crew.input.fresh'] = 'crew.input.fresh'

message instance-attribute ¤

message: UserMessage

CrewInputClarification ¤

ATTRIBUTE DESCRIPTION
type

TYPE: Literal['crew.input.clarification']

clarification_message

TYPE: ClarificationSimpleMessage

type class-attribute instance-attribute ¤

type: Literal['crew.input.clarification'] = 'crew.input.clarification'

clarification_message instance-attribute ¤

clarification_message: ClarificationSimpleMessage

JsonSerializarFromCustomModels ¤

JsonSerializarFromCustomModels(*args, valid_namespaces: Optional[List[str]] = SERIALIZER_VALID_NAMESPACES, **kwargs)

A JSON serializer for custom Crewmaster models.

This class extends the JsonPlusSerializer to properly handle custom models from the crewmaster namespace. It ensures that LangChain's Reviver is aware of the crewmaster modules, preventing errors during deserialization of checkpoints.

PARAMETER DESCRIPTION

*args ¤

Variable length argument list.

DEFAULT: ()

valid_namespaces ¤

The list of namespaces to validate.

TYPE: list DEFAULT: SERIALIZER_VALID_NAMESPACES

**kwargs ¤

Arbitrary keyword arguments.

DEFAULT: {}

ATTRIBUTE DESCRIPTION
reviver

TYPE: Reviver

reviver instance-attribute ¤

reviver: Reviver = Reviver(valid_namespaces=valid_namespaces)

UserMessage ¤

ATTRIBUTE DESCRIPTION
type

TYPE: Literal['human']

subtype

TYPE: Literal['user_message']

timestamp

TYPE: str

content

TYPE: Union[str, List[Union[str, Dict]]]

id

TYPE: str

type class-attribute instance-attribute ¤

type: Literal['human'] = 'human'

subtype class-attribute instance-attribute ¤

subtype: Literal['user_message'] = 'user_message'

timestamp instance-attribute ¤

timestamp: str

content instance-attribute ¤

content: Union[str, List[Union[str, Dict]]]

id instance-attribute ¤

id: str

CrewDependencies ¤

ATTRIBUTE DESCRIPTION
checkpointer

TYPE: Any

llm_srv

TYPE: Any

user_logged

TYPE: UserLogged

user_name

TYPE: str

today

TYPE: str

checkpointer instance-attribute ¤

checkpointer: Any

llm_srv instance-attribute ¤

llm_srv: Any

user_logged instance-attribute ¤

user_logged: UserLogged

user_name instance-attribute ¤

user_name: str

today instance-attribute ¤

today: str

CrewRouterBase ¤

METHOD DESCRIPTION
model_post_init

Se configuran las factories que no son asignadas por el usuario

build_custom_dependencies
transform_input

Transforma la data de entrada HttpInput

ATTRIBUTE DESCRIPTION
path

Ruta en que se monta el endpoint

TYPE: str

runnable

Runnable que ejecuta el Crew

TYPE: Runnable

settings

Settings para el Crew

TYPE: CrewSettings

tags

Etiquetas para categorizar el crew

TYPE: Optional[List[str | Enum]]

auth_strategy

Estrategia de autorización para la aplicación

TYPE: AuthStrategyInterface

dependencies_factory

Proveedor para dependencias custom de la aplicación

TYPE: Optional[Callable[[CrewSettings, CrewDependencies], Awaitable[BaseModel]]]

checkpointer

Factory para checkpointer que almacena estado del Crew

TYPE: BaseCheckpointSaver

llm

Factory para LLM con qué interactúa el Crew

TYPE: Optional[BaseChatModel]

model_config

Configuración del modelo

fastapi_router

TYPE: APIRouter

path class-attribute instance-attribute ¤

path: str = 'crew_events'

Ruta en que se monta el endpoint

runnable instance-attribute ¤

runnable: Runnable

Runnable que ejecuta el Crew

settings instance-attribute ¤

settings: CrewSettings

Settings para el Crew

tags class-attribute instance-attribute ¤

tags: Optional[List[str | Enum]] = None

Etiquetas para categorizar el crew

auth_strategy class-attribute instance-attribute ¤

Estrategia de autorización para la aplicación

dependencies_factory class-attribute instance-attribute ¤

dependencies_factory: Optional[Callable[[CrewSettings, CrewDependencies], Awaitable[BaseModel]]] = None

Proveedor para dependencias custom de la aplicación

checkpointer class-attribute instance-attribute ¤

checkpointer: BaseCheckpointSaver = memory_factory()

Factory para checkpointer que almacena estado del Crew

llm class-attribute instance-attribute ¤

llm: Optional[BaseChatModel] = None

Factory para LLM con qué interactúa el Crew

model_config class-attribute instance-attribute ¤

model_config = ConfigDict(arbitrary_types_allowed=True)

Configuración del modelo

fastapi_router property ¤

fastapi_router: APIRouter

model_post_init ¤

model_post_init(__context: Any)

Se configuran las factories que no son asignadas por el usuario y requieren los settings para configurarse

build_custom_dependencies async ¤

build_custom_dependencies(known_dependencies: CrewDependencies)

transform_input ¤

transform_input(original: HttpInput) -> CrewInput

Transforma la data de entrada HttpInput en la data esperada por el Crew

HttpEventFilter ¤

Define the type, time and format of the messages in the stream.

The defaults allows to receive the less amount of message, with the smallest size.

ATTRIBUTE DESCRIPTION
scope

Type of events that will be sent in the stream.

TYPE: ScopeAvailables

moments

TYPE: Set[AllowedEventMoment]

format

TYPE: EventFormat

scope class-attribute instance-attribute ¤

scope: ScopeAvailables = Field('answer', description='\n    Type of events that will be sent in the stream.\n\n    * answer: Only the definitive answer will be sent\n    * deliberations: Messages between agents\n    * computations: connections with others systems and skills\n\n    Each level include the previous events.\n    ')

Type of events that will be sent in the stream.

  • answer: Only the definitive answer will be sent
  • deliberations: Messages between agents
  • computations: connections with others systems and skills

Each level include the previous events.

moments class-attribute instance-attribute ¤

moments: Set[AllowedEventMoment] = Field({'end'}, description='\n    Time of the event that will be sent.\n    * start: the start of every process\n    * stream: the intermediate events in the agent\n    * end: the final of the process\n    ')

format class-attribute instance-attribute ¤

format: EventFormat = Field('compact', description='\n    Use compact to receive only the event data.\n    Use extended to also receive the event metadata.\n    ')

HttpInputFresh ¤

New input originated by a user message.

Is the most used message in a normal conversation.

ATTRIBUTE DESCRIPTION
type

TYPE: Literal['http.input.fresh']

message

TYPE: UserMessage

type class-attribute instance-attribute ¤

type: Literal['http.input.fresh'] = 'http.input.fresh'

message instance-attribute ¤

message: UserMessage

HttpMetadata ¤

ATTRIBUTE DESCRIPTION
thread_id

TYPE: str

thread_id instance-attribute ¤

thread_id: str

PublicAccessStrategy ¤

METHOD DESCRIPTION
execute
current_user

execute ¤

execute()

current_user ¤

current_user()

UserLogged ¤

ATTRIBUTE DESCRIPTION
email

TYPE: str

name

TYPE: Optional[str]

timezone

TYPE: Optional[str]

credentials

TYPE: Any

email instance-attribute ¤

email: str

name instance-attribute ¤

name: Optional[str]

timezone instance-attribute ¤

timezone: Optional[str]

credentials instance-attribute ¤

credentials: Any

agent ¤

A collaborator specialized as an agent with an LLM model and tools.

MODULE DESCRIPTION
agent_base

agent_base module for the crewmaster library.

agent_base_test
CLASS DESCRIPTION
AgentBase

Base class for implementing agents in the crewmaster architecture.

__all__ module-attribute ¤

__all__ = ['AgentBase']

AgentBase ¤

AgentBase(**data)

Base class for implementing agents in the crewmaster architecture.

This class orchestrates the collaboration between the "brain" and "muscle" components through a state-driven workflow. It sets up the execution graph, defines dependencies, and provides mechanisms for building instructions and handling team membership.

METHOD DESCRIPTION
astream_config_parsed

Asynchronously streams the output of the collaborator.

astream
async_invoke_config_parsed

Asynchronously invokes the collaborator with a parsed configuration.

ainvoke
invoke

Invokes the collaborator.

join_team

Assign the agent to a team and update instructions.

ATTRIBUTE DESCRIPTION
name

TYPE: str

job_description

TYPE: str

agent_name_intro

TYPE: str

public_bio

TYPE: Optional[str]

private_bio

TYPE: Optional[str]

directives

TYPE: Optional[str]

examples

TYPE: Optional[str]

team_membership

TYPE: Optional[TeamMembership]

options

TYPE: List[Skill]

options_built_in

TYPE: List[Skill]

history_strategy

TYPE: HistoryStrategyInterface

situation_builder

TYPE: Optional[SituationBuilderFn]

instructions_transformer

TYPE: Optional[InstructionsTransformerFn]

config_specs

Get the merged configuration specifications for the agent.

TYPE: List[ConfigurableFieldSpec]

name class-attribute instance-attribute ¤

name: str = 'agent'

job_description instance-attribute ¤

job_description: str

agent_name_intro class-attribute instance-attribute ¤

agent_name_intro: str = 'Your name is '

public_bio class-attribute instance-attribute ¤

public_bio: Optional[str] = None

private_bio class-attribute instance-attribute ¤

private_bio: Optional[str] = None

directives class-attribute instance-attribute ¤

directives: Optional[str] = None

examples class-attribute instance-attribute ¤

examples: Optional[str] = None

team_membership class-attribute instance-attribute ¤

team_membership: Optional[TeamMembership] = None

options class-attribute instance-attribute ¤

options: List[Skill] = []

options_built_in class-attribute instance-attribute ¤

options_built_in: List[Skill] = []

history_strategy class-attribute instance-attribute ¤

situation_builder class-attribute instance-attribute ¤

situation_builder: Optional[SituationBuilderFn] = None

instructions_transformer class-attribute instance-attribute ¤

instructions_transformer: Optional[InstructionsTransformerFn] = None

config_specs property ¤

config_specs: List[ConfigurableFieldSpec]

Get the merged configuration specifications for the agent.

RETURNS DESCRIPTION
List[ConfigurableFieldSpec]

List of configuration field specs.

astream_config_parsed async ¤

astream_config_parsed(input: CollaboratorInput, config_parsed: BaseModel, config_raw: RunnableConfig, run_manager: CallbackManagerForChainRun, **kwargs: Optional[Any]) -> AsyncIterator[Dict[str, Any]]

Asynchronously streams the output of the collaborator.

PARAMETER DESCRIPTION
input ¤

The input data for the collaborator.

TYPE: CollaboratorInput

config_parsed ¤

The parsed configuration.

TYPE: BaseModel

config_raw ¤

The raw runnable configuration.

TYPE: RunnableConfig

run_manager ¤

The run manager.

TYPE: CallbackManagerForChainRun

**kwargs ¤

Optional keyword arguments.

TYPE: Optional[Any] DEFAULT: {}

YIELDS DESCRIPTION
dict

The chunks of the output.

astream async ¤

astream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) -> AsyncIterator[Output]

async_invoke_config_parsed async ¤

async_invoke_config_parsed(input: CollaboratorInput, config_parsed: BaseModel, config_raw: RunnableConfig) -> CollaboratorOutput

Asynchronously invokes the collaborator with a parsed configuration.

PARAMETER DESCRIPTION
input ¤

The input data for the collaborator.

TYPE: CollaboratorInput

config_parsed ¤

The parsed configuration.

TYPE: BaseModel

config_raw ¤

The raw runnable configuration.

TYPE: RunnableConfig

RETURNS DESCRIPTION
CollaboratorOutput

The output of the collaborator.

TYPE: CollaboratorOutput

ainvoke async ¤

ainvoke(input: Input, config: Optional[RunnableConfig] = None) -> Output

invoke ¤

invoke(input: CollaboratorInput, config: RunnableConfig | None = None) -> CollaboratorOutput

Invokes the collaborator.

RAISES DESCRIPTION
Exception

Collaborator can only be called asynchronously.

join_team ¤

Assign the agent to a team and update instructions.

PARAMETER DESCRIPTION
team_membership ¤

The team membership object.

TYPE: TeamMembership

agent_base ¤

agent_base module for the crewmaster library.

This module defines the base Agent implementation and supporting functions used to coordinate collaboration between the "brain" and "muscle" components in the crewmaster architecture. The agent operates as a state-driven workflow based on the LangGraph StateGraph, handling user messages, clarification requests, and computation results.

Main responsibilities
  • Define the AgentBase class, which extends CollaboratorBase.
  • Set up execution graphs linking brain and muscle processing nodes.
  • Provide helper functions (start, evaluate_input, brain_node, etc.) for use within the state graph.
  • Orchestrate message processing between different functional components.
CLASS DESCRIPTION
AgentBase

Base class for implementing agents in the crewmaster architecture.

FUNCTION DESCRIPTION
start

Determine the initial step in the agent's state graph.

evaluate_input

Evaluate the current input step from the state.

brain_node

Create a brain processing node for the state graph.

evaluate_brain

Evaluate the output from the brain node.

muscle_node

Create a muscle processing node for the state graph.

evaluate_muscle

Evaluate the output from the muscle node.

cleaner

Final node in the graph for cleanup tasks.

ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤

log = get_logger()

Loger para el módulo

AgentBase ¤

AgentBase(**data)

Base class for implementing agents in the crewmaster architecture.

This class orchestrates the collaboration between the "brain" and "muscle" components through a state-driven workflow. It sets up the execution graph, defines dependencies, and provides mechanisms for building instructions and handling team membership.

METHOD DESCRIPTION
join_team

Assign the agent to a team and update instructions.

astream_config_parsed

Asynchronously streams the output of the collaborator.

astream
async_invoke_config_parsed

Asynchronously invokes the collaborator with a parsed configuration.

ainvoke
invoke

Invokes the collaborator.

ATTRIBUTE DESCRIPTION
name

TYPE: str

job_description

TYPE: str

agent_name_intro

TYPE: str

public_bio

TYPE: Optional[str]

private_bio

TYPE: Optional[str]

directives

TYPE: Optional[str]

examples

TYPE: Optional[str]

team_membership

TYPE: Optional[TeamMembership]

options

TYPE: List[Skill]

options_built_in

TYPE: List[Skill]

history_strategy

TYPE: HistoryStrategyInterface

situation_builder

TYPE: Optional[SituationBuilderFn]

instructions_transformer

TYPE: Optional[InstructionsTransformerFn]

config_specs

Get the merged configuration specifications for the agent.

TYPE: List[ConfigurableFieldSpec]

name class-attribute instance-attribute ¤
name: str = 'agent'
job_description instance-attribute ¤
job_description: str
agent_name_intro class-attribute instance-attribute ¤
agent_name_intro: str = 'Your name is '
public_bio class-attribute instance-attribute ¤
public_bio: Optional[str] = None
private_bio class-attribute instance-attribute ¤
private_bio: Optional[str] = None
directives class-attribute instance-attribute ¤
directives: Optional[str] = None
examples class-attribute instance-attribute ¤
examples: Optional[str] = None
team_membership class-attribute instance-attribute ¤
team_membership: Optional[TeamMembership] = None
options class-attribute instance-attribute ¤
options: List[Skill] = []
options_built_in class-attribute instance-attribute ¤
options_built_in: List[Skill] = []
history_strategy class-attribute instance-attribute ¤
situation_builder class-attribute instance-attribute ¤
situation_builder: Optional[SituationBuilderFn] = None
instructions_transformer class-attribute instance-attribute ¤
instructions_transformer: Optional[InstructionsTransformerFn] = None
config_specs property ¤
config_specs: List[ConfigurableFieldSpec]

Get the merged configuration specifications for the agent.

RETURNS DESCRIPTION
List[ConfigurableFieldSpec]

List of configuration field specs.

join_team ¤

Assign the agent to a team and update instructions.

PARAMETER DESCRIPTION
team_membership ¤

The team membership object.

TYPE: TeamMembership

astream_config_parsed async ¤
astream_config_parsed(input: CollaboratorInput, config_parsed: BaseModel, config_raw: RunnableConfig, run_manager: CallbackManagerForChainRun, **kwargs: Optional[Any]) -> AsyncIterator[Dict[str, Any]]

Asynchronously streams the output of the collaborator.

PARAMETER DESCRIPTION
input ¤

The input data for the collaborator.

TYPE: CollaboratorInput

config_parsed ¤

The parsed configuration.

TYPE: BaseModel

config_raw ¤

The raw runnable configuration.

TYPE: RunnableConfig

run_manager ¤

The run manager.

TYPE: CallbackManagerForChainRun

**kwargs ¤

Optional keyword arguments.

TYPE: Optional[Any] DEFAULT: {}

YIELDS DESCRIPTION
dict

The chunks of the output.

astream async ¤
astream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) -> AsyncIterator[Output]
async_invoke_config_parsed async ¤
async_invoke_config_parsed(input: CollaboratorInput, config_parsed: BaseModel, config_raw: RunnableConfig) -> CollaboratorOutput

Asynchronously invokes the collaborator with a parsed configuration.

PARAMETER DESCRIPTION
input ¤

The input data for the collaborator.

TYPE: CollaboratorInput

config_parsed ¤

The parsed configuration.

TYPE: BaseModel

config_raw ¤

The raw runnable configuration.

TYPE: RunnableConfig

RETURNS DESCRIPTION
CollaboratorOutput

The output of the collaborator.

TYPE: CollaboratorOutput

ainvoke async ¤
ainvoke(input: Input, config: Optional[RunnableConfig] = None) -> Output
invoke ¤
invoke(input: CollaboratorInput, config: RunnableConfig | None = None) -> CollaboratorOutput

Invokes the collaborator.

RAISES DESCRIPTION
Exception

Collaborator can only be called asynchronously.

start ¤

start(state: CollaboratorState, config: RunnableConfig)

Determine the initial step in the agent's state graph.

This function examines the most recent message in the state and decides whether the next step should process a fresh user message or a clarification response.

PARAMETER DESCRIPTION
state ¤

Current collaborator state, containing messages and other workflow data.

TYPE: CollaboratorState

config ¤

Configuration for the runnable execution.

TYPE: RunnableConfig

RETURNS DESCRIPTION
dict

Dictionary containing the key "next_step" with either "fresh_message" or "clarification_response".

evaluate_input ¤

evaluate_input(state: CollaboratorState, config: RunnableConfig)

Evaluate the current input step from the state.

PARAMETER DESCRIPTION
state ¤

Current collaborator state.

TYPE: CollaboratorState

config ¤

Runnable configuration.

TYPE: RunnableConfig

RETURNS DESCRIPTION
str

The next_step attribute from the state.

brain_node ¤

brain_node(brain: BrainBase)

Create a brain processing node for the state graph.

This node processes incoming messages, invokes the brain component, and determines the next step in the workflow based on the brain's output type.

PARAMETER DESCRIPTION
brain ¤

Brain component responsible for reasoning.

TYPE: BrainBase

RETURNS DESCRIPTION
callable

A node executor function compatible with the StateGraph.

RAISES DESCRIPTION
ValueError

If the message type is unsupported or the brain output type is unrecognized.

evaluate_brain ¤

evaluate_brain(state: CollaboratorState, config: RunnableConfig)

Evaluate the output from the brain node.

PARAMETER DESCRIPTION
state ¤

Current state after brain execution.

TYPE: CollaboratorState

config ¤

Runnable configuration.

TYPE: RunnableConfig

RETURNS DESCRIPTION
str

The next_step attribute from the state.

muscle_node ¤

muscle_node(muscle: MuscleBase)

Create a muscle processing node for the state graph.

This node handles either clarification responses or computation requests, invoking the muscle component accordingly.

PARAMETER DESCRIPTION
muscle ¤

Muscle component responsible for performing actions or computations.

TYPE: MuscleBase

RETURNS DESCRIPTION
callable

An async node executor function compatible with StateGraph.

RAISES DESCRIPTION
ValueError

If the muscle output type is invalid.

evaluate_muscle ¤

evaluate_muscle(state: CollaboratorState, config: RunnableConfig)

Evaluate the output from the muscle node.

PARAMETER DESCRIPTION
state ¤

Current state after muscle execution.

TYPE: CollaboratorState

config ¤

Runnable configuration.

TYPE: RunnableConfig

RETURNS DESCRIPTION
str

The next_step attribute from the state.

cleaner ¤

cleaner(state: CollaboratorState, config: RunnableConfig)

Final node in the graph for cleanup tasks.

This node is executed at the end of the workflow. Currently, it performs no operations because the state.output already contains the final result.

PARAMETER DESCRIPTION
state ¤

Final collaborator state.

TYPE: CollaboratorState

config ¤

Runnable configuration.

TYPE: RunnableConfig

agent_base_test ¤

CLASS DESCRIPTION
SumInput
SumOutput
SingleItemsInput
ListItemsInput
TransferBrainSchema
TransferClarification
TransferInput
TransferOutput
SumSkillRepositoryPort
SumSkill
TransferSkillRepositoryPort
TransferSkill
AgentFake
AgentFakeTransformer

Agente para probar las funciones de transformacion

FUNCTION DESCRIPTION
situation_builder
instructions_transformer
create_message
repository_incomplete_srv

Fixture para proveer el falso repository_srv

repository_srv

Fixture para proveer el falso repository_srv

config_fake_llm
config_incomplete
test_repository_incomplete
test_hello
test_computation_required
test_clarification_required
test_response_structured
test_contribution
test_handle_clarification_response
test_stream_hello
test_instructions_transformer_passed_to_brain
test_situation_builder_passed_to_brain
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

list_items_computation

TYPE: Skill

skills_availables

log module-attribute ¤

log = get_logger()

Loger para el módulo

list_items_computation module-attribute ¤

list_items_computation: Skill = SkillStructuredResponse(name='list_items', description='shows a list of items in a structured format for the user \nuse this tool when a user anwser for list of items', brain_schema=ListItemsInput)

skills_availables module-attribute ¤

SumInput ¤

ATTRIBUTE DESCRIPTION
number_1

TYPE: int

number_2

TYPE: int

registry_id

TYPE: str

number_1 instance-attribute ¤
number_1: int
number_2 instance-attribute ¤
number_2: int
registry_id cached property ¤
registry_id: str

SumOutput ¤

ATTRIBUTE DESCRIPTION
result

TYPE: int

result instance-attribute ¤
result: int

SingleItemsInput ¤

ATTRIBUTE DESCRIPTION
name

TYPE: str

description

TYPE: str

name instance-attribute ¤
name: str
description instance-attribute ¤
description: str

ListItemsInput ¤

ATTRIBUTE DESCRIPTION
items

TYPE: List[SingleItemsInput]

registry_id

TYPE: str

items instance-attribute ¤
registry_id cached property ¤
registry_id: str

TransferBrainSchema ¤

ATTRIBUTE DESCRIPTION
from_account

TYPE: str

to_account

TYPE: str

registry_id

TYPE: str

from_account instance-attribute ¤
from_account: str
to_account instance-attribute ¤
to_account: str
registry_id cached property ¤
registry_id: str

TransferClarification ¤

ATTRIBUTE DESCRIPTION
confirmation

TYPE: Literal['y', 'n']

confirmation instance-attribute ¤
confirmation: Literal['y', 'n']

TransferInput ¤

ATTRIBUTE DESCRIPTION
from_account

TYPE: str

to_account

TYPE: str

confirmation

TYPE: Literal['y', 'n']

registry_id

TYPE: str

from_account instance-attribute ¤
from_account: str
to_account instance-attribute ¤
to_account: str
confirmation instance-attribute ¤
confirmation: Literal['y', 'n']
registry_id cached property ¤
registry_id: str

TransferOutput ¤

ATTRIBUTE DESCRIPTION
result

TYPE: str

new_balance

TYPE: int

result instance-attribute ¤
result: str
new_balance instance-attribute ¤
new_balance: int

SumSkillRepositoryPort ¤

METHOD DESCRIPTION
sumar
sumar abstractmethod ¤
sumar(x, y) -> int

SumSkill ¤

METHOD DESCRIPTION
async_executor
async_invoke_config_parsed
ainvoke
as_tool
invoke
get_output_schema
get_input_schema
ATTRIBUTE DESCRIPTION
name

TYPE: str

description

TYPE: str

brain_schema

TYPE: Type[SumInput]

result_schema

TYPE: Type[SumOutput]

config_specs

TYPE: List[ConfigurableFieldSpec]

type

TYPE: Literal['skill.computation']

require_clarification

TYPE: bool

sub_type

TYPE: Literal['direct']

name class-attribute instance-attribute ¤
name: str = 'sum'
description class-attribute instance-attribute ¤
description: str = 'given two numbers return the sum of both'
brain_schema class-attribute instance-attribute ¤
brain_schema: Type[SumInput] = SumInput
result_schema class-attribute instance-attribute ¤
result_schema: Type[SumOutput] = SumOutput
config_specs property ¤
config_specs: List[ConfigurableFieldSpec]
type class-attribute instance-attribute ¤
type: Literal['skill.computation'] = 'skill.computation'
require_clarification class-attribute instance-attribute ¤
require_clarification: bool = False
sub_type class-attribute instance-attribute ¤
sub_type: Literal['direct'] = 'direct'
async_executor async ¤
async_executor(request: SumInput, config: RunnableConfig) -> SumOutput
async_invoke_config_parsed async ¤
async_invoke_config_parsed(input: ComputationRequested, config_parsed: BaseModel, config_raw: RunnableConfig) -> ComputationResult[BrainSchema, ResultSchema]
ainvoke async ¤
ainvoke(input: Input, config: Optional[RunnableConfig] = None) -> Output
as_tool ¤
as_tool() -> Dict[str, Any]
invoke ¤
invoke(input: ComputationRequested, config: RunnableConfig | None = None) -> ComputationResult[BrainSchema, ResultSchema]
get_output_schema ¤
get_output_schema(config: Optional[RunnableConfig] = None) -> Type[ResultSchema]
get_input_schema ¤
get_input_schema(config: Optional[RunnableConfig] = None) -> Type[BrainSchema]

TransferSkillRepositoryPort ¤

METHOD DESCRIPTION
transfer
transfer abstractmethod ¤
transfer(x, y) -> int

TransferSkill ¤

METHOD DESCRIPTION
async_executor
merge_brain_with_clarification
async_invoke_config_parsed
ainvoke
as_tool
invoke
get_output_schema
get_input_schema
get_clarification_schema
ATTRIBUTE DESCRIPTION
name

TYPE: str

description

TYPE: str

brain_schema

TYPE: Type[TransferBrainSchema]

result_schema

TYPE: Type[TransferOutput]

skill_input_schema

TYPE: Type[TransferInput]

clarification_schema

TYPE: Type[TransferClarification]

config_specs

List configurable fields for this runnable.

TYPE: List[ConfigurableFieldSpec]

type

TYPE: Literal['skill.computation']

require_clarification

TYPE: bool

sub_type

TYPE: Literal['with-clarification']

name class-attribute instance-attribute ¤
name: str = 'transfer'
description class-attribute instance-attribute ¤
description: str = 'transfer money between accounts'
brain_schema class-attribute instance-attribute ¤
result_schema class-attribute instance-attribute ¤
skill_input_schema class-attribute instance-attribute ¤
skill_input_schema: Type[TransferInput] = TransferInput
clarification_schema class-attribute instance-attribute ¤
config_specs property ¤
config_specs: List[ConfigurableFieldSpec]

List configurable fields for this runnable.

type class-attribute instance-attribute ¤
type: Literal['skill.computation'] = 'skill.computation'
require_clarification class-attribute instance-attribute ¤
require_clarification: bool = False
sub_type class-attribute instance-attribute ¤
sub_type: Literal['with-clarification'] = 'with-clarification'
async_executor async ¤
async_executor(request: TransferInput, config: RunnableConfig) -> TransferOutput
merge_brain_with_clarification ¤
merge_brain_with_clarification(brain_input: TransferBrainSchema, clarification_input: TransferClarification) -> TransferInput
async_invoke_config_parsed async ¤
async_invoke_config_parsed(input: ComputationRequestedWithClarification, config_parsed: BaseModel, config_raw: RunnableConfig) -> ComputationResult[SkillInputSchema, ResultSchema]
ainvoke async ¤
ainvoke(input: Input, config: Optional[RunnableConfig] = None) -> Output
as_tool ¤
as_tool() -> Dict[str, Any]
invoke ¤
invoke(input: ComputationRequested, config: RunnableConfig | None = None) -> ComputationResult[BrainSchema, ResultSchema]
get_output_schema ¤
get_output_schema(config: Optional[RunnableConfig] = None) -> Type[ResultSchema]
get_input_schema ¤
get_input_schema(config: Optional[RunnableConfig] = None) -> Type[BrainSchema]
get_clarification_schema ¤
get_clarification_schema(config: Optional[RunnableConfig] = None) -> Type[ClarificationSchema]

AgentFake ¤

AgentFake(**data)
METHOD DESCRIPTION
astream_config_parsed

Asynchronously streams the output of the collaborator.

astream
async_invoke_config_parsed

Asynchronously invokes the collaborator with a parsed configuration.

ainvoke
join_team

Assign the agent to a team and update instructions.

invoke

Invokes the collaborator.

ATTRIBUTE DESCRIPTION
name

TYPE: str

job_description

TYPE: str

options

TYPE: List[Skill]

config_specs

Get the merged configuration specifications for the agent.

TYPE: List[ConfigurableFieldSpec]

agent_name_intro

TYPE: str

public_bio

TYPE: Optional[str]

private_bio

TYPE: Optional[str]

directives

TYPE: Optional[str]

examples

TYPE: Optional[str]

team_membership

TYPE: Optional[TeamMembership]

options_built_in

TYPE: List[Skill]

history_strategy

TYPE: HistoryStrategyInterface

situation_builder

TYPE: Optional[SituationBuilderFn]

instructions_transformer

TYPE: Optional[InstructionsTransformerFn]

name class-attribute instance-attribute ¤
name: str = 'Adam_Smith'
job_description class-attribute instance-attribute ¤
job_description: str = '\n    You are a super agent 86\n    '
options class-attribute instance-attribute ¤
config_specs property ¤
config_specs: List[ConfigurableFieldSpec]

Get the merged configuration specifications for the agent.

RETURNS DESCRIPTION
List[ConfigurableFieldSpec]

List of configuration field specs.

agent_name_intro class-attribute instance-attribute ¤
agent_name_intro: str = 'Your name is '
public_bio class-attribute instance-attribute ¤
public_bio: Optional[str] = None
private_bio class-attribute instance-attribute ¤
private_bio: Optional[str] = None
directives class-attribute instance-attribute ¤
directives: Optional[str] = None
examples class-attribute instance-attribute ¤
examples: Optional[str] = None
team_membership class-attribute instance-attribute ¤
team_membership: Optional[TeamMembership] = None
options_built_in class-attribute instance-attribute ¤
options_built_in: List[Skill] = []
history_strategy class-attribute instance-attribute ¤
situation_builder class-attribute instance-attribute ¤
situation_builder: Optional[SituationBuilderFn] = None
instructions_transformer class-attribute instance-attribute ¤
instructions_transformer: Optional[InstructionsTransformerFn] = None
astream_config_parsed async ¤
astream_config_parsed(input: CollaboratorInput, config_parsed: BaseModel, config_raw: RunnableConfig, run_manager: CallbackManagerForChainRun, **kwargs: Optional[Any]) -> AsyncIterator[Dict[str, Any]]

Asynchronously streams the output of the collaborator.

PARAMETER DESCRIPTION
input ¤

The input data for the collaborator.

TYPE: CollaboratorInput

config_parsed ¤

The parsed configuration.

TYPE: BaseModel

config_raw ¤

The raw runnable configuration.

TYPE: RunnableConfig

run_manager ¤

The run manager.

TYPE: CallbackManagerForChainRun

**kwargs ¤

Optional keyword arguments.

TYPE: Optional[Any] DEFAULT: {}

YIELDS DESCRIPTION
dict

The chunks of the output.

astream async ¤
astream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) -> AsyncIterator[Output]
async_invoke_config_parsed async ¤
async_invoke_config_parsed(input: CollaboratorInput, config_parsed: BaseModel, config_raw: RunnableConfig) -> CollaboratorOutput

Asynchronously invokes the collaborator with a parsed configuration.

PARAMETER DESCRIPTION
input ¤

The input data for the collaborator.

TYPE: CollaboratorInput

config_parsed ¤

The parsed configuration.

TYPE: BaseModel

config_raw ¤

The raw runnable configuration.

TYPE: RunnableConfig

RETURNS DESCRIPTION
CollaboratorOutput

The output of the collaborator.

TYPE: CollaboratorOutput

ainvoke async ¤
ainvoke(input: Input, config: Optional[RunnableConfig] = None) -> Output
join_team ¤

Assign the agent to a team and update instructions.

PARAMETER DESCRIPTION
team_membership ¤

The team membership object.

TYPE: TeamMembership

invoke ¤
invoke(input: CollaboratorInput, config: RunnableConfig | None = None) -> CollaboratorOutput

Invokes the collaborator.

RAISES DESCRIPTION
Exception

Collaborator can only be called asynchronously.

AgentFakeTransformer ¤

AgentFakeTransformer(**data)

Agente para probar las funciones de transformacion

METHOD DESCRIPTION
astream_config_parsed

Asynchronously streams the output of the collaborator.

astream
async_invoke_config_parsed

Asynchronously invokes the collaborator with a parsed configuration.

ainvoke
join_team

Assign the agent to a team and update instructions.

invoke

Invokes the collaborator.

ATTRIBUTE DESCRIPTION
situation_builder

TYPE: Optional[SituationBuilderFn]

instructions_transformer

TYPE: Optional[InstructionsTransformerFn]

job_description

TYPE: str

config_specs

Get the merged configuration specifications for the agent.

TYPE: List[ConfigurableFieldSpec]

name

TYPE: str

agent_name_intro

TYPE: str

public_bio

TYPE: Optional[str]

private_bio

TYPE: Optional[str]

directives

TYPE: Optional[str]

examples

TYPE: Optional[str]

team_membership

TYPE: Optional[TeamMembership]

options

TYPE: List[Skill]

options_built_in

TYPE: List[Skill]

history_strategy

TYPE: HistoryStrategyInterface

situation_builder class-attribute instance-attribute ¤
instructions_transformer class-attribute instance-attribute ¤
job_description class-attribute instance-attribute ¤
job_description: str = '\n    You are a super agent 86\n    '
config_specs property ¤
config_specs: List[ConfigurableFieldSpec]

Get the merged configuration specifications for the agent.

RETURNS DESCRIPTION
List[ConfigurableFieldSpec]

List of configuration field specs.

name class-attribute instance-attribute ¤
name: str = 'Adam_Smith'
agent_name_intro class-attribute instance-attribute ¤
agent_name_intro: str = 'Your name is '
public_bio class-attribute instance-attribute ¤
public_bio: Optional[str] = None
private_bio class-attribute instance-attribute ¤
private_bio: Optional[str] = None
directives class-attribute instance-attribute ¤
directives: Optional[str] = None
examples class-attribute instance-attribute ¤
examples: Optional[str] = None
team_membership class-attribute instance-attribute ¤
team_membership: Optional[TeamMembership] = None
options class-attribute instance-attribute ¤
options_built_in class-attribute instance-attribute ¤
options_built_in: List[Skill] = []
history_strategy class-attribute instance-attribute ¤
astream_config_parsed async ¤
astream_config_parsed(input: CollaboratorInput, config_parsed: BaseModel, config_raw: RunnableConfig, run_manager: CallbackManagerForChainRun, **kwargs: Optional[Any]) -> AsyncIterator[Dict[str, Any]]

Asynchronously streams the output of the collaborator.

PARAMETER DESCRIPTION
input ¤

The input data for the collaborator.

TYPE: CollaboratorInput

config_parsed ¤

The parsed configuration.

TYPE: BaseModel

config_raw ¤

The raw runnable configuration.

TYPE: RunnableConfig

run_manager ¤

The run manager.

TYPE: CallbackManagerForChainRun

**kwargs ¤

Optional keyword arguments.

TYPE: Optional[Any] DEFAULT: {}

YIELDS DESCRIPTION
dict

The chunks of the output.

astream async ¤
astream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) -> AsyncIterator[Output]
async_invoke_config_parsed async ¤
async_invoke_config_parsed(input: CollaboratorInput, config_parsed: BaseModel, config_raw: RunnableConfig) -> CollaboratorOutput

Asynchronously invokes the collaborator with a parsed configuration.

PARAMETER DESCRIPTION
input ¤

The input data for the collaborator.

TYPE: CollaboratorInput

config_parsed ¤

The parsed configuration.

TYPE: BaseModel

config_raw ¤

The raw runnable configuration.

TYPE: RunnableConfig

RETURNS DESCRIPTION
CollaboratorOutput

The output of the collaborator.

TYPE: CollaboratorOutput

ainvoke async ¤
ainvoke(input: Input, config: Optional[RunnableConfig] = None) -> Output
join_team ¤

Assign the agent to a team and update instructions.

PARAMETER DESCRIPTION
team_membership ¤

The team membership object.

TYPE: TeamMembership

invoke ¤
invoke(input: CollaboratorInput, config: RunnableConfig | None = None) -> CollaboratorOutput

Invokes the collaborator.

RAISES DESCRIPTION
Exception

Collaborator can only be called asynchronously.

situation_builder ¤

situation_builder(input, config)

instructions_transformer ¤

instructions_transformer(input, config)

create_message ¤

create_message(content: str)

repository_incomplete_srv ¤

repository_incomplete_srv()

Fixture para proveer el falso repository_srv

repository_srv ¤

repository_srv()

Fixture para proveer el falso repository_srv

config_fake_llm ¤

config_fake_llm(repository_srv)

config_incomplete ¤

config_incomplete(repository_incomplete_srv)

test_repository_incomplete async ¤

test_repository_incomplete(config_incomplete)

test_hello async ¤

test_hello(config_fake_llm)

test_computation_required async ¤

test_computation_required(config_fake_llm)

test_clarification_required async ¤

test_clarification_required(config_fake_llm)

test_response_structured async ¤

test_response_structured(config_fake_llm)

test_contribution async ¤

test_contribution(config_fake_llm)

test_handle_clarification_response async ¤

test_handle_clarification_response(config_fake_llm)

test_stream_hello async ¤

test_stream_hello(config_fake_llm)

test_instructions_transformer_passed_to_brain async ¤

test_instructions_transformer_passed_to_brain(config_fake_llm)

test_situation_builder_passed_to_brain async ¤

test_situation_builder_passed_to_brain(config_fake_llm)

brain ¤

Handle the connection with the LLM model.

MODULE DESCRIPTION
brain_base

Module for the BrainBase core logic in CrewMaster.

brain_base_test

Tests for BrainBase

brain_types

Module defining input and output data structures for CrewMaster's Brain system.

helpers
CLASS DESCRIPTION
BrainBase

Base class for implementing Brain components in CrewMaster.

ATTRIBUTE DESCRIPTION
BrainInput

Union type representing all possible Brain input variants.

BrainOutput

Union type representing all possible Brain output variants.

SituationBuilderFn

Callable type for functions that build a situation description.

InstructionsTransformerFn

Callable type for functions that transform instructions.

BrainInput module-attribute ¤

Union type representing all possible Brain input variants.

BrainOutput module-attribute ¤

Union type representing all possible Brain output variants.

SituationBuilderFn module-attribute ¤

SituationBuilderFn = Callable[[BrainInputBase, RunnableConfig], str]

Callable type for functions that build a situation description.

PARAMETER DESCRIPTION

input_data ¤

The base input to process.

TYPE: BrainInputBase

config ¤

Configuration for the runnable environment.

TYPE: RunnableConfig

RETURNS DESCRIPTION
str

The constructed situation description.

InstructionsTransformerFn module-attribute ¤

InstructionsTransformerFn = Callable[[str, BrainInputBase, RunnableConfig], str]

Callable type for functions that transform instructions.

PARAMETER DESCRIPTION

instructions ¤

The raw instruction string to transform.

TYPE: str

input_data ¤

The base input to process.

TYPE: BrainInputBase

config ¤

Configuration for the runnable environment.

TYPE: RunnableConfig

RETURNS DESCRIPTION
str

The transformed instruction string.

__all__ module-attribute ¤

__all__ = ['BrainBase', 'BrainInput', 'BrainOutput', 'SituationBuilderFn', 'InstructionsTransformerFn']

BrainBase ¤

Base class for implementing Brain components in CrewMaster.

This class provides mechanisms to: * Build prompts for LLMs * Parse actions and outputs from LLMs * Handle both synchronous and asynchronous execution * Manage skill registration and configuration

ATTRIBUTE DESCRIPTION
name

The name of this brain component.

TYPE: str

instructions

Base instructions for the LLM.

TYPE: str

agent_name

The agent's identifier name.

TYPE: str

situation_builder

Optional callable for building context situations.

TYPE: Optional[SituationBuilderFn]

skills

A list of skills available to the brain.

TYPE: List[Skill]

history_strategy

Strategy for managing conversation history.

TYPE: HistoryStrategyInterface

instructions_transformer

Optional callable for modifying instructions before sending to LLM.

TYPE: Optional[InstructionsTransformerFn]

METHOD DESCRIPTION
astream
invoke
validate_templates

Validates that all template placeholders in instructions are valid.

invoke_config_parsed

Synchronously invokes the brain with parsed configuration.

astream_config_parsed

Asynchronously streams output from the brain with parsed configuration.

get_skills_as_dict

Returns the registered skills as a dictionary keyed by skill name.

name class-attribute instance-attribute ¤

name: str = 'brain'

instructions instance-attribute ¤

instructions: str

agent_name instance-attribute ¤

agent_name: str

situation_builder class-attribute instance-attribute ¤

situation_builder: Optional[SituationBuilderFn] = None

skills class-attribute instance-attribute ¤

skills: List[Skill] = []

history_strategy class-attribute instance-attribute ¤

instructions_transformer class-attribute instance-attribute ¤

instructions_transformer: Optional[InstructionsTransformerFn] = None

config_specs property ¤

config_specs: List[ConfigurableFieldSpec]

Returns the list of configurable fields for this runnable.

RETURNS DESCRIPTION
List[ConfigurableFieldSpec]

List[ConfigurableFieldSpec]: The configuration specifications.

astream async ¤

astream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) -> AsyncIterator[Output]

invoke ¤

invoke(input: Input, config: Optional[RunnableConfig] = None) -> Output

validate_templates ¤

validate_templates(values: Any)

Validates that all template placeholders in instructions are valid.

PARAMETER DESCRIPTION
values ¤

The values passed to the model.

TYPE: Any

RETURNS DESCRIPTION
dict

The validated values.

invoke_config_parsed ¤

invoke_config_parsed(input: BrainInput, config_parsed: BaseModel, config_raw: RunnableConfig) -> BrainOutput

Synchronously invokes the brain with parsed configuration.

PARAMETER DESCRIPTION
input ¤

The brain input.

TYPE: BrainInput

config_parsed ¤

The parsed configuration model.

TYPE: BaseModel

config_raw ¤

The raw configuration.

TYPE: RunnableConfig

RETURNS DESCRIPTION
BrainOutput

The brain's output.

TYPE: BrainOutput

astream_config_parsed async ¤

astream_config_parsed(input: BrainInput, config_parsed: BaseModel, config_raw: RunnableConfig, run_manager: CallbackManagerForChainRun, **kwargs: Optional[Any]) -> AsyncIterator[BaseMessage]

Asynchronously streams output from the brain with parsed configuration.

PARAMETER DESCRIPTION
input ¤

The brain input.

TYPE: BrainInput

config_parsed ¤

The parsed configuration model.

TYPE: BaseModel

config_raw ¤

The raw configuration.

TYPE: RunnableConfig

run_manager ¤

The run manager for handling callbacks.

TYPE: CallbackManagerForChainRun

**kwargs ¤

Additional keyword arguments.

TYPE: Optional[Any] DEFAULT: {}

YIELDS DESCRIPTION
BaseMessage

Each chunk of streamed LLM output.

TYPE:: AsyncIterator[BaseMessage]

get_skills_as_dict ¤

get_skills_as_dict() -> Dict[str, Skill]

Returns the registered skills as a dictionary keyed by skill name.

RETURNS DESCRIPTION
Dict[str, Skill]

Dict[str, Skill]: Mapping from skill name to skill object.

brain_base ¤

Module for the BrainBase core logic in CrewMaster.

This module defines the BrainBase class and its associated utility functions. It provides the building blocks for constructing, invoking, and processing messages between the CrewMaster "Brain" and external components, including LLM-based agents and computation tools.

CLASS DESCRIPTION
BrainBase

Base class for implementing Brain components in CrewMaster.

ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤

log = get_logger()

Loger para el módulo

BrainBase ¤

Base class for implementing Brain components in CrewMaster.

This class provides mechanisms to: * Build prompts for LLMs * Parse actions and outputs from LLMs * Handle both synchronous and asynchronous execution * Manage skill registration and configuration

ATTRIBUTE DESCRIPTION
name

The name of this brain component.

TYPE: str

instructions

Base instructions for the LLM.

TYPE: str

agent_name

The agent's identifier name.

TYPE: str

situation_builder

Optional callable for building context situations.

TYPE: Optional[SituationBuilderFn]

skills

A list of skills available to the brain.

TYPE: List[Skill]

history_strategy

Strategy for managing conversation history.

TYPE: HistoryStrategyInterface

instructions_transformer

Optional callable for modifying instructions before sending to LLM.

TYPE: Optional[InstructionsTransformerFn]

METHOD DESCRIPTION
validate_templates

Validates that all template placeholders in instructions are valid.

invoke_config_parsed

Synchronously invokes the brain with parsed configuration.

astream_config_parsed

Asynchronously streams output from the brain with parsed configuration.

get_skills_as_dict

Returns the registered skills as a dictionary keyed by skill name.

astream
invoke
name class-attribute instance-attribute ¤
name: str = 'brain'
instructions instance-attribute ¤
instructions: str
agent_name instance-attribute ¤
agent_name: str
situation_builder class-attribute instance-attribute ¤
situation_builder: Optional[SituationBuilderFn] = None
skills class-attribute instance-attribute ¤
skills: List[Skill] = []
history_strategy class-attribute instance-attribute ¤
instructions_transformer class-attribute instance-attribute ¤
instructions_transformer: Optional[InstructionsTransformerFn] = None
config_specs property ¤
config_specs: List[ConfigurableFieldSpec]

Returns the list of configurable fields for this runnable.

RETURNS DESCRIPTION
List[ConfigurableFieldSpec]

List[ConfigurableFieldSpec]: The configuration specifications.

validate_templates ¤
validate_templates(values: Any)

Validates that all template placeholders in instructions are valid.

PARAMETER DESCRIPTION
values ¤

The values passed to the model.

TYPE: Any

RETURNS DESCRIPTION
dict

The validated values.

invoke_config_parsed ¤
invoke_config_parsed(input: BrainInput, config_parsed: BaseModel, config_raw: RunnableConfig) -> BrainOutput

Synchronously invokes the brain with parsed configuration.

PARAMETER DESCRIPTION
input ¤

The brain input.

TYPE: BrainInput

config_parsed ¤

The parsed configuration model.

TYPE: BaseModel

config_raw ¤

The raw configuration.

TYPE: RunnableConfig

RETURNS DESCRIPTION
BrainOutput

The brain's output.

TYPE: BrainOutput

astream_config_parsed async ¤
astream_config_parsed(input: BrainInput, config_parsed: BaseModel, config_raw: RunnableConfig, run_manager: CallbackManagerForChainRun, **kwargs: Optional[Any]) -> AsyncIterator[BaseMessage]

Asynchronously streams output from the brain with parsed configuration.

PARAMETER DESCRIPTION
input ¤

The brain input.

TYPE: BrainInput

config_parsed ¤

The parsed configuration model.

TYPE: BaseModel

config_raw ¤

The raw configuration.

TYPE: RunnableConfig

run_manager ¤

The run manager for handling callbacks.

TYPE: CallbackManagerForChainRun

**kwargs ¤

Additional keyword arguments.

TYPE: Optional[Any] DEFAULT: {}

YIELDS DESCRIPTION
BaseMessage

Each chunk of streamed LLM output.

TYPE:: AsyncIterator[BaseMessage]

get_skills_as_dict ¤
get_skills_as_dict() -> Dict[str, Skill]

Returns the registered skills as a dictionary keyed by skill name.

RETURNS DESCRIPTION
Dict[str, Skill]

Dict[str, Skill]: Mapping from skill name to skill object.

astream async ¤
astream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) -> AsyncIterator[Output]
invoke ¤
invoke(input: Input, config: Optional[RunnableConfig] = None) -> Output

brain_base_test ¤

Tests for BrainBase

CLASS DESCRIPTION
SumInput

Esquema de entrada para fake tool de Suma

SumOutput

Esquema de salida para fake tool de Suma

SingleItemsInput

Esquema de entrada para fake tool de Listar items

ListItemsInput

Esquema de salida para fake tool de Listar items

SumSkill

Fake tool para sumar dos números

BrainFake

Cerebro fake para los tests

FUNCTION DESCRIPTION
situation_builder
create_input_fresh
config_fake_llm
test_hello
test_computation_required
test_skill_non_valid
test_contribution
test_response_structured
test_stream_hello
test_stream_computation_requested
test_get_skills_brain_schema
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

sum_computation

list_items_computation

TYPE: Skill

send_message_to_colleague

log module-attribute ¤

log = get_logger()

Loger para el módulo

sum_computation module-attribute ¤

sum_computation = SumSkill()

list_items_computation module-attribute ¤

list_items_computation: Skill = SkillStructuredResponse(name='list_items', description='shows a list of items in a structured format for the user', brain_schema=ListItemsInput)

send_message_to_colleague module-attribute ¤

send_message_to_colleague = SkillContribute(name='send_message_to_colleague', description='Send a message to a colleague')

SumInput ¤

Esquema de entrada para fake tool de Suma

ATTRIBUTE DESCRIPTION
number_1

TYPE: int

number_2

TYPE: int

registry_id

TYPE: str

number_1 instance-attribute ¤
number_1: int
number_2 instance-attribute ¤
number_2: int
registry_id cached property ¤
registry_id: str

SumOutput ¤

Esquema de salida para fake tool de Suma

ATTRIBUTE DESCRIPTION
result

TYPE: int

result instance-attribute ¤
result: int

SingleItemsInput ¤

Esquema de entrada para fake tool de Listar items

ATTRIBUTE DESCRIPTION
name

TYPE: str

description

TYPE: str

name instance-attribute ¤
name: str
description instance-attribute ¤
description: str

ListItemsInput ¤

Esquema de salida para fake tool de Listar items

ATTRIBUTE DESCRIPTION
items

TYPE: List[SingleItemsInput]

registry_id

TYPE: str

items instance-attribute ¤
registry_id cached property ¤
registry_id: str

SumSkill ¤

Fake tool para sumar dos números

METHOD DESCRIPTION
async_executor
async_invoke_config_parsed
ainvoke
as_tool
invoke
get_output_schema
get_input_schema
ATTRIBUTE DESCRIPTION
name

TYPE: str

description

TYPE: str

brain_schema

TYPE: Type[SumInput]

result_schema

TYPE: Type[SumOutput]

type

TYPE: Literal['skill.computation']

require_clarification

TYPE: bool

sub_type

TYPE: Literal['direct']

name class-attribute instance-attribute ¤
name: str = 'sum'
description class-attribute instance-attribute ¤
description: str = 'given two numbers return the sum of both'
brain_schema class-attribute instance-attribute ¤
brain_schema: Type[SumInput] = SumInput
result_schema class-attribute instance-attribute ¤
result_schema: Type[SumOutput] = SumOutput
type class-attribute instance-attribute ¤
type: Literal['skill.computation'] = 'skill.computation'
require_clarification class-attribute instance-attribute ¤
require_clarification: bool = False
sub_type class-attribute instance-attribute ¤
sub_type: Literal['direct'] = 'direct'
async_executor async ¤
async_executor(request: SumInput, config: RunnableConfig) -> SumOutput
async_invoke_config_parsed async ¤
async_invoke_config_parsed(input: ComputationRequested, config_parsed: BaseModel, config_raw: RunnableConfig) -> ComputationResult[BrainSchema, ResultSchema]
ainvoke async ¤
ainvoke(input: Input, config: Optional[RunnableConfig] = None) -> Output
as_tool ¤
as_tool() -> Dict[str, Any]
invoke ¤
invoke(input: ComputationRequested, config: RunnableConfig | None = None) -> ComputationResult[BrainSchema, ResultSchema]
get_output_schema ¤
get_output_schema(config: Optional[RunnableConfig] = None) -> Type[ResultSchema]
get_input_schema ¤
get_input_schema(config: Optional[RunnableConfig] = None) -> Type[BrainSchema]

BrainFake ¤

Cerebro fake para los tests

METHOD DESCRIPTION
astream_config_parsed

Asynchronously streams output from the brain with parsed configuration.

astream
invoke_config_parsed

Synchronously invokes the brain with parsed configuration.

invoke
validate_templates

Validates that all template placeholders in instructions are valid.

get_skills_as_dict

Returns the registered skills as a dictionary keyed by skill name.

ATTRIBUTE DESCRIPTION
agent_name

TYPE: str

instructions

TYPE: str

skills

TYPE: List[Skill]

situation_builder

TYPE: Optional[SituationBuilderFn]

name

TYPE: str

history_strategy

TYPE: HistoryStrategyInterface

instructions_transformer

TYPE: Optional[InstructionsTransformerFn]

config_specs

Returns the list of configurable fields for this runnable.

TYPE: List[ConfigurableFieldSpec]

agent_name class-attribute instance-attribute ¤
agent_name: str = 'Adam_Smith'
instructions class-attribute instance-attribute ¤
instructions: str = '\n        Your name is Adam_Smith\n\n        Answer questions only about Finance and Mathematics.\n    '
skills class-attribute instance-attribute ¤
situation_builder class-attribute instance-attribute ¤
name class-attribute instance-attribute ¤
name: str = 'brain'
history_strategy class-attribute instance-attribute ¤
instructions_transformer class-attribute instance-attribute ¤
instructions_transformer: Optional[InstructionsTransformerFn] = None
config_specs property ¤
config_specs: List[ConfigurableFieldSpec]

Returns the list of configurable fields for this runnable.

RETURNS DESCRIPTION
List[ConfigurableFieldSpec]

List[ConfigurableFieldSpec]: The configuration specifications.

astream_config_parsed async ¤
astream_config_parsed(input: BrainInput, config_parsed: BaseModel, config_raw: RunnableConfig, run_manager: CallbackManagerForChainRun, **kwargs: Optional[Any]) -> AsyncIterator[BaseMessage]

Asynchronously streams output from the brain with parsed configuration.

PARAMETER DESCRIPTION
input ¤

The brain input.

TYPE: BrainInput

config_parsed ¤

The parsed configuration model.

TYPE: BaseModel

config_raw ¤

The raw configuration.

TYPE: RunnableConfig

run_manager ¤

The run manager for handling callbacks.

TYPE: CallbackManagerForChainRun

**kwargs ¤

Additional keyword arguments.

TYPE: Optional[Any] DEFAULT: {}

YIELDS DESCRIPTION
BaseMessage

Each chunk of streamed LLM output.

TYPE:: AsyncIterator[BaseMessage]

astream async ¤
astream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) -> AsyncIterator[Output]
invoke_config_parsed ¤
invoke_config_parsed(input: BrainInput, config_parsed: BaseModel, config_raw: RunnableConfig) -> BrainOutput

Synchronously invokes the brain with parsed configuration.

PARAMETER DESCRIPTION
input ¤

The brain input.

TYPE: BrainInput

config_parsed ¤

The parsed configuration model.

TYPE: BaseModel

config_raw ¤

The raw configuration.

TYPE: RunnableConfig

RETURNS DESCRIPTION
BrainOutput

The brain's output.

TYPE: BrainOutput

invoke ¤
invoke(input: Input, config: Optional[RunnableConfig] = None) -> Output
validate_templates ¤
validate_templates(values: Any)

Validates that all template placeholders in instructions are valid.

PARAMETER DESCRIPTION
values ¤

The values passed to the model.

TYPE: Any

RETURNS DESCRIPTION
dict

The validated values.

get_skills_as_dict ¤
get_skills_as_dict() -> Dict[str, Skill]

Returns the registered skills as a dictionary keyed by skill name.

RETURNS DESCRIPTION
Dict[str, Skill]

Dict[str, Skill]: Mapping from skill name to skill object.

situation_builder ¤

situation_builder(input, config)

create_input_fresh ¤

create_input_fresh(content: str, user_name: str = 'Cheito')

config_fake_llm ¤

config_fake_llm()

test_hello ¤

test_hello(config_fake_llm)

test_computation_required ¤

test_computation_required(config_fake_llm)

test_skill_non_valid ¤

test_skill_non_valid(config_fake_llm)

test_contribution ¤

test_contribution(config_fake_llm)

test_response_structured ¤

test_response_structured(config_fake_llm)

test_stream_hello async ¤

test_stream_hello(config_fake_llm)

test_stream_computation_requested async ¤

test_stream_computation_requested(config_fake_llm)

test_get_skills_brain_schema async ¤

test_get_skills_brain_schema()

brain_types ¤

Module defining input and output data structures for CrewMaster's Brain system.

This module contains the Pydantic models, type adapters, and callable type definitions used for representing and handling structured communication between Brain components. The models are designed for type-safe serialization, validation, and discrimination between different message types.

CLASS DESCRIPTION
BrainInputBase

Base class for all Brain input types.

BrainInputFresh

Represents a fresh Brain input request.

BrainInputResults

Represents Brain input containing computation results.

BrainOutputBase

Base class for all Brain output types.

BrainOutputResponse

Represents a Brain output containing a text-based response.

BrainOutputResponseStructured

Represents a Brain output with structured data payload.

BrainOutputContribution

Represents a Brain output containing a contribution message.

BrainOutputComputationsRequired

Represents a Brain output that requires computations to be performed.

ATTRIBUTE DESCRIPTION
log

Loger para el módulo

BrainInput

Union type representing all possible Brain input variants.

BrainInputAdapter

Type adapter for serializing/deserializing BrainInput instances.

TYPE: TypeAdapter[BrainInput]

BrainOutput

Union type representing all possible Brain output variants.

BrainOutputAdapter

Type adapter for serializing/deserializing BrainOutput instances.

TYPE: TypeAdapter[BrainOutput]

SituationBuilderFn

Callable type for functions that build a situation description.

InstructionsTransformerFn

Callable type for functions that transform instructions.

log module-attribute ¤

log = get_logger()

Loger para el módulo

BrainInput module-attribute ¤

Union type representing all possible Brain input variants.

BrainInputAdapter module-attribute ¤

BrainInputAdapter: TypeAdapter[BrainInput] = TypeAdapter(BrainInput)

Type adapter for serializing/deserializing BrainInput instances.

BrainOutput module-attribute ¤

Union type representing all possible Brain output variants.

BrainOutputAdapter module-attribute ¤

BrainOutputAdapter: TypeAdapter[BrainOutput] = TypeAdapter(BrainOutput)

Type adapter for serializing/deserializing BrainOutput instances.

SituationBuilderFn module-attribute ¤

SituationBuilderFn = Callable[[BrainInputBase, RunnableConfig], str]

Callable type for functions that build a situation description.

PARAMETER DESCRIPTION
input_data ¤

The base input to process.

TYPE: BrainInputBase

config ¤

Configuration for the runnable environment.

TYPE: RunnableConfig

RETURNS DESCRIPTION
str

The constructed situation description.

InstructionsTransformerFn module-attribute ¤

InstructionsTransformerFn = Callable[[str, BrainInputBase, RunnableConfig], str]

Callable type for functions that transform instructions.

PARAMETER DESCRIPTION
instructions ¤

The raw instruction string to transform.

TYPE: str

input_data ¤

The base input to process.

TYPE: BrainInputBase

config ¤

Configuration for the runnable environment.

TYPE: RunnableConfig

RETURNS DESCRIPTION
str

The transformed instruction string.

BrainInputBase ¤

Base class for all Brain input types.

ATTRIBUTE DESCRIPTION
messages

The list of incoming messages.

TYPE: List[AnyMessage]

user_name

The name of the user associated with the input.

TYPE: str

today

The current date as a string, used for context.

TYPE: str

messages instance-attribute ¤
messages: List[AnyMessage]
user_name instance-attribute ¤
user_name: str
today instance-attribute ¤
today: str

BrainInputFresh ¤

Represents a fresh Brain input request.

ATTRIBUTE DESCRIPTION
type

The fixed type discriminator for this input.

TYPE: Literal['brain.input.fresh']

type class-attribute instance-attribute ¤
type: Literal['brain.input.fresh'] = 'brain.input.fresh'
messages instance-attribute ¤
messages: List[AnyMessage]
user_name instance-attribute ¤
user_name: str
today instance-attribute ¤
today: str

BrainInputResults ¤

Represents Brain input containing computation results.

ATTRIBUTE DESCRIPTION
type

The fixed type discriminator for this input.

TYPE: Literal['brain.input.clarification']

computations_requested

List of computations that were requested.

TYPE: List[ComputationRequested]

computations_results

List of results for completed computations.

TYPE: List[ComputationResult]

type class-attribute instance-attribute ¤
type: Literal['brain.input.clarification'] = 'brain.input.clarification'
computations_requested class-attribute instance-attribute ¤
computations_requested: List[ComputationRequested] = []
computations_results class-attribute instance-attribute ¤
computations_results: List[ComputationResult] = []
messages instance-attribute ¤
messages: List[AnyMessage]
user_name instance-attribute ¤
user_name: str
today instance-attribute ¤
today: str

BrainOutputBase ¤

Base class for all Brain output types.

ATTRIBUTE DESCRIPTION
token_usage

Optional usage statistics for token consumption.

TYPE: Optional[TokenUsage]

token_usage instance-attribute ¤
token_usage: Optional[TokenUsage]

BrainOutputResponse ¤

Represents a Brain output containing a text-based response.

ATTRIBUTE DESCRIPTION
type

The fixed type discriminator for this output.

TYPE: Literal['brain.output.response']

message

The agent's message to the recipient.

TYPE: AgentMessage

type class-attribute instance-attribute ¤
type: Literal['brain.output.response'] = 'brain.output.response'
message instance-attribute ¤
message: AgentMessage
token_usage instance-attribute ¤
token_usage: Optional[TokenUsage]

BrainOutputResponseStructured ¤

Represents a Brain output with structured data payload.

ATTRIBUTE DESCRIPTION
type

The fixed type discriminator for this output.

TYPE: Literal['brain.output.structured']

message_id

Identifier for the message.

TYPE: str

payload

Arbitrary structured data.

TYPE: Dict[str, Any]

structure

The schema or structure name for the payload.

TYPE: str

type class-attribute instance-attribute ¤
type: Literal['brain.output.structured'] = 'brain.output.structured'
message_id instance-attribute ¤
message_id: str
payload instance-attribute ¤
payload: Dict[str, Any]
structure instance-attribute ¤
structure: str
token_usage instance-attribute ¤
token_usage: Optional[TokenUsage]

BrainOutputContribution ¤

Represents a Brain output containing a contribution message.

ATTRIBUTE DESCRIPTION
type

The fixed type discriminator for this output.

TYPE: Literal['brain.output.contribution']

message

The agent's contribution message.

TYPE: AgentMessage

type class-attribute instance-attribute ¤
type: Literal['brain.output.contribution'] = 'brain.output.contribution'
message instance-attribute ¤
message: AgentMessage
token_usage instance-attribute ¤
token_usage: Optional[TokenUsage]

BrainOutputComputationsRequired ¤

Represents a Brain output that requires computations to be performed.

ATTRIBUTE DESCRIPTION
type

The fixed type discriminator for this output.

TYPE: Literal['brain.output.computations']

computations_required

List of computations that need to be performed.

TYPE: List[ComputationRequested]

type class-attribute instance-attribute ¤
type: Literal['brain.output.computations'] = 'brain.output.computations'
computations_required instance-attribute ¤
computations_required: List[ComputationRequested]
token_usage instance-attribute ¤
token_usage: Optional[TokenUsage]

helpers ¤

MODULE DESCRIPTION
convert_action_to_computation
convert_action_to_computation_test
convert_to_tool_call
convert_to_tool_call_test
convert_to_tool_message
convert_to_tool_message_test
ensure_dict
ensure_dict_test
is_response_structured
is_response_structured_test
is_skill_available
is_skill_available_test

__all__ module-attribute ¤

__all__ = ['convert_action_to_computation', 'convert_to_tool_call', 'convert_to_tool_message', 'is_response_structured', 'is_skill_available', 'ensure_dict']

convert_action_to_computation ¤

FUNCTION DESCRIPTION
convert_action_to_computation

Converts an agent action to a computation request.

convert_action_to_computation ¤
convert_action_to_computation(action: AgentAction) -> ComputationRequested

Converts an agent action to a computation request.

PARAMETER DESCRIPTION
action ¤

The AgentAction instance to convert.

TYPE: AgentAction

RETURNS DESCRIPTION
ComputationRequested

A computation request built from the action.

TYPE: ComputationRequested

convert_action_to_computation_test ¤

FUNCTION DESCRIPTION
test_convert_action_to_computation_with_tool_agent_action_and_dict_input
test_convert_action_to_computation_with_tool_agent_action_and_non_dict_input
test_convert_action_to_computation_with_generic_agent_action_and_dict_input
test_convert_action_to_computation_with_generic_agent_action_and_non_dict_input
test_convert_action_to_computation_with_tool_agent_action_and_dict_input ¤
test_convert_action_to_computation_with_tool_agent_action_and_dict_input()
test_convert_action_to_computation_with_tool_agent_action_and_non_dict_input ¤
test_convert_action_to_computation_with_tool_agent_action_and_non_dict_input()
test_convert_action_to_computation_with_generic_agent_action_and_dict_input ¤
test_convert_action_to_computation_with_generic_agent_action_and_dict_input()
test_convert_action_to_computation_with_generic_agent_action_and_non_dict_input ¤
test_convert_action_to_computation_with_generic_agent_action_and_non_dict_input()

convert_to_tool_call ¤

FUNCTION DESCRIPTION
convert_to_tool_call

Converts a computation result to a ToolCall.

convert_to_tool_call ¤
convert_to_tool_call(value: ComputationResult) -> ToolCall

Converts a computation result to a ToolCall.

PARAMETER DESCRIPTION
value ¤

The computation result to convert.

TYPE: ComputationResult

RETURNS DESCRIPTION
ToolCall

A tool call representing the computation request.

TYPE: ToolCall

convert_to_tool_call_test ¤

CLASS DESCRIPTION
DummySkillArgs

A dummy object with a model_dump method to simulate Pydantic models.

DummyComputationResult
FUNCTION DESCRIPTION
test_convert_to_tool_call_with_basic_data
test_convert_to_tool_call_with_empty_args
test_convert_to_tool_call_with_complex_args
DummySkillArgs ¤
DummySkillArgs(data)

A dummy object with a model_dump method to simulate Pydantic models.

METHOD DESCRIPTION
model_dump
model_dump ¤
model_dump()
DummyComputationResult ¤
DummyComputationResult(name, computation_id, skill_args)
ATTRIBUTE DESCRIPTION
name

computation_id

skill_args

name instance-attribute ¤
name = name
computation_id instance-attribute ¤
computation_id = computation_id
skill_args instance-attribute ¤
skill_args = skill_args
test_convert_to_tool_call_with_basic_data ¤
test_convert_to_tool_call_with_basic_data()
test_convert_to_tool_call_with_empty_args ¤
test_convert_to_tool_call_with_empty_args()
test_convert_to_tool_call_with_complex_args ¤
test_convert_to_tool_call_with_complex_args()

convert_to_tool_message ¤

FUNCTION DESCRIPTION
convert_to_tool_message

Converts a computation result to a ToolMessage.

convert_to_tool_message ¤
convert_to_tool_message(value: ComputationResult) -> ToolMessage

Converts a computation result to a ToolMessage.

PARAMETER DESCRIPTION
value ¤

The computation result to convert.

TYPE: ComputationResult

RETURNS DESCRIPTION
ToolMessage

A tool message containing the computation result.

TYPE: ToolMessage

convert_to_tool_message_test ¤

CLASS DESCRIPTION
DummyComputationResult
FUNCTION DESCRIPTION
test_convert_to_tool_message_with_string_result
test_convert_to_tool_message_with_dict_result
test_convert_to_tool_message_with_numeric_result
DummyComputationResult ¤
DummyComputationResult(name, computation_id, result)
ATTRIBUTE DESCRIPTION
name

computation_id

result

name instance-attribute ¤
name = name
computation_id instance-attribute ¤
computation_id = computation_id
result instance-attribute ¤
result = result
test_convert_to_tool_message_with_string_result ¤
test_convert_to_tool_message_with_string_result()
test_convert_to_tool_message_with_dict_result ¤
test_convert_to_tool_message_with_dict_result()
test_convert_to_tool_message_with_numeric_result ¤
test_convert_to_tool_message_with_numeric_result()

ensure_dict ¤

FUNCTION DESCRIPTION
ensure_dict

Ensures that the given candidate is a dictionary.

ensure_dict ¤
ensure_dict(candidate: str | int | Dict[str, Any], key: str = 'input') -> Dict[str, Any]

Ensures that the given candidate is a dictionary.

If a string is provided, it will be wrapped in a dictionary under the specified key.

PARAMETER DESCRIPTION
candidate ¤

A string or dictionary to validate.

TYPE: str | int | Dict[str, Any]

key ¤

The key to use if candidate is a string.

TYPE: str DEFAULT: 'input'

RETURNS DESCRIPTION
Dict[str, Any]

Dict[str, Any]: The resulting dictionary.

ensure_dict_test ¤

FUNCTION DESCRIPTION
test_returns_dict_when_given_dict
test_wraps_string_with_default_key
test_wraps_string_with_custom_key
test_wraps_int_with_custom_key
test_empty_dict_returns_same
test_empty_string_returns_wrapped
test_returns_dict_when_given_dict ¤
test_returns_dict_when_given_dict()
test_wraps_string_with_default_key ¤
test_wraps_string_with_default_key()
test_wraps_string_with_custom_key ¤
test_wraps_string_with_custom_key()
test_wraps_int_with_custom_key ¤
test_wraps_int_with_custom_key()
test_empty_dict_returns_same ¤
test_empty_dict_returns_same()
test_empty_string_returns_wrapped ¤
test_empty_string_returns_wrapped()

is_response_structured ¤

FUNCTION DESCRIPTION
is_response_structured

Checks if a Skill with the given name is of type SkillStructuredResponse.

is_response_structured ¤
is_response_structured(name: str, skills: List[Skill])

Checks if a Skill with the given name is of type SkillStructuredResponse.

PARAMETER DESCRIPTION
name ¤

The name of the skill to check.

TYPE: str

skills ¤

A list of Skill instances.

TYPE: List[Skill]

RETURNS DESCRIPTION
bool

True if a skill with the given name exists and is of type SkillStructuredResponse, otherwise False.

is_response_structured_test ¤

CLASS DESCRIPTION
DummySkill
FakeBrainSchema
FakeResultSchema
FakeClarificationSchema
DummyStructuredSkill
FUNCTION DESCRIPTION
test_structured_skill_with_matching_name
test_name_matches_but_not_structured
test_name_does_not_match
test_empty_list
DummySkill ¤
DummySkill(name)
ATTRIBUTE DESCRIPTION
name

name instance-attribute ¤
name = name
FakeBrainSchema ¤
ATTRIBUTE DESCRIPTION
prop

TYPE: str

registry_id

TYPE: str

prop class-attribute instance-attribute ¤
prop: str = ''
registry_id cached property ¤
registry_id: str
FakeResultSchema ¤
ATTRIBUTE DESCRIPTION
response

TYPE: str

response class-attribute instance-attribute ¤
response: str = ''
FakeClarificationSchema ¤
ATTRIBUTE DESCRIPTION
prop

TYPE: str

prop class-attribute instance-attribute ¤
prop: str = ''
DummyStructuredSkill ¤
METHOD DESCRIPTION
as_tool
ATTRIBUTE DESCRIPTION
name

TYPE: str

description

TYPE: str

brain_schema

TYPE: FakeBrainSchema

type

TYPE: Literal['skill.response_structured']

name instance-attribute ¤
name: str
description class-attribute instance-attribute ¤
description: str = ''
brain_schema class-attribute instance-attribute ¤
brain_schema: FakeBrainSchema = FakeBrainSchema()
type class-attribute instance-attribute ¤
type: Literal['skill.response_structured'] = 'skill.response_structured'
as_tool ¤
as_tool() -> Dict[str, Any]
test_structured_skill_with_matching_name ¤
test_structured_skill_with_matching_name(monkeypatch)
test_name_matches_but_not_structured ¤
test_name_matches_but_not_structured(monkeypatch)
test_name_does_not_match ¤
test_name_does_not_match(monkeypatch)
test_empty_list ¤
test_empty_list(monkeypatch)

is_skill_available ¤

FUNCTION DESCRIPTION
is_skill_available

Checks if a Skill with the given name is on the list of skills availablees for brain.

is_skill_available ¤
is_skill_available(name: str, skills: List[Skill])

Checks if a Skill with the given name is on the list of skills availablees for brain.

PARAMETER DESCRIPTION
name ¤

The name of the skill to check.

TYPE: str

skills ¤

A list of Skill instances.

TYPE: List[Skill]

RETURNS DESCRIPTION
bool

True if a skill with the given name exists on the brain's list.

is_skill_available_test ¤

CLASS DESCRIPTION
DummySkill
FUNCTION DESCRIPTION
test_skill_available_when_present
test_skill_available_when_not_present
test_skill_available_with_empty_list
test_skill_available_case_sensitive
DummySkill ¤
DummySkill(name)
ATTRIBUTE DESCRIPTION
name

name instance-attribute ¤
name = name
test_skill_available_when_present ¤
test_skill_available_when_present()
test_skill_available_when_not_present ¤
test_skill_available_when_not_present()
test_skill_available_with_empty_list ¤
test_skill_available_with_empty_list()
test_skill_available_case_sensitive ¤
test_skill_available_case_sensitive()

collaborator ¤

Abstract class provides state management, graph setup, and async invocation/streaming

MODULE DESCRIPTION
collaborator_base

Base classes for collaborator components in Crewmaster.

collaborator_base_test
collaborator_input
collaborator_ouput
history_strategy
injection_exception
message
state
team_membership
types
CLASS DESCRIPTION
ClarificationContext
ClarificationRequested
CollaboratorConfig
Colleague
TokenUsage
CollaboratorInputClarification
CollaboratorInputFresh
CollaboratorOutputClarification
CollaboratorOutputContribution
CollaboratorOutputResponse
CollaboratorOutputResponseStructured
HistoryStrategyInterface
MaxMessagesStrategy
AgentMessage
ClarificationMessage
ClarificationSimpleMessage
ToolTimedMessage
UserMessage
TeamMembership
CollaboratorBase

Abstract base class for all collaborator components.

CollaboratorState
InjectionException
ATTRIBUTE DESCRIPTION
CollaboratorInput

CollaboratorOutput

AnyMessage

PublicMessage

FreshMessage

CollaboratorInput module-attribute ¤

AnyMessage module-attribute ¤

AnyMessage = Union[ClarificationMessage, UserMessage, AgentMessage, ToolMessage]

PublicMessage module-attribute ¤

PublicMessage = Union[UserMessage, AgentMessage]

FreshMessage module-attribute ¤

__all__ module-attribute ¤

__all__ = ['AgentMessage', 'AnyMessage', 'ClarificationContext', 'ClarificationMessage', 'ClarificationRequested', 'ClarificationSimpleMessage', 'CollaboratorBase', 'CollaboratorConfig', 'CollaboratorInput', 'CollaboratorInputClarification', 'CollaboratorInputFresh', 'CollaboratorOutput', 'CollaboratorOutputClarification', 'CollaboratorOutputContribution', 'CollaboratorOutputResponse', 'CollaboratorOutputResponseStructured', 'CollaboratorState', 'Colleague', 'FreshMessage', 'HistoryStrategyInterface', 'InjectionException', 'MaxMessagesStrategy', 'PublicMessage', 'TeamMembership', 'TokenUsage', 'ToolTimedMessage', 'UserMessage']

ClarificationContext ¤

METHOD DESCRIPTION
is_lc_serializable
get_lc_namespace
ATTRIBUTE DESCRIPTION
computations_requested

TYPE: List[SerializeAsAny[ComputationRequested]]

computations_results

TYPE: List[ComputationResult]

requested_by

TYPE: str

lc_attributes

TYPE: Dict

computations_requested instance-attribute ¤

computations_requested: List[SerializeAsAny[ComputationRequested]]

computations_results instance-attribute ¤

computations_results: List[ComputationResult]

requested_by instance-attribute ¤

requested_by: str

lc_attributes property ¤

lc_attributes: Dict

is_lc_serializable classmethod ¤

is_lc_serializable() -> bool

get_lc_namespace classmethod ¤

get_lc_namespace() -> List[str]

ClarificationRequested ¤

METHOD DESCRIPTION
is_lc_serializable
get_lc_namespace
ATTRIBUTE DESCRIPTION
name

TYPE: str

clarification_id

TYPE: str

brain_args

TYPE: Dict[str, Any]

lc_attributes

TYPE: Dict

name instance-attribute ¤

name: str

clarification_id instance-attribute ¤

clarification_id: str

brain_args instance-attribute ¤

brain_args: Dict[str, Any]

lc_attributes property ¤

lc_attributes: Dict

is_lc_serializable classmethod ¤

is_lc_serializable() -> bool

get_lc_namespace classmethod ¤

get_lc_namespace() -> List[str]

CollaboratorConfig ¤

ATTRIBUTE DESCRIPTION
llm_srv

TYPE: BaseChatModel

use_cases_srv

TYPE: Any

user_name

TYPE: str

today

TYPE: str

llm_srv instance-attribute ¤

llm_srv: BaseChatModel

use_cases_srv instance-attribute ¤

use_cases_srv: Any

user_name class-attribute instance-attribute ¤

user_name: str = Field(...)

today instance-attribute ¤

today: str

Colleague ¤

ATTRIBUTE DESCRIPTION
name

TYPE: str

job_description

TYPE: str

name instance-attribute ¤

name: str

job_description instance-attribute ¤

job_description: str

TokenUsage ¤

ATTRIBUTE DESCRIPTION
input_tokens

TYPE: int

output_tokens

TYPE: int

total_tokens

TYPE: int

input_tokens instance-attribute ¤

input_tokens: int

output_tokens instance-attribute ¤

output_tokens: int

total_tokens instance-attribute ¤

total_tokens: int

CollaboratorInputClarification ¤

ATTRIBUTE DESCRIPTION
public_messages

TYPE: List[PublicMessage]

private_messages

TYPE: List[AgentMessage]

type

TYPE: Literal['input.clarification']

clarification_message

TYPE: ClarificationMessage

public_messages class-attribute instance-attribute ¤

public_messages: List[PublicMessage] = []

private_messages class-attribute instance-attribute ¤

private_messages: List[AgentMessage] = []

type class-attribute instance-attribute ¤

type: Literal['input.clarification'] = 'input.clarification'

clarification_message instance-attribute ¤

clarification_message: ClarificationMessage

CollaboratorInputFresh ¤

ATTRIBUTE DESCRIPTION
public_messages

TYPE: List[PublicMessage]

private_messages

TYPE: List[AgentMessage]

type

TYPE: Literal['input.fresh']

message

TYPE: UserMessage

public_messages class-attribute instance-attribute ¤

public_messages: List[PublicMessage] = []

private_messages class-attribute instance-attribute ¤

private_messages: List[AgentMessage] = []

type class-attribute instance-attribute ¤

type: Literal['input.fresh'] = 'input.fresh'

message instance-attribute ¤

message: UserMessage

CollaboratorOutputClarification ¤

ATTRIBUTE DESCRIPTION
type

TYPE: Literal['output.clarification']

clarification_context

TYPE: ClarificationContext

clarification_requested

TYPE: ClarificationRequested

type class-attribute instance-attribute ¤

type: Literal['output.clarification'] = 'output.clarification'

clarification_context instance-attribute ¤

clarification_context: ClarificationContext

clarification_requested instance-attribute ¤

clarification_requested: ClarificationRequested

CollaboratorOutputContribution ¤

ATTRIBUTE DESCRIPTION
type

TYPE: Literal['output.contribution']

contribution

TYPE: AgentMessage

type class-attribute instance-attribute ¤

type: Literal['output.contribution'] = 'output.contribution'

contribution instance-attribute ¤

contribution: AgentMessage

CollaboratorOutputResponse ¤

ATTRIBUTE DESCRIPTION
type

TYPE: Literal['output.response']

message

TYPE: AgentMessage

type class-attribute instance-attribute ¤

type: Literal['output.response'] = 'output.response'

message instance-attribute ¤

message: AgentMessage

CollaboratorOutputResponseStructured ¤

ATTRIBUTE DESCRIPTION
type

TYPE: Literal['output.response_structured']

payload

TYPE: Dict[str, Any]

structure

TYPE: str

message

TYPE: AgentMessage

type class-attribute instance-attribute ¤

type: Literal['output.response_structured'] = 'output.response_structured'

payload instance-attribute ¤

payload: Dict[str, Any]

structure instance-attribute ¤

structure: str

message instance-attribute ¤

message: AgentMessage

HistoryStrategyInterface ¤

METHOD DESCRIPTION
execute

execute abstractmethod ¤

execute(messages: List[AnyMessage]) -> List[AnyMessage]

MaxMessagesStrategy ¤

METHOD DESCRIPTION
execute
ATTRIBUTE DESCRIPTION
max_number

TYPE: int

max_number class-attribute instance-attribute ¤

max_number: int = 10

execute ¤

execute(messages: List[AnyMessage]) -> List[AnyMessage]

AgentMessage ¤

METHOD DESCRIPTION
is_lc_serializable
get_lc_namespace
ATTRIBUTE DESCRIPTION
author

TYPE: str

to

TYPE: str

id

TYPE: str

timestamp

TYPE: str

lc_attributes

TYPE: Dict

author instance-attribute ¤

author: str

to instance-attribute ¤

to: str

id class-attribute instance-attribute ¤

id: str = Field(default_factory=lambda: str(uuid4()))

timestamp class-attribute instance-attribute ¤

timestamp: str = Field(default_factory=isoformat)

lc_attributes property ¤

lc_attributes: Dict

is_lc_serializable classmethod ¤

is_lc_serializable() -> bool

get_lc_namespace classmethod ¤

get_lc_namespace() -> List[str]

ClarificationMessage ¤

METHOD DESCRIPTION
is_lc_serializable
get_lc_namespace
ATTRIBUTE DESCRIPTION
to

TYPE: str

lc_attributes

TYPE: Dict

timestamp

TYPE: str

subtype

TYPE: Literal['clarification_message']

content

TYPE: Union[str, List[Union[str, Dict]]]

payload

TYPE: Dict[str, Any]

computation_id

TYPE: str

name

TYPE: str

clarification_context

TYPE: ClarificationContext

to instance-attribute ¤

to: str

lc_attributes property ¤

lc_attributes: Dict

timestamp instance-attribute ¤

timestamp: str

subtype class-attribute instance-attribute ¤

subtype: Literal['clarification_message'] = 'clarification_message'

content class-attribute instance-attribute ¤

content: Union[str, List[Union[str, Dict]]] = ''

payload instance-attribute ¤

payload: Dict[str, Any]

computation_id instance-attribute ¤

computation_id: str

name class-attribute instance-attribute ¤

name: str = 'ClarificationMessage'

clarification_context instance-attribute ¤

clarification_context: ClarificationContext

is_lc_serializable classmethod ¤

is_lc_serializable() -> bool

get_lc_namespace classmethod ¤

get_lc_namespace() -> List[str]

ClarificationSimpleMessage ¤

METHOD DESCRIPTION
is_lc_serializable
get_lc_namespace
ATTRIBUTE DESCRIPTION
timestamp

TYPE: str

lc_attributes

TYPE: Dict

subtype

TYPE: Literal['clarification_message']

name

TYPE: str

content

TYPE: Union[str, List[Union[str, Dict]]]

payload

TYPE: Dict[str, Any]

computation_id

TYPE: str

timestamp instance-attribute ¤

timestamp: str

lc_attributes property ¤

lc_attributes: Dict

subtype class-attribute instance-attribute ¤

subtype: Literal['clarification_message'] = 'clarification_message'

name class-attribute instance-attribute ¤

name: str = 'ClarificationSimpleMessage'

content class-attribute instance-attribute ¤

content: Union[str, List[Union[str, Dict]]] = ''

payload instance-attribute ¤

payload: Dict[str, Any]

computation_id instance-attribute ¤

computation_id: str

is_lc_serializable classmethod ¤

is_lc_serializable() -> bool

get_lc_namespace classmethod ¤

get_lc_namespace() -> List[str]

ToolTimedMessage ¤

METHOD DESCRIPTION
is_lc_serializable
get_lc_namespace
ATTRIBUTE DESCRIPTION
timestamp

TYPE: str

id

TYPE: str

lc_attributes

TYPE: Dict

timestamp class-attribute instance-attribute ¤

timestamp: str = Field(default_factory=isoformat)

id class-attribute instance-attribute ¤

id: str = Field(default_factory=lambda: str(uuid4()))

lc_attributes property ¤

lc_attributes: Dict

is_lc_serializable classmethod ¤

is_lc_serializable() -> bool

get_lc_namespace classmethod ¤

get_lc_namespace() -> List[str]

UserMessage ¤

METHOD DESCRIPTION
is_lc_serializable
get_lc_namespace
ATTRIBUTE DESCRIPTION
timestamp

TYPE: str

subtype

TYPE: Literal['user_message']

name

TYPE: str

lc_attributes

TYPE: Dict

timestamp instance-attribute ¤

timestamp: str

subtype class-attribute instance-attribute ¤

subtype: Literal['user_message'] = 'user_message'

name class-attribute instance-attribute ¤

name: str = 'UserMessage'

lc_attributes property ¤

lc_attributes: Dict

is_lc_serializable classmethod ¤

is_lc_serializable() -> bool

get_lc_namespace classmethod ¤

get_lc_namespace() -> List[str]

TeamMembership ¤

ATTRIBUTE DESCRIPTION
name

TYPE: str

members

TYPE: List[Colleague]

instructions

TYPE: str

collaboration_tools

TYPE: List[Skill]

name instance-attribute ¤

name: str

members class-attribute instance-attribute ¤

members: List[Colleague] = Field(...)

instructions instance-attribute ¤

instructions: str

collaboration_tools class-attribute instance-attribute ¤

collaboration_tools: List[Skill] = []

CollaboratorBase ¤

Abstract base class for all collaborator components.

This class provides a foundational structure for any collaborator in the Crewmaster system. Collaborators are runnable units that can be part of a team and handle specific jobs.

ATTRIBUTE DESCRIPTION
job_description

A description of the collaborator's responsibility.

TYPE: str

METHOD DESCRIPTION
astream
ainvoke
join_team

Abstract method to make the collaborator join a team.

invoke

Invokes the collaborator.

async_invoke_config_parsed

Asynchronously invokes the collaborator with a parsed configuration.

astream_config_parsed

Asynchronously streams the output of the collaborator.

job_description instance-attribute ¤

job_description: str

Responsabilidad del colaborador

config_specs property ¤

config_specs: List[ConfigurableFieldSpec]

Required fields in the configuration for this runnable.

RETURNS DESCRIPTION
list

A list of ConfigurableFieldSpec objects.

astream async ¤

astream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) -> AsyncIterator[Output]

ainvoke async ¤

ainvoke(input: Input, config: Optional[RunnableConfig] = None) -> Output

join_team abstractmethod ¤

Abstract method to make the collaborator join a team.

PARAMETER DESCRIPTION
team_membership ¤

The team membership details to join.

TYPE: TeamMembership

invoke ¤

invoke(input: CollaboratorInput, config: RunnableConfig | None = None) -> CollaboratorOutput

Invokes the collaborator.

RAISES DESCRIPTION
Exception

Collaborator can only be called asynchronously.

async_invoke_config_parsed async ¤

async_invoke_config_parsed(input: CollaboratorInput, config_parsed: BaseModel, config_raw: RunnableConfig) -> CollaboratorOutput

Asynchronously invokes the collaborator with a parsed configuration.

PARAMETER DESCRIPTION
input ¤

The input data for the collaborator.

TYPE: CollaboratorInput

config_parsed ¤

The parsed configuration.

TYPE: BaseModel

config_raw ¤

The raw runnable configuration.

TYPE: RunnableConfig

RETURNS DESCRIPTION
CollaboratorOutput

The output of the collaborator.

TYPE: CollaboratorOutput

astream_config_parsed async ¤

astream_config_parsed(input: CollaboratorInput, config_parsed: BaseModel, config_raw: RunnableConfig, run_manager: CallbackManagerForChainRun, **kwargs: Optional[Any]) -> AsyncIterator[Dict[str, Any]]

Asynchronously streams the output of the collaborator.

PARAMETER DESCRIPTION
input ¤

The input data for the collaborator.

TYPE: CollaboratorInput

config_parsed ¤

The parsed configuration.

TYPE: BaseModel

config_raw ¤

The raw runnable configuration.

TYPE: RunnableConfig

run_manager ¤

The run manager.

TYPE: CallbackManagerForChainRun

**kwargs ¤

Optional keyword arguments.

TYPE: Optional[Any] DEFAULT: {}

YIELDS DESCRIPTION
dict

The chunks of the output.

CollaboratorState ¤

ATTRIBUTE DESCRIPTION
public_messages

TYPE: List[PublicMessage]

private_messages

TYPE: List[AgentMessage]

fresh_message

TYPE: FreshMessage

output

TYPE: Optional[CollaboratorOutput]

computations_requested

TYPE: List[ComputationRequested]

computations_results

TYPE: List[ComputationResult]

next_step

TYPE: str

public_messages class-attribute instance-attribute ¤

public_messages: List[PublicMessage] = []

private_messages class-attribute instance-attribute ¤

private_messages: List[AgentMessage] = []

fresh_message instance-attribute ¤

fresh_message: FreshMessage

output class-attribute instance-attribute ¤

output: Optional[CollaboratorOutput] = None

computations_requested class-attribute instance-attribute ¤

computations_requested: List[ComputationRequested] = []

computations_results class-attribute instance-attribute ¤

computations_results: List[ComputationResult] = []

next_step class-attribute instance-attribute ¤

next_step: str = ''

InjectionException ¤

InjectionException(dependency: str)

collaborator_base ¤

Base classes for collaborator components in Crewmaster.

This module defines the foundational classes for creating and managing a "collaborator" within a crew. It provides an abstract base class CollaboratorBase that handles state management, graph setup, and async invocation/streaming.

CLASS DESCRIPTION
CollaboratorBase

Abstract base class for all collaborator components.

ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤

log = get_logger()

Loger para el módulo

CollaboratorBase ¤

Abstract base class for all collaborator components.

This class provides a foundational structure for any collaborator in the Crewmaster system. Collaborators are runnable units that can be part of a team and handle specific jobs.

ATTRIBUTE DESCRIPTION
job_description

A description of the collaborator's responsibility.

TYPE: str

METHOD DESCRIPTION
join_team

Abstract method to make the collaborator join a team.

invoke

Invokes the collaborator.

async_invoke_config_parsed

Asynchronously invokes the collaborator with a parsed configuration.

astream_config_parsed

Asynchronously streams the output of the collaborator.

astream
ainvoke
job_description instance-attribute ¤
job_description: str

Responsabilidad del colaborador

config_specs property ¤
config_specs: List[ConfigurableFieldSpec]

Required fields in the configuration for this runnable.

RETURNS DESCRIPTION
list

A list of ConfigurableFieldSpec objects.

join_team abstractmethod ¤

Abstract method to make the collaborator join a team.

PARAMETER DESCRIPTION
team_membership ¤

The team membership details to join.

TYPE: TeamMembership

invoke ¤
invoke(input: CollaboratorInput, config: RunnableConfig | None = None) -> CollaboratorOutput

Invokes the collaborator.

RAISES DESCRIPTION
Exception

Collaborator can only be called asynchronously.

async_invoke_config_parsed async ¤
async_invoke_config_parsed(input: CollaboratorInput, config_parsed: BaseModel, config_raw: RunnableConfig) -> CollaboratorOutput

Asynchronously invokes the collaborator with a parsed configuration.

PARAMETER DESCRIPTION
input ¤

The input data for the collaborator.

TYPE: CollaboratorInput

config_parsed ¤

The parsed configuration.

TYPE: BaseModel

config_raw ¤

The raw runnable configuration.

TYPE: RunnableConfig

RETURNS DESCRIPTION
CollaboratorOutput

The output of the collaborator.

TYPE: CollaboratorOutput

astream_config_parsed async ¤
astream_config_parsed(input: CollaboratorInput, config_parsed: BaseModel, config_raw: RunnableConfig, run_manager: CallbackManagerForChainRun, **kwargs: Optional[Any]) -> AsyncIterator[Dict[str, Any]]

Asynchronously streams the output of the collaborator.

PARAMETER DESCRIPTION
input ¤

The input data for the collaborator.

TYPE: CollaboratorInput

config_parsed ¤

The parsed configuration.

TYPE: BaseModel

config_raw ¤

The raw runnable configuration.

TYPE: RunnableConfig

run_manager ¤

The run manager.

TYPE: CallbackManagerForChainRun

**kwargs ¤

Optional keyword arguments.

TYPE: Optional[Any] DEFAULT: {}

YIELDS DESCRIPTION
dict

The chunks of the output.

astream async ¤
astream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) -> AsyncIterator[Output]
ainvoke async ¤
ainvoke(input: Input, config: Optional[RunnableConfig] = None) -> Output

collaborator_base_test ¤

CLASS DESCRIPTION
CollabFake
FUNCTION DESCRIPTION
use_cases_srv

Fixture para proveer el falso llm_srv

config_fake_llm
test_hello
test_stream_hello
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤

log = get_logger()

Loger para el módulo

CollabFake ¤

METHOD DESCRIPTION
join_team
astream_config_parsed

Asynchronously streams the output of the collaborator.

astream
async_invoke_config_parsed

Asynchronously invokes the collaborator with a parsed configuration.

ainvoke
invoke

Invokes the collaborator.

ATTRIBUTE DESCRIPTION
name

TYPE: str

job_description

TYPE: str

config_specs

Required fields in the configuration for this runnable.

TYPE: List[ConfigurableFieldSpec]

name class-attribute instance-attribute ¤
name: str = 'raul_collaborator'
job_description class-attribute instance-attribute ¤
job_description: str = 'Probar que todo esté bien'
config_specs property ¤
config_specs: List[ConfigurableFieldSpec]

Required fields in the configuration for this runnable.

RETURNS DESCRIPTION
list

A list of ConfigurableFieldSpec objects.

join_team ¤
join_team(team_membership: TeamMembership)
astream_config_parsed async ¤
astream_config_parsed(input: CollaboratorInput, config_parsed: BaseModel, config_raw: RunnableConfig, run_manager: CallbackManagerForChainRun, **kwargs: Optional[Any]) -> AsyncIterator[Dict[str, Any]]

Asynchronously streams the output of the collaborator.

PARAMETER DESCRIPTION
input ¤

The input data for the collaborator.

TYPE: CollaboratorInput

config_parsed ¤

The parsed configuration.

TYPE: BaseModel

config_raw ¤

The raw runnable configuration.

TYPE: RunnableConfig

run_manager ¤

The run manager.

TYPE: CallbackManagerForChainRun

**kwargs ¤

Optional keyword arguments.

TYPE: Optional[Any] DEFAULT: {}

YIELDS DESCRIPTION
dict

The chunks of the output.

astream async ¤
astream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) -> AsyncIterator[Output]
async_invoke_config_parsed async ¤
async_invoke_config_parsed(input: CollaboratorInput, config_parsed: BaseModel, config_raw: RunnableConfig) -> CollaboratorOutput

Asynchronously invokes the collaborator with a parsed configuration.

PARAMETER DESCRIPTION
input ¤

The input data for the collaborator.

TYPE: CollaboratorInput

config_parsed ¤

The parsed configuration.

TYPE: BaseModel

config_raw ¤

The raw runnable configuration.

TYPE: RunnableConfig

RETURNS DESCRIPTION
CollaboratorOutput

The output of the collaborator.

TYPE: CollaboratorOutput

ainvoke async ¤
ainvoke(input: Input, config: Optional[RunnableConfig] = None) -> Output
invoke ¤
invoke(input: CollaboratorInput, config: RunnableConfig | None = None) -> CollaboratorOutput

Invokes the collaborator.

RAISES DESCRIPTION
Exception

Collaborator can only be called asynchronously.

use_cases_srv ¤

use_cases_srv()

Fixture para proveer el falso llm_srv

config_fake_llm ¤

config_fake_llm(use_cases_srv, user_name: str = 'Pedrito')

test_hello async ¤

test_hello(config_fake_llm)

test_stream_hello async ¤

test_stream_hello(config_fake_llm)

collaborator_input ¤

CLASS DESCRIPTION
CollaboratorInputBase
CollaboratorInputFresh
CollaboratorInputClarification
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

CollaboratorInput

CollaboratorInputAdapter

TYPE: TypeAdapter[CollaboratorInput]

log module-attribute ¤

log = get_logger()

Loger para el módulo

CollaboratorInput module-attribute ¤

CollaboratorInputAdapter module-attribute ¤

CollaboratorInputAdapter: TypeAdapter[CollaboratorInput] = TypeAdapter(CollaboratorInput)

CollaboratorInputBase ¤

ATTRIBUTE DESCRIPTION
public_messages

TYPE: List[PublicMessage]

private_messages

TYPE: List[AgentMessage]

public_messages class-attribute instance-attribute ¤
public_messages: List[PublicMessage] = []
private_messages class-attribute instance-attribute ¤
private_messages: List[AgentMessage] = []

CollaboratorInputFresh ¤

ATTRIBUTE DESCRIPTION
type

TYPE: Literal['input.fresh']

message

TYPE: UserMessage

public_messages

TYPE: List[PublicMessage]

private_messages

TYPE: List[AgentMessage]

type class-attribute instance-attribute ¤
type: Literal['input.fresh'] = 'input.fresh'
message instance-attribute ¤
message: UserMessage
public_messages class-attribute instance-attribute ¤
public_messages: List[PublicMessage] = []
private_messages class-attribute instance-attribute ¤
private_messages: List[AgentMessage] = []

CollaboratorInputClarification ¤

ATTRIBUTE DESCRIPTION
type

TYPE: Literal['input.clarification']

clarification_message

TYPE: ClarificationMessage

public_messages

TYPE: List[PublicMessage]

private_messages

TYPE: List[AgentMessage]

type class-attribute instance-attribute ¤
type: Literal['input.clarification'] = 'input.clarification'
clarification_message instance-attribute ¤
clarification_message: ClarificationMessage
public_messages class-attribute instance-attribute ¤
public_messages: List[PublicMessage] = []
private_messages class-attribute instance-attribute ¤
private_messages: List[AgentMessage] = []

collaborator_ouput ¤

CLASS DESCRIPTION
CollaboratorOutputBase
CollaboratorOutputClarification
CollaboratorOutputResponse
CollaboratorOutputResponseStructured
CollaboratorOutputContribution
CollaboratorConfig
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

CollaboratorOutput

CollaboratorOutputAdapter

TYPE: TypeAdapter[CollaboratorOutput]

log module-attribute ¤

log = get_logger()

Loger para el módulo

CollaboratorOutputAdapter module-attribute ¤

CollaboratorOutputAdapter: TypeAdapter[CollaboratorOutput] = TypeAdapter(CollaboratorOutput)

CollaboratorOutputBase ¤

CollaboratorOutputClarification ¤

ATTRIBUTE DESCRIPTION
type

TYPE: Literal['output.clarification']

clarification_context

TYPE: ClarificationContext

clarification_requested

TYPE: ClarificationRequested

type class-attribute instance-attribute ¤
type: Literal['output.clarification'] = 'output.clarification'
clarification_context instance-attribute ¤
clarification_context: ClarificationContext
clarification_requested instance-attribute ¤
clarification_requested: ClarificationRequested

CollaboratorOutputResponse ¤

ATTRIBUTE DESCRIPTION
type

TYPE: Literal['output.response']

message

TYPE: AgentMessage

type class-attribute instance-attribute ¤
type: Literal['output.response'] = 'output.response'
message instance-attribute ¤
message: AgentMessage

CollaboratorOutputResponseStructured ¤

ATTRIBUTE DESCRIPTION
type

TYPE: Literal['output.response_structured']

payload

TYPE: Dict[str, Any]

structure

TYPE: str

message

TYPE: AgentMessage

type class-attribute instance-attribute ¤
type: Literal['output.response_structured'] = 'output.response_structured'
payload instance-attribute ¤
payload: Dict[str, Any]
structure instance-attribute ¤
structure: str
message instance-attribute ¤
message: AgentMessage

CollaboratorOutputContribution ¤

ATTRIBUTE DESCRIPTION
type

TYPE: Literal['output.contribution']

contribution

TYPE: AgentMessage

type class-attribute instance-attribute ¤
type: Literal['output.contribution'] = 'output.contribution'
contribution instance-attribute ¤
contribution: AgentMessage

CollaboratorConfig ¤

ATTRIBUTE DESCRIPTION
llm_srv

TYPE: BaseChatModel

use_cases_srv

TYPE: Any

user_name

TYPE: str

today

TYPE: str

llm_srv instance-attribute ¤
llm_srv: BaseChatModel
use_cases_srv instance-attribute ¤
use_cases_srv: Any
user_name class-attribute instance-attribute ¤
user_name: str = Field(...)
today instance-attribute ¤
today: str

history_strategy ¤

CLASS DESCRIPTION
HistoryStrategyInterface
MaxMessagesStrategy

HistoryStrategyInterface ¤

METHOD DESCRIPTION
execute
execute abstractmethod ¤
execute(messages: List[AnyMessage]) -> List[AnyMessage]

MaxMessagesStrategy ¤

METHOD DESCRIPTION
execute
ATTRIBUTE DESCRIPTION
max_number

TYPE: int

max_number class-attribute instance-attribute ¤
max_number: int = 10
execute ¤
execute(messages: List[AnyMessage]) -> List[AnyMessage]

injection_exception ¤

CLASS DESCRIPTION
InjectionException

InjectionException ¤

InjectionException(dependency: str)

message ¤

CLASS DESCRIPTION
Timed
WithRecipient
WithAuthor
UserMessage
ClarificationSimpleMessage
ClarificationMessage
AgentMessage
ToolTimedMessage
ATTRIBUTE DESCRIPTION
FreshMessage

PublicMessage

PrivateMessage

AnyMessage

FreshMessage module-attribute ¤

PublicMessage module-attribute ¤

PublicMessage = Union[UserMessage, AgentMessage]

PrivateMessage module-attribute ¤

PrivateMessage = Union[AgentMessage, ToolMessage]

AnyMessage module-attribute ¤

AnyMessage = Union[ClarificationMessage, UserMessage, AgentMessage, ToolMessage]

Timed ¤

METHOD DESCRIPTION
is_lc_serializable
get_lc_namespace
ATTRIBUTE DESCRIPTION
timestamp

TYPE: str

lc_attributes

TYPE: Dict

timestamp instance-attribute ¤
timestamp: str
lc_attributes property ¤
lc_attributes: Dict
is_lc_serializable classmethod ¤
is_lc_serializable() -> bool
get_lc_namespace classmethod ¤
get_lc_namespace() -> List[str]

WithRecipient ¤

METHOD DESCRIPTION
is_lc_serializable
get_lc_namespace
ATTRIBUTE DESCRIPTION
to

TYPE: str

lc_attributes

TYPE: Dict

to instance-attribute ¤
to: str
lc_attributes property ¤
lc_attributes: Dict
is_lc_serializable classmethod ¤
is_lc_serializable() -> bool
get_lc_namespace classmethod ¤
get_lc_namespace() -> List[str]

WithAuthor ¤

METHOD DESCRIPTION
is_lc_serializable
get_lc_namespace
ATTRIBUTE DESCRIPTION
author

TYPE: str

lc_attributes

TYPE: Dict

author instance-attribute ¤
author: str
lc_attributes property ¤
lc_attributes: Dict
is_lc_serializable classmethod ¤
is_lc_serializable() -> bool
get_lc_namespace classmethod ¤
get_lc_namespace() -> List[str]

UserMessage ¤

METHOD DESCRIPTION
is_lc_serializable
get_lc_namespace
ATTRIBUTE DESCRIPTION
subtype

TYPE: Literal['user_message']

name

TYPE: str

lc_attributes

TYPE: Dict

timestamp

TYPE: str

subtype class-attribute instance-attribute ¤
subtype: Literal['user_message'] = 'user_message'
name class-attribute instance-attribute ¤
name: str = 'UserMessage'
lc_attributes property ¤
lc_attributes: Dict
timestamp instance-attribute ¤
timestamp: str
is_lc_serializable classmethod ¤
is_lc_serializable() -> bool
get_lc_namespace classmethod ¤
get_lc_namespace() -> List[str]

ClarificationSimpleMessage ¤

METHOD DESCRIPTION
is_lc_serializable
get_lc_namespace
ATTRIBUTE DESCRIPTION
subtype

TYPE: Literal['clarification_message']

name

TYPE: str

content

TYPE: Union[str, List[Union[str, Dict]]]

payload

TYPE: Dict[str, Any]

computation_id

TYPE: str

timestamp

TYPE: str

lc_attributes

TYPE: Dict

subtype class-attribute instance-attribute ¤
subtype: Literal['clarification_message'] = 'clarification_message'
name class-attribute instance-attribute ¤
name: str = 'ClarificationSimpleMessage'
content class-attribute instance-attribute ¤
content: Union[str, List[Union[str, Dict]]] = ''
payload instance-attribute ¤
payload: Dict[str, Any]
computation_id instance-attribute ¤
computation_id: str
timestamp instance-attribute ¤
timestamp: str
lc_attributes property ¤
lc_attributes: Dict
is_lc_serializable classmethod ¤
is_lc_serializable() -> bool
get_lc_namespace classmethod ¤
get_lc_namespace() -> List[str]

ClarificationMessage ¤

METHOD DESCRIPTION
is_lc_serializable
get_lc_namespace
ATTRIBUTE DESCRIPTION
name

TYPE: str

clarification_context

TYPE: ClarificationContext

to

TYPE: str

lc_attributes

TYPE: Dict

timestamp

TYPE: str

subtype

TYPE: Literal['clarification_message']

content

TYPE: Union[str, List[Union[str, Dict]]]

payload

TYPE: Dict[str, Any]

computation_id

TYPE: str

name class-attribute instance-attribute ¤
name: str = 'ClarificationMessage'
clarification_context instance-attribute ¤
clarification_context: ClarificationContext
to instance-attribute ¤
to: str
lc_attributes property ¤
lc_attributes: Dict
timestamp instance-attribute ¤
timestamp: str
subtype class-attribute instance-attribute ¤
subtype: Literal['clarification_message'] = 'clarification_message'
content class-attribute instance-attribute ¤
content: Union[str, List[Union[str, Dict]]] = ''
payload instance-attribute ¤
payload: Dict[str, Any]
computation_id instance-attribute ¤
computation_id: str
is_lc_serializable classmethod ¤
is_lc_serializable() -> bool
get_lc_namespace classmethod ¤
get_lc_namespace() -> List[str]

AgentMessage ¤

METHOD DESCRIPTION
is_lc_serializable
get_lc_namespace
ATTRIBUTE DESCRIPTION
id

TYPE: str

timestamp

TYPE: str

lc_attributes

TYPE: Dict

author

TYPE: str

to

TYPE: str

id class-attribute instance-attribute ¤
id: str = Field(default_factory=lambda: str(uuid4()))
timestamp class-attribute instance-attribute ¤
timestamp: str = Field(default_factory=isoformat)
lc_attributes property ¤
lc_attributes: Dict
author instance-attribute ¤
author: str
to instance-attribute ¤
to: str
is_lc_serializable classmethod ¤
is_lc_serializable() -> bool
get_lc_namespace classmethod ¤
get_lc_namespace() -> List[str]

ToolTimedMessage ¤

METHOD DESCRIPTION
is_lc_serializable
get_lc_namespace
ATTRIBUTE DESCRIPTION
timestamp

TYPE: str

id

TYPE: str

lc_attributes

TYPE: Dict

timestamp class-attribute instance-attribute ¤
timestamp: str = Field(default_factory=isoformat)
id class-attribute instance-attribute ¤
id: str = Field(default_factory=lambda: str(uuid4()))
lc_attributes property ¤
lc_attributes: Dict
is_lc_serializable classmethod ¤
is_lc_serializable() -> bool
get_lc_namespace classmethod ¤
get_lc_namespace() -> List[str]

state ¤

CLASS DESCRIPTION
CollaboratorState
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤

log = get_logger()

Loger para el módulo

CollaboratorState ¤

ATTRIBUTE DESCRIPTION
public_messages

TYPE: List[PublicMessage]

private_messages

TYPE: List[AgentMessage]

fresh_message

TYPE: FreshMessage

output

TYPE: Optional[CollaboratorOutput]

computations_requested

TYPE: List[ComputationRequested]

computations_results

TYPE: List[ComputationResult]

next_step

TYPE: str

public_messages class-attribute instance-attribute ¤
public_messages: List[PublicMessage] = []
private_messages class-attribute instance-attribute ¤
private_messages: List[AgentMessage] = []
fresh_message instance-attribute ¤
fresh_message: FreshMessage
output class-attribute instance-attribute ¤
output: Optional[CollaboratorOutput] = None
computations_requested class-attribute instance-attribute ¤
computations_requested: List[ComputationRequested] = []
computations_results class-attribute instance-attribute ¤
computations_results: List[ComputationResult] = []
next_step class-attribute instance-attribute ¤
next_step: str = ''

team_membership ¤

CLASS DESCRIPTION
TeamMembership
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤

log = get_logger()

Loger para el módulo

TeamMembership ¤

ATTRIBUTE DESCRIPTION
name

TYPE: str

members

TYPE: List[Colleague]

instructions

TYPE: str

collaboration_tools

TYPE: List[Skill]

name instance-attribute ¤
name: str
members class-attribute instance-attribute ¤
members: List[Colleague] = Field(...)
instructions instance-attribute ¤
instructions: str
collaboration_tools class-attribute instance-attribute ¤
collaboration_tools: List[Skill] = []

types ¤

CLASS DESCRIPTION
ClarificationContext
ClarificationRequested
CollaboratorConfig
Colleague
TokenUsage
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤

log = get_logger()

Loger para el módulo

ClarificationContext ¤

METHOD DESCRIPTION
is_lc_serializable
get_lc_namespace
ATTRIBUTE DESCRIPTION
computations_requested

TYPE: List[SerializeAsAny[ComputationRequested]]

computations_results

TYPE: List[ComputationResult]

requested_by

TYPE: str

lc_attributes

TYPE: Dict

computations_requested instance-attribute ¤
computations_requested: List[SerializeAsAny[ComputationRequested]]
computations_results instance-attribute ¤
computations_results: List[ComputationResult]
requested_by instance-attribute ¤
requested_by: str
lc_attributes property ¤
lc_attributes: Dict
is_lc_serializable classmethod ¤
is_lc_serializable() -> bool
get_lc_namespace classmethod ¤
get_lc_namespace() -> List[str]

ClarificationRequested ¤

METHOD DESCRIPTION
is_lc_serializable
get_lc_namespace
ATTRIBUTE DESCRIPTION
name

TYPE: str

clarification_id

TYPE: str

brain_args

TYPE: Dict[str, Any]

lc_attributes

TYPE: Dict

name instance-attribute ¤
name: str
clarification_id instance-attribute ¤
clarification_id: str
brain_args instance-attribute ¤
brain_args: Dict[str, Any]
lc_attributes property ¤
lc_attributes: Dict
is_lc_serializable classmethod ¤
is_lc_serializable() -> bool
get_lc_namespace classmethod ¤
get_lc_namespace() -> List[str]

CollaboratorConfig ¤

ATTRIBUTE DESCRIPTION
llm_srv

TYPE: BaseChatModel

use_cases_srv

TYPE: Any

user_name

TYPE: str

today

TYPE: str

llm_srv instance-attribute ¤
llm_srv: BaseChatModel
use_cases_srv instance-attribute ¤
use_cases_srv: Any
user_name class-attribute instance-attribute ¤
user_name: str = Field(...)
today instance-attribute ¤
today: str

Colleague ¤

ATTRIBUTE DESCRIPTION
name

TYPE: str

job_description

TYPE: str

name instance-attribute ¤
name: str
job_description instance-attribute ¤
job_description: str

TokenUsage ¤

ATTRIBUTE DESCRIPTION
input_tokens

TYPE: int

output_tokens

TYPE: int

total_tokens

TYPE: int

input_tokens instance-attribute ¤
input_tokens: int
output_tokens instance-attribute ¤
output_tokens: int
total_tokens instance-attribute ¤
total_tokens: int

crew ¤

Handle the communication of a team of agents to the world

MODULE DESCRIPTION
crew_base
crew_base_test
crew_input
crew_output
state
types
CLASS DESCRIPTION
CrewBase

Base class for managing a Crew with asynchronous invocation and streaming.

CrewState
CrewConfig
CrewInputClarification
CrewInputFresh
ATTRIBUTE DESCRIPTION
CrewInput

CrewInputAdapter

TYPE: TypeAdapter[CrewInput]

CrewOutput

CrewInput module-attribute ¤

CrewInputAdapter module-attribute ¤

CrewInputAdapter: TypeAdapter[CrewInput] = TypeAdapter(CrewInput)

CrewOutput module-attribute ¤

CrewOutput = CollaboratorOutput

__all__ module-attribute ¤

__all__ = ['CrewConfig', 'CrewBase', 'CrewState', 'CrewInput', 'CrewInputAdapter', 'CrewInputClarification', 'CrewInputFresh', 'CrewOutput']

CrewBase ¤

Base class for managing a Crew with asynchronous invocation and streaming.

Handles interaction with a Team and manages Crew state, inputs, and outputs.

ATTRIBUTE DESCRIPTION
team

The team assigned to this Crew instance.

TYPE: TeamBase

METHOD DESCRIPTION
astream
ainvoke
invoke

Synchronous invocation is not supported; Crew must be invoked asynchronously.

async_invoke_config_parsed

Asynchronously invokes the Crew graph using a parsed configuration.

astream_config_parsed

Streams Crew execution results asynchronously using a parsed configuration.

team instance-attribute ¤

team: TeamBase

config_specs property ¤

config_specs: List[ConfigurableFieldSpec]

Returns all configuration dependencies required by the Crew and its Team.

RETURNS DESCRIPTION
List[ConfigurableFieldSpec]

List[ConfigurableFieldSpec]: Unique configuration specifications

List[ConfigurableFieldSpec]

for the Crew and Team.

astream async ¤

astream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) -> AsyncIterator[Output]

ainvoke async ¤

ainvoke(input: Input, config: Optional[RunnableConfig] = None) -> Output

invoke ¤

invoke(input: CrewInput, config: RunnableConfig | None = None) -> CrewOutput

Synchronous invocation is not supported; Crew must be invoked asynchronously.

RAISES DESCRIPTION
Exception

Always raises because synchronous calls are not allowed.

async_invoke_config_parsed async ¤

async_invoke_config_parsed(input: CrewInput, config_parsed: BaseModel, config_raw: RunnableConfig) -> CrewOutput

Asynchronously invokes the Crew graph using a parsed configuration.

PARAMETER DESCRIPTION
input ¤

Input data for the Crew.

TYPE: CrewInput

config_parsed ¤

Fully parsed configuration.

TYPE: BaseModel

config_raw ¤

Raw configuration data.

TYPE: RunnableConfig

RETURNS DESCRIPTION
CrewOutput

Output from the Crew after execution.

TYPE: CrewOutput

astream_config_parsed async ¤

astream_config_parsed(input: CrewInput, config_parsed: BaseModel, config_raw: RunnableConfig, run_manager: CallbackManagerForChainRun, **kwargs: Any) -> AsyncIterator[Dict[str, Any]]

Streams Crew execution results asynchronously using a parsed configuration.

PARAMETER DESCRIPTION
input ¤

Input for the Crew.

TYPE: CrewInput

config_parsed ¤

Parsed configuration object.

TYPE: BaseModel

config_raw ¤

Raw configuration object.

TYPE: RunnableConfig

run_manager ¤

Callback manager for streaming.

TYPE: CallbackManagerForChainRun

**kwargs ¤

Additional parameters for the streaming executor.

TYPE: Any DEFAULT: {}

YIELDS DESCRIPTION
AsyncIterator[Dict[str, Any]]

AsyncIterator[dict]: Streamed chunks of execution state containing output.

CrewState ¤

ATTRIBUTE DESCRIPTION
public_messages

TYPE: List[PublicMessage]

clarification

TYPE: Optional[ClarificationPending]

input

TYPE: CrewInput

output

TYPE: Optional[CrewOutput]

public_messages class-attribute instance-attribute ¤

public_messages: List[PublicMessage] = []

clarification class-attribute instance-attribute ¤

clarification: Optional[ClarificationPending] = None

input instance-attribute ¤

input: CrewInput

output class-attribute instance-attribute ¤

output: Optional[CrewOutput] = None

CrewConfig ¤

ATTRIBUTE DESCRIPTION
llm_srv

TYPE: BaseChatModel

use_cases_srv

TYPE: Any

user_name

TYPE: str

today

TYPE: str

checkpointer

TYPE: BaseCheckpointSaver

model_config

llm_srv instance-attribute ¤

llm_srv: BaseChatModel

use_cases_srv instance-attribute ¤

use_cases_srv: Any

user_name class-attribute instance-attribute ¤

user_name: str = Field(...)

today instance-attribute ¤

today: str

checkpointer instance-attribute ¤

checkpointer: BaseCheckpointSaver

model_config class-attribute instance-attribute ¤

model_config = ConfigDict(arbitrary_types_allowed=True)

CrewInputClarification ¤

ATTRIBUTE DESCRIPTION
type

TYPE: Literal['crew.input.clarification']

clarification_message

TYPE: ClarificationSimpleMessage

type class-attribute instance-attribute ¤

type: Literal['crew.input.clarification'] = 'crew.input.clarification'

clarification_message instance-attribute ¤

clarification_message: ClarificationSimpleMessage

CrewInputFresh ¤

ATTRIBUTE DESCRIPTION
type

TYPE: Literal['crew.input.fresh']

message

TYPE: UserMessage

type class-attribute instance-attribute ¤

type: Literal['crew.input.fresh'] = 'crew.input.fresh'

message instance-attribute ¤

message: UserMessage

crew_base ¤

CLASS DESCRIPTION
CrewBase

Base class for managing a Crew with asynchronous invocation and streaming.

FUNCTION DESCRIPTION
team_node

Creates an executor node for handling Crew interactions with a Team.

cleaner

Final node in the Crew graph for cleaning up and updating message history.

ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤

log = get_logger()

Loger para el módulo

CrewBase ¤

Base class for managing a Crew with asynchronous invocation and streaming.

Handles interaction with a Team and manages Crew state, inputs, and outputs.

ATTRIBUTE DESCRIPTION
team

The team assigned to this Crew instance.

TYPE: TeamBase

METHOD DESCRIPTION
invoke

Synchronous invocation is not supported; Crew must be invoked asynchronously.

async_invoke_config_parsed

Asynchronously invokes the Crew graph using a parsed configuration.

astream_config_parsed

Streams Crew execution results asynchronously using a parsed configuration.

astream
ainvoke
team instance-attribute ¤
team: TeamBase
config_specs property ¤
config_specs: List[ConfigurableFieldSpec]

Returns all configuration dependencies required by the Crew and its Team.

RETURNS DESCRIPTION
List[ConfigurableFieldSpec]

List[ConfigurableFieldSpec]: Unique configuration specifications

List[ConfigurableFieldSpec]

for the Crew and Team.

invoke ¤
invoke(input: CrewInput, config: RunnableConfig | None = None) -> CrewOutput

Synchronous invocation is not supported; Crew must be invoked asynchronously.

RAISES DESCRIPTION
Exception

Always raises because synchronous calls are not allowed.

async_invoke_config_parsed async ¤
async_invoke_config_parsed(input: CrewInput, config_parsed: BaseModel, config_raw: RunnableConfig) -> CrewOutput

Asynchronously invokes the Crew graph using a parsed configuration.

PARAMETER DESCRIPTION
input ¤

Input data for the Crew.

TYPE: CrewInput

config_parsed ¤

Fully parsed configuration.

TYPE: BaseModel

config_raw ¤

Raw configuration data.

TYPE: RunnableConfig

RETURNS DESCRIPTION
CrewOutput

Output from the Crew after execution.

TYPE: CrewOutput

astream_config_parsed async ¤
astream_config_parsed(input: CrewInput, config_parsed: BaseModel, config_raw: RunnableConfig, run_manager: CallbackManagerForChainRun, **kwargs: Any) -> AsyncIterator[Dict[str, Any]]

Streams Crew execution results asynchronously using a parsed configuration.

PARAMETER DESCRIPTION
input ¤

Input for the Crew.

TYPE: CrewInput

config_parsed ¤

Parsed configuration object.

TYPE: BaseModel

config_raw ¤

Raw configuration object.

TYPE: RunnableConfig

run_manager ¤

Callback manager for streaming.

TYPE: CallbackManagerForChainRun

**kwargs ¤

Additional parameters for the streaming executor.

TYPE: Any DEFAULT: {}

YIELDS DESCRIPTION
AsyncIterator[Dict[str, Any]]

AsyncIterator[dict]: Streamed chunks of execution state containing output.

astream async ¤
astream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) -> AsyncIterator[Output]
ainvoke async ¤
ainvoke(input: Input, config: Optional[RunnableConfig] = None) -> Output

team_node ¤

team_node(team: TeamBase)

Creates an executor node for handling Crew interactions with a Team.

This node converts Crew input into the appropriate Team input (either a fresh message or a clarification) and invokes the Team.

PARAMETER DESCRIPTION
team ¤

The team instance that will handle the input.

TYPE: TeamBase

RETURNS DESCRIPTION
Callable[[CrewState, RunnableConfig], dict]

An async executor function.

RAISES DESCRIPTION
ValueError

If CrewState input type is invalid or if a clarification does not match the pending clarification.

cleaner ¤

cleaner(state: CrewState, config: RunnableConfig)

Final node in the Crew graph for cleaning up and updating message history.

Adds fresh user messages to the public messages and stores responses or clarifications from collaborators.

PARAMETER DESCRIPTION
state ¤

The current state of the Crew execution.

TYPE: CrewState

config ¤

The configuration used for this execution.

TYPE: RunnableConfig

RETURNS DESCRIPTION
dict

Updated state containing either public messages or pending clarification.

RAISES DESCRIPTION
ValueError

If the output is not a recognized CollaboratorOutput type.

crew_base_test ¤

CLASS DESCRIPTION
SumInput
SumOutput
SingleItemsInput
ListItemsInput
BalanceInput
TransferBrainSchema
TransferClarification
TransferInput
TransferOutput
SumSkill
TransferSkill
AgentAdamSmith
AgentSupervisor
FUNCTION DESCRIPTION
situation_builder
create_message
use_cases_srv

Fixture para proveer el falso llm_srv

config_fake_llm
checkpointer
team_base
crew_base
test_what_is_my_name
test_remember_previous_message
test_structured_response
test_clarification_complete
test_clarification_non_existent
test_stream_what_is_my_name
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

sum_computation

list_items_computation

TYPE: Skill

tools_availables

log module-attribute ¤

log = get_logger()

Loger para el módulo

sum_computation module-attribute ¤

sum_computation = SumSkill()

list_items_computation module-attribute ¤

list_items_computation: Skill = SkillStructuredResponse(name='list_items', description='shows a list of items in a structured format for the user \nuse this tool when a user anwser for list of items', brain_schema=ListItemsInput)

tools_availables module-attribute ¤

SumInput ¤

ATTRIBUTE DESCRIPTION
number_1

TYPE: int

number_2

TYPE: int

registry_id

TYPE: str

number_1 instance-attribute ¤
number_1: int
number_2 instance-attribute ¤
number_2: int
registry_id cached property ¤
registry_id: str

SumOutput ¤

ATTRIBUTE DESCRIPTION
result

TYPE: int

result instance-attribute ¤
result: int

SingleItemsInput ¤

ATTRIBUTE DESCRIPTION
name

TYPE: str

description

TYPE: str

name instance-attribute ¤
name: str
description instance-attribute ¤
description: str

ListItemsInput ¤

ATTRIBUTE DESCRIPTION
items

TYPE: List[SingleItemsInput]

registry_id

TYPE: str

items instance-attribute ¤
registry_id cached property ¤
registry_id: str

BalanceInput ¤

ATTRIBUTE DESCRIPTION
bank

TYPE: str

type

TYPE: Literal['checking', 'savings']

registry_id

TYPE: str

bank class-attribute instance-attribute ¤
bank: str = Field(..., description='Name of the bank')
type class-attribute instance-attribute ¤
type: Literal['checking', 'savings'] = Field(..., description='account type')
registry_id cached property ¤
registry_id: str

TransferBrainSchema ¤

METHOD DESCRIPTION
is_lc_serializable
get_lc_namespace
lc_id
ATTRIBUTE DESCRIPTION
from_account

TYPE: str

to_account

TYPE: str

lc_attributes

TYPE: Dict

registry_id

TYPE: str

from_account instance-attribute ¤
from_account: str
to_account instance-attribute ¤
to_account: str
lc_attributes property ¤
lc_attributes: Dict
registry_id cached property ¤
registry_id: str
is_lc_serializable classmethod ¤
is_lc_serializable() -> bool
get_lc_namespace classmethod ¤
get_lc_namespace() -> List[str]
lc_id classmethod ¤
lc_id() -> list[str]

TransferClarification ¤

ATTRIBUTE DESCRIPTION
confirmation

TYPE: Literal['y', 'n']

confirmation instance-attribute ¤
confirmation: Literal['y', 'n']

TransferInput ¤

ATTRIBUTE DESCRIPTION
from_account

TYPE: str

to_account

TYPE: str

confirmation

TYPE: Literal['y', 'n']

from_account instance-attribute ¤
from_account: str
to_account instance-attribute ¤
to_account: str
confirmation instance-attribute ¤
confirmation: Literal['y', 'n']

TransferOutput ¤

METHOD DESCRIPTION
is_lc_serializable
get_lc_namespace
ATTRIBUTE DESCRIPTION
result

TYPE: str

new_balance

TYPE: int

lc_attributes

TYPE: Dict

result instance-attribute ¤
result: str
new_balance instance-attribute ¤
new_balance: int
lc_attributes property ¤
lc_attributes: Dict
is_lc_serializable classmethod ¤
is_lc_serializable() -> bool
get_lc_namespace classmethod ¤
get_lc_namespace() -> List[str]

SumSkill ¤

METHOD DESCRIPTION
async_executor
async_invoke_config_parsed
ainvoke
as_tool
invoke
get_output_schema
get_input_schema
ATTRIBUTE DESCRIPTION
name

TYPE: str

description

TYPE: str

brain_schema

TYPE: Type[SumInput]

result_schema

TYPE: Type[SumOutput]

config_specs

TYPE: List[ConfigurableFieldSpec]

type

TYPE: Literal['skill.computation']

require_clarification

TYPE: bool

sub_type

TYPE: Literal['direct']

name class-attribute instance-attribute ¤
name: str = 'sum'
description class-attribute instance-attribute ¤
description: str = 'given two numbers return the sum of both'
brain_schema class-attribute instance-attribute ¤
brain_schema: Type[SumInput] = SumInput
result_schema class-attribute instance-attribute ¤
result_schema: Type[SumOutput] = SumOutput
config_specs property ¤
config_specs: List[ConfigurableFieldSpec]
type class-attribute instance-attribute ¤
type: Literal['skill.computation'] = 'skill.computation'
require_clarification class-attribute instance-attribute ¤
require_clarification: bool = False
sub_type class-attribute instance-attribute ¤
sub_type: Literal['direct'] = 'direct'
async_executor async ¤
async_executor(request: SumInput, config: RunnableConfig) -> SumOutput
async_invoke_config_parsed async ¤
async_invoke_config_parsed(input: ComputationRequested, config_parsed: BaseModel, config_raw: RunnableConfig) -> ComputationResult[BrainSchema, ResultSchema]
ainvoke async ¤
ainvoke(input: Input, config: Optional[RunnableConfig] = None) -> Output
as_tool ¤
as_tool() -> Dict[str, Any]
invoke ¤
invoke(input: ComputationRequested, config: RunnableConfig | None = None) -> ComputationResult[BrainSchema, ResultSchema]
get_output_schema ¤
get_output_schema(config: Optional[RunnableConfig] = None) -> Type[ResultSchema]
get_input_schema ¤
get_input_schema(config: Optional[RunnableConfig] = None) -> Type[BrainSchema]

TransferSkill ¤

METHOD DESCRIPTION
async_executor
merge_brain_with_clarification
async_invoke_config_parsed
ainvoke
as_tool
invoke
get_output_schema
get_input_schema
get_clarification_schema
ATTRIBUTE DESCRIPTION
name

TYPE: str

description

TYPE: str

brain_schema

TYPE: Type[TransferBrainSchema]

result_schema

TYPE: Type[TransferOutput]

skill_input_schema

TYPE: Type[TransferInput]

clarification_schema

TYPE: Type[TransferClarification]

config_specs

List configurable fields for this runnable.

TYPE: List[ConfigurableFieldSpec]

type

TYPE: Literal['skill.computation']

require_clarification

TYPE: bool

sub_type

TYPE: Literal['with-clarification']

name class-attribute instance-attribute ¤
name: str = 'transfer'
description class-attribute instance-attribute ¤
description: str = 'transfer money between accounts'
brain_schema class-attribute instance-attribute ¤
result_schema class-attribute instance-attribute ¤
skill_input_schema class-attribute instance-attribute ¤
skill_input_schema: Type[TransferInput] = TransferInput
clarification_schema class-attribute instance-attribute ¤
config_specs property ¤
config_specs: List[ConfigurableFieldSpec]

List configurable fields for this runnable.

type class-attribute instance-attribute ¤
type: Literal['skill.computation'] = 'skill.computation'
require_clarification class-attribute instance-attribute ¤
require_clarification: bool = False
sub_type class-attribute instance-attribute ¤
sub_type: Literal['with-clarification'] = 'with-clarification'
async_executor async ¤
async_executor(request: TransferInput, config: RunnableConfig) -> TransferOutput
merge_brain_with_clarification ¤
merge_brain_with_clarification(brain_input: TransferBrainSchema, clarification_input: TransferClarification) -> TransferInput
async_invoke_config_parsed async ¤
async_invoke_config_parsed(input: ComputationRequestedWithClarification, config_parsed: BaseModel, config_raw: RunnableConfig) -> ComputationResult[SkillInputSchema, ResultSchema]
ainvoke async ¤
ainvoke(input: Input, config: Optional[RunnableConfig] = None) -> Output
as_tool ¤
as_tool() -> Dict[str, Any]
invoke ¤
invoke(input: ComputationRequested, config: RunnableConfig | None = None) -> ComputationResult[BrainSchema, ResultSchema]
get_output_schema ¤
get_output_schema(config: Optional[RunnableConfig] = None) -> Type[ResultSchema]
get_input_schema ¤
get_input_schema(config: Optional[RunnableConfig] = None) -> Type[BrainSchema]
get_clarification_schema ¤
get_clarification_schema(config: Optional[RunnableConfig] = None) -> Type[ClarificationSchema]

AgentAdamSmith ¤

AgentAdamSmith(**data)
METHOD DESCRIPTION
astream_config_parsed

Asynchronously streams the output of the collaborator.

astream
async_invoke_config_parsed

Asynchronously invokes the collaborator with a parsed configuration.

ainvoke
join_team

Assign the agent to a team and update instructions.

invoke

Invokes the collaborator.

ATTRIBUTE DESCRIPTION
name

TYPE: str

job_description

TYPE: str

options

TYPE: List[Skill]

config_specs

Get the merged configuration specifications for the agent.

TYPE: List[ConfigurableFieldSpec]

agent_name_intro

TYPE: str

public_bio

TYPE: Optional[str]

private_bio

TYPE: Optional[str]

directives

TYPE: Optional[str]

examples

TYPE: Optional[str]

team_membership

TYPE: Optional[TeamMembership]

options_built_in

TYPE: List[Skill]

history_strategy

TYPE: HistoryStrategyInterface

situation_builder

TYPE: Optional[SituationBuilderFn]

instructions_transformer

TYPE: Optional[InstructionsTransformerFn]

name class-attribute instance-attribute ¤
name: str = 'Adam_Smith'
job_description class-attribute instance-attribute ¤
job_description: str = 'Expert in Finance and Mathematics'
options class-attribute instance-attribute ¤
config_specs property ¤
config_specs: List[ConfigurableFieldSpec]

Get the merged configuration specifications for the agent.

RETURNS DESCRIPTION
List[ConfigurableFieldSpec]

List of configuration field specs.

agent_name_intro class-attribute instance-attribute ¤
agent_name_intro: str = 'Your name is '
public_bio class-attribute instance-attribute ¤
public_bio: Optional[str] = None
private_bio class-attribute instance-attribute ¤
private_bio: Optional[str] = None
directives class-attribute instance-attribute ¤
directives: Optional[str] = None
examples class-attribute instance-attribute ¤
examples: Optional[str] = None
team_membership class-attribute instance-attribute ¤
team_membership: Optional[TeamMembership] = None
options_built_in class-attribute instance-attribute ¤
options_built_in: List[Skill] = []
history_strategy class-attribute instance-attribute ¤
situation_builder class-attribute instance-attribute ¤
situation_builder: Optional[SituationBuilderFn] = None
instructions_transformer class-attribute instance-attribute ¤
instructions_transformer: Optional[InstructionsTransformerFn] = None
astream_config_parsed async ¤
astream_config_parsed(input: CollaboratorInput, config_parsed: BaseModel, config_raw: RunnableConfig, run_manager: CallbackManagerForChainRun, **kwargs: Optional[Any]) -> AsyncIterator[Dict[str, Any]]

Asynchronously streams the output of the collaborator.

PARAMETER DESCRIPTION
input ¤

The input data for the collaborator.

TYPE: CollaboratorInput

config_parsed ¤

The parsed configuration.

TYPE: BaseModel

config_raw ¤

The raw runnable configuration.

TYPE: RunnableConfig

run_manager ¤

The run manager.

TYPE: CallbackManagerForChainRun

**kwargs ¤

Optional keyword arguments.

TYPE: Optional[Any] DEFAULT: {}

YIELDS DESCRIPTION
dict

The chunks of the output.

astream async ¤
astream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) -> AsyncIterator[Output]
async_invoke_config_parsed async ¤
async_invoke_config_parsed(input: CollaboratorInput, config_parsed: BaseModel, config_raw: RunnableConfig) -> CollaboratorOutput

Asynchronously invokes the collaborator with a parsed configuration.

PARAMETER DESCRIPTION
input ¤

The input data for the collaborator.

TYPE: CollaboratorInput

config_parsed ¤

The parsed configuration.

TYPE: BaseModel

config_raw ¤

The raw runnable configuration.

TYPE: RunnableConfig

RETURNS DESCRIPTION
CollaboratorOutput

The output of the collaborator.

TYPE: CollaboratorOutput

ainvoke async ¤
ainvoke(input: Input, config: Optional[RunnableConfig] = None) -> Output
join_team ¤

Assign the agent to a team and update instructions.

PARAMETER DESCRIPTION
team_membership ¤

The team membership object.

TYPE: TeamMembership

invoke ¤
invoke(input: CollaboratorInput, config: RunnableConfig | None = None) -> CollaboratorOutput

Invokes the collaborator.

RAISES DESCRIPTION
Exception

Collaborator can only be called asynchronously.

AgentSupervisor ¤

AgentSupervisor(**data)
METHOD DESCRIPTION
astream_config_parsed

Asynchronously streams the output of the collaborator.

astream
async_invoke_config_parsed

Asynchronously invokes the collaborator with a parsed configuration.

ainvoke
join_team

Assign the agent to a team and update instructions.

invoke

Invokes the collaborator.

ATTRIBUTE DESCRIPTION
name

TYPE: str

job_description

TYPE: str

options

TYPE: List[Skill]

config_specs

Get the merged configuration specifications for the agent.

TYPE: List[ConfigurableFieldSpec]

agent_name_intro

TYPE: str

public_bio

TYPE: Optional[str]

private_bio

TYPE: Optional[str]

directives

TYPE: Optional[str]

examples

TYPE: Optional[str]

team_membership

TYPE: Optional[TeamMembership]

options_built_in

TYPE: List[Skill]

history_strategy

TYPE: HistoryStrategyInterface

situation_builder

TYPE: Optional[SituationBuilderFn]

instructions_transformer

TYPE: Optional[InstructionsTransformerFn]

name class-attribute instance-attribute ¤
name: str = 'Pablo'
job_description class-attribute instance-attribute ¤
job_description: str = "Select the best team member to answer the user's question"
options class-attribute instance-attribute ¤
options: List[Skill] = []
config_specs property ¤
config_specs: List[ConfigurableFieldSpec]

Get the merged configuration specifications for the agent.

RETURNS DESCRIPTION
List[ConfigurableFieldSpec]

List of configuration field specs.

agent_name_intro class-attribute instance-attribute ¤
agent_name_intro: str = 'Your name is '
public_bio class-attribute instance-attribute ¤
public_bio: Optional[str] = None
private_bio class-attribute instance-attribute ¤
private_bio: Optional[str] = None
directives class-attribute instance-attribute ¤
directives: Optional[str] = None
examples class-attribute instance-attribute ¤
examples: Optional[str] = None
team_membership class-attribute instance-attribute ¤
team_membership: Optional[TeamMembership] = None
options_built_in class-attribute instance-attribute ¤
options_built_in: List[Skill] = []
history_strategy class-attribute instance-attribute ¤
situation_builder class-attribute instance-attribute ¤
situation_builder: Optional[SituationBuilderFn] = None
instructions_transformer class-attribute instance-attribute ¤
instructions_transformer: Optional[InstructionsTransformerFn] = None
astream_config_parsed async ¤
astream_config_parsed(input: CollaboratorInput, config_parsed: BaseModel, config_raw: RunnableConfig, run_manager: CallbackManagerForChainRun, **kwargs: Optional[Any]) -> AsyncIterator[Dict[str, Any]]

Asynchronously streams the output of the collaborator.

PARAMETER DESCRIPTION
input ¤

The input data for the collaborator.

TYPE: CollaboratorInput

config_parsed ¤

The parsed configuration.

TYPE: BaseModel

config_raw ¤

The raw runnable configuration.

TYPE: RunnableConfig

run_manager ¤

The run manager.

TYPE: CallbackManagerForChainRun

**kwargs ¤

Optional keyword arguments.

TYPE: Optional[Any] DEFAULT: {}

YIELDS DESCRIPTION
dict

The chunks of the output.

astream async ¤
astream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) -> AsyncIterator[Output]
async_invoke_config_parsed async ¤
async_invoke_config_parsed(input: CollaboratorInput, config_parsed: BaseModel, config_raw: RunnableConfig) -> CollaboratorOutput

Asynchronously invokes the collaborator with a parsed configuration.

PARAMETER DESCRIPTION
input ¤

The input data for the collaborator.

TYPE: CollaboratorInput

config_parsed ¤

The parsed configuration.

TYPE: BaseModel

config_raw ¤

The raw runnable configuration.

TYPE: RunnableConfig

RETURNS DESCRIPTION
CollaboratorOutput

The output of the collaborator.

TYPE: CollaboratorOutput

ainvoke async ¤
ainvoke(input: Input, config: Optional[RunnableConfig] = None) -> Output
join_team ¤

Assign the agent to a team and update instructions.

PARAMETER DESCRIPTION
team_membership ¤

The team membership object.

TYPE: TeamMembership

invoke ¤
invoke(input: CollaboratorInput, config: RunnableConfig | None = None) -> CollaboratorOutput

Invokes the collaborator.

RAISES DESCRIPTION
Exception

Collaborator can only be called asynchronously.

situation_builder ¤

situation_builder(input, config)

create_message ¤

create_message(content: str)

use_cases_srv ¤

use_cases_srv()

Fixture para proveer el falso llm_srv

config_fake_llm ¤

config_fake_llm(use_cases_srv, checkpointer, mocker)

checkpointer ¤

checkpointer()

team_base ¤

team_base()

crew_base ¤

crew_base(team_base)

test_what_is_my_name async ¤

test_what_is_my_name(crew_base, config_fake_llm)

test_remember_previous_message async ¤

test_remember_previous_message(crew_base, config_fake_llm)

test_structured_response async ¤

test_structured_response(crew_base, config_fake_llm)

test_clarification_complete async ¤

test_clarification_complete(crew_base, config_fake_llm)

test_clarification_non_existent async ¤

test_clarification_non_existent(crew_base, config_fake_llm)

test_stream_what_is_my_name async ¤

test_stream_what_is_my_name(crew_base, config_fake_llm)

crew_input ¤

CLASS DESCRIPTION
CrewInputBase
CrewInputFresh
CrewInputClarification
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

CrewInput

CrewInputAdapter

TYPE: TypeAdapter[CrewInput]

log module-attribute ¤

log = get_logger()

Loger para el módulo

CrewInput module-attribute ¤

CrewInputAdapter module-attribute ¤

CrewInputAdapter: TypeAdapter[CrewInput] = TypeAdapter(CrewInput)

CrewInputBase ¤

CrewInputFresh ¤

ATTRIBUTE DESCRIPTION
type

TYPE: Literal['crew.input.fresh']

message

TYPE: UserMessage

type class-attribute instance-attribute ¤
type: Literal['crew.input.fresh'] = 'crew.input.fresh'
message instance-attribute ¤
message: UserMessage

CrewInputClarification ¤

ATTRIBUTE DESCRIPTION
type

TYPE: Literal['crew.input.clarification']

clarification_message

TYPE: ClarificationSimpleMessage

type class-attribute instance-attribute ¤
type: Literal['crew.input.clarification'] = 'crew.input.clarification'
clarification_message instance-attribute ¤
clarification_message: ClarificationSimpleMessage

crew_output ¤

ATTRIBUTE DESCRIPTION
CrewOutput

CrewOutput module-attribute ¤

CrewOutput = CollaboratorOutput

state ¤

CLASS DESCRIPTION
CrewState

CrewState ¤

ATTRIBUTE DESCRIPTION
public_messages

TYPE: List[PublicMessage]

clarification

TYPE: Optional[ClarificationPending]

input

TYPE: CrewInput

output

TYPE: Optional[CrewOutput]

public_messages class-attribute instance-attribute ¤
public_messages: List[PublicMessage] = []
clarification class-attribute instance-attribute ¤
clarification: Optional[ClarificationPending] = None
input instance-attribute ¤
input: CrewInput
output class-attribute instance-attribute ¤
output: Optional[CrewOutput] = None

types ¤

CLASS DESCRIPTION
CrewConfig
ClarificationPending
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤

log = get_logger()

Loger para el módulo

CrewConfig ¤

ATTRIBUTE DESCRIPTION
checkpointer

TYPE: BaseCheckpointSaver

model_config

llm_srv

TYPE: BaseChatModel

use_cases_srv

TYPE: Any

user_name

TYPE: str

today

TYPE: str

checkpointer instance-attribute ¤
checkpointer: BaseCheckpointSaver
model_config class-attribute instance-attribute ¤
model_config = ConfigDict(arbitrary_types_allowed=True)
llm_srv instance-attribute ¤
llm_srv: BaseChatModel
use_cases_srv instance-attribute ¤
use_cases_srv: Any
user_name class-attribute instance-attribute ¤
user_name: str = Field(...)
today instance-attribute ¤
today: str

ClarificationPending ¤

METHOD DESCRIPTION
is_lc_serializable
get_lc_namespace
ATTRIBUTE DESCRIPTION
requested

TYPE: ClarificationRequested

context

TYPE: ClarificationContext

lc_attributes

TYPE: Dict

requested instance-attribute ¤
context instance-attribute ¤
lc_attributes property ¤
lc_attributes: Dict
is_lc_serializable classmethod ¤
is_lc_serializable() -> bool
get_lc_namespace classmethod ¤
get_lc_namespace() -> List[str]

duty ¤

Duties that performs a collaborator

MODULE DESCRIPTION
duty_base
duty_base_test
ATTRIBUTE DESCRIPTION
__all__

__all__ module-attribute ¤

__all__ = []

duty_base ¤

CLASS DESCRIPTION
DutyBase

Abstract base class for the duties a collaborator can perform.

ATTRIBUTE DESCRIPTION
DutyInput

DutyOutput

DutyState

DutyInput module-attribute ¤

DutyInput = TypeVar('DutyInput', bound=BaseModel)

DutyOutput module-attribute ¤

DutyOutput = TypeVar('DutyOutput', bound=BaseModel)

DutyState module-attribute ¤

DutyState = TypeVar('DutyState', bound=BaseModel)

DutyBase ¤

Abstract base class for the duties a collaborator can perform.

A duty is a responsability that a collaborator fullfill.

METHOD DESCRIPTION
invoke

Invokes the duty.

async_invoke_config_parsed

Asynchronously invokes the duty with a parsed configuration.

astream_config_parsed

Asynchronously streams the output of the collaborator.

astream
ainvoke
ATTRIBUTE DESCRIPTION
multi_turn

TYPE: bool

description

TYPE: str

state_schema

TYPE: Type[DutyState]

config_specs

Required fields in the configuration for this runnable.

TYPE: List[ConfigurableFieldSpec]

multi_turn class-attribute instance-attribute ¤
multi_turn: bool = False
description instance-attribute ¤
description: str
state_schema instance-attribute ¤
state_schema: Type[DutyState]
config_specs property ¤
config_specs: List[ConfigurableFieldSpec]

Required fields in the configuration for this runnable.

RETURNS DESCRIPTION
list

A list of ConfigurableFieldSpec objects.

invoke ¤
invoke(input: DutyInput, config: RunnableConfig | None = None) -> DutyOutput

Invokes the duty.

RAISES DESCRIPTION
Exception

Collaborator can only be called asynchronously.

async_invoke_config_parsed async ¤
async_invoke_config_parsed(input: DutyInput, config_parsed: BaseModel, config_raw: RunnableConfig) -> DutyOutput

Asynchronously invokes the duty with a parsed configuration.

PARAMETER DESCRIPTION
input ¤

The input data for the duty.

TYPE: DutyInput

config_parsed ¤

The parsed configuration.

TYPE: BaseModel

config_raw ¤

The raw runnable configuration.

TYPE: RunnableConfig

RETURNS DESCRIPTION
DutyOutput

The output of the duty.

TYPE: DutyOutput

astream_config_parsed async ¤
astream_config_parsed(input: DutyInput, config_parsed: BaseModel, config_raw: RunnableConfig, run_manager: CallbackManagerForChainRun, **kwargs: Optional[Any]) -> AsyncIterator[Dict[str, Any]]

Asynchronously streams the output of the collaborator.

PARAMETER DESCRIPTION
input ¤

The input data for the collaborator.

TYPE: CollaboratorInput

config_parsed ¤

The parsed configuration.

TYPE: BaseModel

config_raw ¤

The raw runnable configuration.

TYPE: RunnableConfig

run_manager ¤

The run manager.

TYPE: CallbackManagerForChainRun

**kwargs ¤

Optional keyword arguments.

TYPE: Optional[Any] DEFAULT: {}

YIELDS DESCRIPTION
dict

The chunks of the output.

astream async ¤
astream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) -> AsyncIterator[Output]
ainvoke async ¤
ainvoke(input: Input, config: Optional[RunnableConfig] = None) -> Output

duty_base_test ¤

CLASS DESCRIPTION
Input
Output
State
DutyFake
FUNCTION DESCRIPTION
fake_start
fake_node
cleaner
test_create_duty
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤

log = get_logger()

Loger para el módulo

Input ¤

ATTRIBUTE DESCRIPTION
request

TYPE: str

request instance-attribute ¤
request: str

Output ¤

ATTRIBUTE DESCRIPTION
response

TYPE: str

response instance-attribute ¤
response: str

State ¤

ATTRIBUTE DESCRIPTION
messages

TYPE: List[str]

final_output

TYPE: str

messages class-attribute instance-attribute ¤
messages: List[str] = []
final_output class-attribute instance-attribute ¤
final_output: str = ''

DutyFake ¤

METHOD DESCRIPTION
astream_config_parsed

Asynchronously streams the output of the collaborator.

astream
async_invoke_config_parsed

Asynchronously invokes the duty with a parsed configuration.

ainvoke
invoke

Invokes the duty.

ATTRIBUTE DESCRIPTION
state_schema

TYPE: Type[State]

multi_turn

TYPE: bool

description

TYPE: str

config_specs

Required fields in the configuration for this runnable.

TYPE: List[ConfigurableFieldSpec]

state_schema class-attribute instance-attribute ¤
state_schema: Type[State] = State
multi_turn class-attribute instance-attribute ¤
multi_turn: bool = False
description instance-attribute ¤
description: str
config_specs property ¤
config_specs: List[ConfigurableFieldSpec]

Required fields in the configuration for this runnable.

RETURNS DESCRIPTION
list

A list of ConfigurableFieldSpec objects.

astream_config_parsed async ¤
astream_config_parsed(input: DutyInput, config_parsed: BaseModel, config_raw: RunnableConfig, run_manager: CallbackManagerForChainRun, **kwargs: Optional[Any]) -> AsyncIterator[Dict[str, Any]]

Asynchronously streams the output of the collaborator.

PARAMETER DESCRIPTION
input ¤

The input data for the collaborator.

TYPE: CollaboratorInput

config_parsed ¤

The parsed configuration.

TYPE: BaseModel

config_raw ¤

The raw runnable configuration.

TYPE: RunnableConfig

run_manager ¤

The run manager.

TYPE: CallbackManagerForChainRun

**kwargs ¤

Optional keyword arguments.

TYPE: Optional[Any] DEFAULT: {}

YIELDS DESCRIPTION
dict

The chunks of the output.

astream async ¤
astream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) -> AsyncIterator[Output]
async_invoke_config_parsed async ¤
async_invoke_config_parsed(input: DutyInput, config_parsed: BaseModel, config_raw: RunnableConfig) -> DutyOutput

Asynchronously invokes the duty with a parsed configuration.

PARAMETER DESCRIPTION
input ¤

The input data for the duty.

TYPE: DutyInput

config_parsed ¤

The parsed configuration.

TYPE: BaseModel

config_raw ¤

The raw runnable configuration.

TYPE: RunnableConfig

RETURNS DESCRIPTION
DutyOutput

The output of the duty.

TYPE: DutyOutput

ainvoke async ¤
ainvoke(input: Input, config: Optional[RunnableConfig] = None) -> Output
invoke ¤
invoke(input: DutyInput, config: RunnableConfig | None = None) -> DutyOutput

Invokes the duty.

RAISES DESCRIPTION
Exception

Collaborator can only be called asynchronously.

fake_start ¤

fake_start(state: State, config: RunnableConfig)

fake_node ¤

fake_node(state: State, config: RunnableConfig)

cleaner ¤

cleaner(state: State, config: RunnableConfig)

test_create_duty async ¤

test_create_duty()

helpers ¤

Utilities for the library

MODULE DESCRIPTION
check_templates_for_valid_placeholders
create_dynamic_protocol
fake_llm
json_serializar_from_custom_models

A custom JSON serializer for LangChain's LangGraph library.

json_serializar_from_custom_models_test
read_jsonl_file
snake_to_camel

__all__ module-attribute ¤

__all__ = ['check_templates_for_valid_placeholders', 'create_dynamic_protocol', 'read_jsonl_file', 'snake_to_camel']

check_templates_for_valid_placeholders ¤

FUNCTION DESCRIPTION
check_templates_for_valid_placeholders

check_templates_for_valid_placeholders ¤

check_templates_for_valid_placeholders(source: Dict[str, Any], properties_using_templates: List[str], availables_keys: KeysView) -> Dict[str, Any]

create_dynamic_protocol ¤

FUNCTION DESCRIPTION
create_dynamic_protocol

Dynamically create a Protocol that includes methods and attributes

create_dynamic_protocol ¤

create_dynamic_protocol(name: str, *interfaces: Type) -> Type

Dynamically create a Protocol that includes methods and attributes from multiple interfaces.

fake_llm ¤

CLASS DESCRIPTION
FakeLLM

Fake LLM for tests

ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤

log = get_logger()

Loger para el módulo

FakeLLM ¤

Fake LLM for tests

Support streaming and astream_events

METHOD DESCRIPTION
bind_tools
invoke
bind_tools ¤
bind_tools(tools: Any, **kwargs: Any)
invoke ¤
invoke(input: Any, config: Any = None, *args: Any, stop: Optional[list[str]] = None, **kwargs: Any)

json_serializar_from_custom_models ¤

A custom JSON serializer for LangChain's LangGraph library.

This module provides a custom serializer that extends JsonPlusSerializer to correctly handle serialization and deserialization of custom Pydantic models defined within the crewmaster library. This is necessary because LangGraph needs to know about these custom namespaces to correctly revive objects.

CLASS DESCRIPTION
JsonSerializarFromCustomModels

A JSON serializer for custom Crewmaster models.

ATTRIBUTE DESCRIPTION
log

Loger para el módulo

SERIALIZER_VALID_NAMESPACES

log module-attribute ¤

log = get_logger()

Loger para el módulo

SERIALIZER_VALID_NAMESPACES module-attribute ¤

SERIALIZER_VALID_NAMESPACES = ['crewmaster']

JsonSerializarFromCustomModels ¤

JsonSerializarFromCustomModels(*args, valid_namespaces: Optional[List[str]] = SERIALIZER_VALID_NAMESPACES, **kwargs)

A JSON serializer for custom Crewmaster models.

This class extends the JsonPlusSerializer to properly handle custom models from the crewmaster namespace. It ensures that LangChain's Reviver is aware of the crewmaster modules, preventing errors during deserialization of checkpoints.

PARAMETER DESCRIPTION
*args ¤

Variable length argument list.

DEFAULT: ()

valid_namespaces ¤

The list of namespaces to validate.

TYPE: list DEFAULT: SERIALIZER_VALID_NAMESPACES

**kwargs ¤

Arbitrary keyword arguments.

DEFAULT: {}

ATTRIBUTE DESCRIPTION
reviver

TYPE: Reviver

reviver instance-attribute ¤
reviver: Reviver = Reviver(valid_namespaces=valid_namespaces)

json_serializar_from_custom_models_test ¤

FUNCTION DESCRIPTION
test_serializer_with_simple_values
test_serializer
test_serializer_typed
test_with_standard_serializer

Verify that default JsonPlusSerializer fails with namespace crewmaster.*

ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤

log = get_logger()

Loger para el módulo

test_serializer_with_simple_values ¤

test_serializer_with_simple_values() -> None

test_with_standard_serializer ¤

test_with_standard_serializer() -> None

Verify that default JsonPlusSerializer fails with namespace crewmaster.*

read_jsonl_file ¤

FUNCTION DESCRIPTION
read_jsonl_file

Reads a JSON Lines (JSONL) file and returns its content

read_jsonl_file ¤

read_jsonl_file(file_path: str) -> List[Dict]

Reads a JSON Lines (JSONL) file and returns its content as a list of dictionaries.

PARAMETER DESCRIPTION
file_path ¤

The path to the JSONL file.

TYPE: str

RETURNS DESCRIPTION
List[Dict]

List[Dict]: A list of dictionaries, one for each JSON object in the file.

snake_to_camel ¤

FUNCTION DESCRIPTION
snake_to_camel

snake_to_camel ¤

snake_to_camel(snake_str: str) -> str

http_driver ¤

Driver to create an api rest endpoint

MODULE DESCRIPTION
auth
crew_dependencies
crew_router_base
crew_router_base_test
crew_settings
crew_settings_test
factories
http_input
stream_conversor
CLASS DESCRIPTION
CrewDependencies
CrewRouterBase
UserLogged
PublicAccessStrategy
UserMessage
HttpInputFresh

New input originated by a user message.

HttpMetadata
HttpEventFilter

Define the type, time and format of the messages in the stream.

__all__ module-attribute ¤

__all__ = ['_build_config_for_runnable', 'CrewDependencies', 'CrewRouterBase', 'HttpEventFilter', 'HttpInputFresh', 'HttpMetadata', 'PublicAccessStrategy', 'stream_conversor', 'UserLogged', 'UserMessage']

CrewDependencies ¤

ATTRIBUTE DESCRIPTION
checkpointer

TYPE: Any

llm_srv

TYPE: Any

user_logged

TYPE: UserLogged

user_name

TYPE: str

today

TYPE: str

checkpointer instance-attribute ¤

checkpointer: Any

llm_srv instance-attribute ¤

llm_srv: Any

user_logged instance-attribute ¤

user_logged: UserLogged

user_name instance-attribute ¤

user_name: str

today instance-attribute ¤

today: str

CrewRouterBase ¤

METHOD DESCRIPTION
model_post_init

Se configuran las factories que no son asignadas por el usuario

build_custom_dependencies
transform_input

Transforma la data de entrada HttpInput

ATTRIBUTE DESCRIPTION
path

Ruta en que se monta el endpoint

TYPE: str

runnable

Runnable que ejecuta el Crew

TYPE: Runnable

settings

Settings para el Crew

TYPE: CrewSettings

tags

Etiquetas para categorizar el crew

TYPE: Optional[List[str | Enum]]

auth_strategy

Estrategia de autorización para la aplicación

TYPE: AuthStrategyInterface

dependencies_factory

Proveedor para dependencias custom de la aplicación

TYPE: Optional[Callable[[CrewSettings, CrewDependencies], Awaitable[BaseModel]]]

checkpointer

Factory para checkpointer que almacena estado del Crew

TYPE: BaseCheckpointSaver

llm

Factory para LLM con qué interactúa el Crew

TYPE: Optional[BaseChatModel]

model_config

Configuración del modelo

fastapi_router

TYPE: APIRouter

path class-attribute instance-attribute ¤

path: str = 'crew_events'

Ruta en que se monta el endpoint

runnable instance-attribute ¤

runnable: Runnable

Runnable que ejecuta el Crew

settings instance-attribute ¤

settings: CrewSettings

Settings para el Crew

tags class-attribute instance-attribute ¤

tags: Optional[List[str | Enum]] = None

Etiquetas para categorizar el crew

auth_strategy class-attribute instance-attribute ¤

Estrategia de autorización para la aplicación

dependencies_factory class-attribute instance-attribute ¤

dependencies_factory: Optional[Callable[[CrewSettings, CrewDependencies], Awaitable[BaseModel]]] = None

Proveedor para dependencias custom de la aplicación

checkpointer class-attribute instance-attribute ¤

checkpointer: BaseCheckpointSaver = memory_factory()

Factory para checkpointer que almacena estado del Crew

llm class-attribute instance-attribute ¤

llm: Optional[BaseChatModel] = None

Factory para LLM con qué interactúa el Crew

model_config class-attribute instance-attribute ¤

model_config = ConfigDict(arbitrary_types_allowed=True)

Configuración del modelo

fastapi_router property ¤

fastapi_router: APIRouter

model_post_init ¤

model_post_init(__context: Any)

Se configuran las factories que no son asignadas por el usuario y requieren los settings para configurarse

build_custom_dependencies async ¤

build_custom_dependencies(known_dependencies: CrewDependencies)

transform_input ¤

transform_input(original: HttpInput) -> CrewInput

Transforma la data de entrada HttpInput en la data esperada por el Crew

UserLogged ¤

ATTRIBUTE DESCRIPTION
email

TYPE: str

name

TYPE: Optional[str]

timezone

TYPE: Optional[str]

credentials

TYPE: Any

email instance-attribute ¤

email: str

name instance-attribute ¤

name: Optional[str]

timezone instance-attribute ¤

timezone: Optional[str]

credentials instance-attribute ¤

credentials: Any

PublicAccessStrategy ¤

METHOD DESCRIPTION
execute
current_user

execute ¤

execute()

current_user ¤

current_user()

UserMessage ¤

ATTRIBUTE DESCRIPTION
type

TYPE: Literal['human']

subtype

TYPE: Literal['user_message']

timestamp

TYPE: str

content

TYPE: Union[str, List[Union[str, Dict]]]

id

TYPE: str

type class-attribute instance-attribute ¤

type: Literal['human'] = 'human'

subtype class-attribute instance-attribute ¤

subtype: Literal['user_message'] = 'user_message'

timestamp instance-attribute ¤

timestamp: str

content instance-attribute ¤

content: Union[str, List[Union[str, Dict]]]

id instance-attribute ¤

id: str

HttpInputFresh ¤

New input originated by a user message.

Is the most used message in a normal conversation.

ATTRIBUTE DESCRIPTION
type

TYPE: Literal['http.input.fresh']

message

TYPE: UserMessage

type class-attribute instance-attribute ¤

type: Literal['http.input.fresh'] = 'http.input.fresh'

message instance-attribute ¤

message: UserMessage

HttpMetadata ¤

ATTRIBUTE DESCRIPTION
thread_id

TYPE: str

thread_id instance-attribute ¤

thread_id: str

HttpEventFilter ¤

Define the type, time and format of the messages in the stream.

The defaults allows to receive the less amount of message, with the smallest size.

ATTRIBUTE DESCRIPTION
scope

Type of events that will be sent in the stream.

TYPE: ScopeAvailables

moments

TYPE: Set[AllowedEventMoment]

format

TYPE: EventFormat

scope class-attribute instance-attribute ¤

scope: ScopeAvailables = Field('answer', description='\n    Type of events that will be sent in the stream.\n\n    * answer: Only the definitive answer will be sent\n    * deliberations: Messages between agents\n    * computations: connections with others systems and skills\n\n    Each level include the previous events.\n    ')

Type of events that will be sent in the stream.

  • answer: Only the definitive answer will be sent
  • deliberations: Messages between agents
  • computations: connections with others systems and skills

Each level include the previous events.

moments class-attribute instance-attribute ¤

moments: Set[AllowedEventMoment] = Field({'end'}, description='\n    Time of the event that will be sent.\n    * start: the start of every process\n    * stream: the intermediate events in the agent\n    * end: the final of the process\n    ')

format class-attribute instance-attribute ¤

format: EventFormat = Field('compact', description='\n    Use compact to receive only the event data.\n    Use extended to also receive the event metadata.\n    ')

auth ¤

MODULE DESCRIPTION
auth_strategy_interface
google_auth_strategy
public_access_strategy
user_logged
CLASS DESCRIPTION
AuthStrategyInterface
UserLogged
PublicAccessStrategy
GoogleAuthStrategy

__all__ module-attribute ¤

__all__ = ['AuthStrategyInterface', 'UserLogged', 'PublicAccessStrategy', 'GoogleAuthStrategy']

AuthStrategyInterface ¤

METHOD DESCRIPTION
execute
current_user
execute abstractmethod ¤
execute() -> UserLogged
current_user abstractmethod ¤
current_user() -> UserLogged

UserLogged ¤

ATTRIBUTE DESCRIPTION
email

TYPE: str

name

TYPE: Optional[str]

timezone

TYPE: Optional[str]

credentials

TYPE: Any

email instance-attribute ¤
email: str
name instance-attribute ¤
name: Optional[str]
timezone instance-attribute ¤
timezone: Optional[str]
credentials instance-attribute ¤
credentials: Any

PublicAccessStrategy ¤

METHOD DESCRIPTION
execute
current_user
execute ¤
execute()
current_user ¤
current_user()

GoogleAuthStrategy ¤

METHOD DESCRIPTION
current_user
execute
ATTRIBUTE DESCRIPTION
token_uri

TYPE: str

client_id

TYPE: str

client_secret

TYPE: str

token_uri instance-attribute ¤
token_uri: str
client_id instance-attribute ¤
client_id: str
client_secret instance-attribute ¤
client_secret: str
current_user ¤
current_user()
execute ¤
execute(refresh_token: str = Depends(get_token_from_request))

auth_strategy_interface ¤

CLASS DESCRIPTION
AuthStrategyInterface
AuthStrategyInterface ¤
METHOD DESCRIPTION
execute
current_user
execute abstractmethod ¤
execute() -> UserLogged
current_user abstractmethod ¤
current_user() -> UserLogged

google_auth_strategy ¤

CLASS DESCRIPTION
GoogleAuthStrategy
FUNCTION DESCRIPTION
api_key_in_body
get_token_from_request
build_google_credentials
ATTRIBUTE DESCRIPTION
log

Logger para la clase

api_key_in_header

log module-attribute ¤
log = get_logger()

Logger para la clase

api_key_in_header module-attribute ¤
api_key_in_header = APIKeyHeader(name='Authorization', auto_error=False)
GoogleAuthStrategy ¤
METHOD DESCRIPTION
current_user
execute
ATTRIBUTE DESCRIPTION
token_uri

TYPE: str

client_id

TYPE: str

client_secret

TYPE: str

token_uri instance-attribute ¤
token_uri: str
client_id instance-attribute ¤
client_id: str
client_secret instance-attribute ¤
client_secret: str
current_user ¤
current_user()
execute ¤
execute(refresh_token: str = Depends(get_token_from_request))
api_key_in_body ¤
api_key_in_body(token: str = Body(None, embed=True))
get_token_from_request ¤
get_token_from_request(api_key_in_header: Optional[str] = Depends(api_key_in_header), api_key_in_body: Optional[str] = Depends(api_key_in_body))
build_google_credentials ¤
build_google_credentials(token_uri: str, client_id: str, client_secret: str)

public_access_strategy ¤

CLASS DESCRIPTION
PublicAccessStrategy
ATTRIBUTE DESCRIPTION
log

Logger para la clase

log module-attribute ¤
log = get_logger()

Logger para la clase

PublicAccessStrategy ¤
METHOD DESCRIPTION
execute
current_user
execute ¤
execute()
current_user ¤
current_user()

user_logged ¤

CLASS DESCRIPTION
UserLogged
UserLogged ¤
ATTRIBUTE DESCRIPTION
email

TYPE: str

name

TYPE: Optional[str]

timezone

TYPE: Optional[str]

credentials

TYPE: Any

email instance-attribute ¤
email: str
name instance-attribute ¤
name: Optional[str]
timezone instance-attribute ¤
timezone: Optional[str]
credentials instance-attribute ¤
credentials: Any

crew_dependencies ¤

CLASS DESCRIPTION
CrewDependencies

CrewDependencies ¤

ATTRIBUTE DESCRIPTION
checkpointer

TYPE: Any

llm_srv

TYPE: Any

user_logged

TYPE: UserLogged

user_name

TYPE: str

today

TYPE: str

checkpointer instance-attribute ¤
checkpointer: Any
llm_srv instance-attribute ¤
llm_srv: Any
user_logged instance-attribute ¤
user_logged: UserLogged
user_name instance-attribute ¤
user_name: str
today instance-attribute ¤
today: str

crew_router_base ¤

CLASS DESCRIPTION
CrewRouterBase
ATTRIBUTE DESCRIPTION
text_stream_content_type

TYPE: Dict[int | str, Dict[str, Any]]

log

Logger para la clase

text_stream_content_type module-attribute ¤

text_stream_content_type: Dict[int | str, Dict[str, Any]] = {200: {'content': {'text/event-stream, application/json': {'description': 'Contenidos devueltos cuándo todo sale bien'}, 'application/json': {'description': 'Contenido devuelto cuándo hay algún error'}}}}

log module-attribute ¤

log = get_logger()

Logger para la clase

CrewRouterBase ¤

METHOD DESCRIPTION
model_post_init

Se configuran las factories que no son asignadas por el usuario

build_custom_dependencies
transform_input

Transforma la data de entrada HttpInput

ATTRIBUTE DESCRIPTION
path

Ruta en que se monta el endpoint

TYPE: str

runnable

Runnable que ejecuta el Crew

TYPE: Runnable

settings

Settings para el Crew

TYPE: CrewSettings

tags

Etiquetas para categorizar el crew

TYPE: Optional[List[str | Enum]]

auth_strategy

Estrategia de autorización para la aplicación

TYPE: AuthStrategyInterface

dependencies_factory

Proveedor para dependencias custom de la aplicación

TYPE: Optional[Callable[[CrewSettings, CrewDependencies], Awaitable[BaseModel]]]

checkpointer

Factory para checkpointer que almacena estado del Crew

TYPE: BaseCheckpointSaver

llm

Factory para LLM con qué interactúa el Crew

TYPE: Optional[BaseChatModel]

model_config

Configuración del modelo

fastapi_router

TYPE: APIRouter

path class-attribute instance-attribute ¤
path: str = 'crew_events'

Ruta en que se monta el endpoint

runnable instance-attribute ¤
runnable: Runnable

Runnable que ejecuta el Crew

settings instance-attribute ¤
settings: CrewSettings

Settings para el Crew

tags class-attribute instance-attribute ¤
tags: Optional[List[str | Enum]] = None

Etiquetas para categorizar el crew

auth_strategy class-attribute instance-attribute ¤

Estrategia de autorización para la aplicación

dependencies_factory class-attribute instance-attribute ¤
dependencies_factory: Optional[Callable[[CrewSettings, CrewDependencies], Awaitable[BaseModel]]] = None

Proveedor para dependencias custom de la aplicación

checkpointer class-attribute instance-attribute ¤
checkpointer: BaseCheckpointSaver = memory_factory()

Factory para checkpointer que almacena estado del Crew

llm class-attribute instance-attribute ¤
llm: Optional[BaseChatModel] = None

Factory para LLM con qué interactúa el Crew

model_config class-attribute instance-attribute ¤
model_config = ConfigDict(arbitrary_types_allowed=True)

Configuración del modelo

fastapi_router property ¤
fastapi_router: APIRouter
model_post_init ¤
model_post_init(__context: Any)

Se configuran las factories que no son asignadas por el usuario y requieren los settings para configurarse

build_custom_dependencies async ¤
build_custom_dependencies(known_dependencies: CrewDependencies)
transform_input ¤
transform_input(original: HttpInput) -> CrewInput

Transforma la data de entrada HttpInput en la data esperada por el Crew

crew_router_base_test ¤

CLASS DESCRIPTION
FakeLLM
AgentTests
FUNCTION DESCRIPTION
team_base
fake_llm
reset_sse_starlette_appstatus_event

Fixture that resets the appstatus event in the sse_starlette app.

build_settings
crew_base
setup_router
build_metadata
http_client
test_stream_simple_fresh
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤

log = get_logger()

Loger para el módulo

FakeLLM ¤

METHOD DESCRIPTION
bind_tools
bind_tools ¤
bind_tools(tools: Any, **kwargs: Any)

AgentTests ¤

AgentTests(**data)
METHOD DESCRIPTION
astream_config_parsed

Asynchronously streams the output of the collaborator.

astream
async_invoke_config_parsed

Asynchronously invokes the collaborator with a parsed configuration.

ainvoke
join_team

Assign the agent to a team and update instructions.

invoke

Invokes the collaborator.

ATTRIBUTE DESCRIPTION
name

TYPE: str

job_description

TYPE: str

config_specs

Get the merged configuration specifications for the agent.

TYPE: List[ConfigurableFieldSpec]

agent_name_intro

TYPE: str

public_bio

TYPE: Optional[str]

private_bio

TYPE: Optional[str]

directives

TYPE: Optional[str]

examples

TYPE: Optional[str]

team_membership

TYPE: Optional[TeamMembership]

options

TYPE: List[Skill]

options_built_in

TYPE: List[Skill]

history_strategy

TYPE: HistoryStrategyInterface

situation_builder

TYPE: Optional[SituationBuilderFn]

instructions_transformer

TYPE: Optional[InstructionsTransformerFn]

name class-attribute instance-attribute ¤
name: str = 'Cervantes'
job_description class-attribute instance-attribute ¤
job_description: str = '\n    Answer questions about literature\n    '
config_specs property ¤
config_specs: List[ConfigurableFieldSpec]

Get the merged configuration specifications for the agent.

RETURNS DESCRIPTION
List[ConfigurableFieldSpec]

List of configuration field specs.

agent_name_intro class-attribute instance-attribute ¤
agent_name_intro: str = 'Your name is '
public_bio class-attribute instance-attribute ¤
public_bio: Optional[str] = None
private_bio class-attribute instance-attribute ¤
private_bio: Optional[str] = None
directives class-attribute instance-attribute ¤
directives: Optional[str] = None
examples class-attribute instance-attribute ¤
examples: Optional[str] = None
team_membership class-attribute instance-attribute ¤
team_membership: Optional[TeamMembership] = None
options class-attribute instance-attribute ¤
options: List[Skill] = []
options_built_in class-attribute instance-attribute ¤
options_built_in: List[Skill] = []
history_strategy class-attribute instance-attribute ¤
situation_builder class-attribute instance-attribute ¤
situation_builder: Optional[SituationBuilderFn] = None
instructions_transformer class-attribute instance-attribute ¤
instructions_transformer: Optional[InstructionsTransformerFn] = None
astream_config_parsed async ¤
astream_config_parsed(input: CollaboratorInput, config_parsed: BaseModel, config_raw: RunnableConfig, run_manager: CallbackManagerForChainRun, **kwargs: Optional[Any]) -> AsyncIterator[Dict[str, Any]]

Asynchronously streams the output of the collaborator.

PARAMETER DESCRIPTION
input ¤

The input data for the collaborator.

TYPE: CollaboratorInput

config_parsed ¤

The parsed configuration.

TYPE: BaseModel

config_raw ¤

The raw runnable configuration.

TYPE: RunnableConfig

run_manager ¤

The run manager.

TYPE: CallbackManagerForChainRun

**kwargs ¤

Optional keyword arguments.

TYPE: Optional[Any] DEFAULT: {}

YIELDS DESCRIPTION
dict

The chunks of the output.

astream async ¤
astream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) -> AsyncIterator[Output]
async_invoke_config_parsed async ¤
async_invoke_config_parsed(input: CollaboratorInput, config_parsed: BaseModel, config_raw: RunnableConfig) -> CollaboratorOutput

Asynchronously invokes the collaborator with a parsed configuration.

PARAMETER DESCRIPTION
input ¤

The input data for the collaborator.

TYPE: CollaboratorInput

config_parsed ¤

The parsed configuration.

TYPE: BaseModel

config_raw ¤

The raw runnable configuration.

TYPE: RunnableConfig

RETURNS DESCRIPTION
CollaboratorOutput

The output of the collaborator.

TYPE: CollaboratorOutput

ainvoke async ¤
ainvoke(input: Input, config: Optional[RunnableConfig] = None) -> Output
join_team ¤

Assign the agent to a team and update instructions.

PARAMETER DESCRIPTION
team_membership ¤

The team membership object.

TYPE: TeamMembership

invoke ¤
invoke(input: CollaboratorInput, config: RunnableConfig | None = None) -> CollaboratorOutput

Invokes the collaborator.

RAISES DESCRIPTION
Exception

Collaborator can only be called asynchronously.

team_base ¤

team_base()

fake_llm ¤

fake_llm()

reset_sse_starlette_appstatus_event ¤

reset_sse_starlette_appstatus_event()

Fixture that resets the appstatus event in the sse_starlette app.

Should be used on any test that uses sse_starlette to stream events.

build_settings ¤

build_settings()

crew_base ¤

crew_base(team_base)

setup_router ¤

setup_router(fake_llm, build_settings, crew_base)

build_metadata ¤

build_metadata()

http_client ¤

http_client(setup_router, reset_sse_starlette_appstatus_event)

test_stream_simple_fresh async ¤

test_stream_simple_fresh(http_client, build_metadata)

crew_settings ¤

CLASS DESCRIPTION
CrewSettings

Clase de Pydantinc para manejar los settings

CrewSettings ¤

Clase de Pydantinc para manejar los settings

Ver: https://fastapi.tiangolo.com/advanced/settings/

ATTRIBUTE DESCRIPTION
llm_api_key_open_ai

TYPE: str

llm_model_open_ai

TYPE: str

llm_temperature_open_ai

TYPE: int

model_config

llm_api_key_open_ai class-attribute instance-attribute ¤
llm_api_key_open_ai: str = Field(min_length=10)
llm_model_open_ai class-attribute instance-attribute ¤
llm_model_open_ai: str = Field(min_length=10)
llm_temperature_open_ai class-attribute instance-attribute ¤
llm_temperature_open_ai: int = 0
model_config class-attribute instance-attribute ¤
model_config = SettingsConfigDict(extra='allow', env_file='')

crew_settings_test ¤

factories ¤

MODULE DESCRIPTION
chatopenai_factory
memory_factory

__all__ module-attribute ¤

__all__ = ['memory_factory', 'chatopenai_factory']

chatopenai_factory ¤

FUNCTION DESCRIPTION
chatopenai_factory
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤
log = get_logger()

Loger para el módulo

chatopenai_factory ¤
chatopenai_factory(api_key: str, model: str, temperature: float)

memory_factory ¤

FUNCTION DESCRIPTION
memory_factory
memory_factory ¤
memory_factory() -> BaseCheckpointSaver

http_input ¤

CLASS DESCRIPTION
UserMessage
ClarificationSimpleMessage

Response to a clarification message sent by the Crew.

HttpInputFresh

New input originated by a user message.

HttpInputClarification
HttpMetadata
HttpEventFilter

Define the type, time and format of the messages in the stream.

ATTRIBUTE DESCRIPTION
log

Loger para el módulo

HttpInput

log module-attribute ¤

log = get_logger()

Loger para el módulo

HttpInput module-attribute ¤

UserMessage ¤

ATTRIBUTE DESCRIPTION
type

TYPE: Literal['human']

subtype

TYPE: Literal['user_message']

timestamp

TYPE: str

content

TYPE: Union[str, List[Union[str, Dict]]]

id

TYPE: str

type class-attribute instance-attribute ¤
type: Literal['human'] = 'human'
subtype class-attribute instance-attribute ¤
subtype: Literal['user_message'] = 'user_message'
timestamp instance-attribute ¤
timestamp: str
content instance-attribute ¤
content: Union[str, List[Union[str, Dict]]]
id instance-attribute ¤
id: str

ClarificationSimpleMessage ¤

Response to a clarification message sent by the Crew.

ATTRIBUTE DESCRIPTION
subtype

TYPE: Literal['clarification_message']

content

TYPE: Union[str, List[Union[str, Dict]]]

payload

TYPE: Dict[str, Any]

computation_id

TYPE: str

timestamp

TYPE: str

subtype class-attribute instance-attribute ¤
subtype: Literal['clarification_message'] = 'clarification_message'
content class-attribute instance-attribute ¤
content: Union[str, List[Union[str, Dict]]] = ''
payload instance-attribute ¤
payload: Dict[str, Any]
computation_id instance-attribute ¤
computation_id: str
timestamp instance-attribute ¤
timestamp: str

HttpInputFresh ¤

New input originated by a user message.

Is the most used message in a normal conversation.

ATTRIBUTE DESCRIPTION
type

TYPE: Literal['http.input.fresh']

message

TYPE: UserMessage

type class-attribute instance-attribute ¤
type: Literal['http.input.fresh'] = 'http.input.fresh'
message instance-attribute ¤
message: UserMessage

HttpInputClarification ¤

ATTRIBUTE DESCRIPTION
type

TYPE: Literal['http.input.clarification']

clarification_message

TYPE: ClarificationSimpleMessage

type class-attribute instance-attribute ¤
type: Literal['http.input.clarification'] = 'http.input.clarification'
clarification_message instance-attribute ¤
clarification_message: ClarificationSimpleMessage

HttpMetadata ¤

ATTRIBUTE DESCRIPTION
thread_id

TYPE: str

thread_id instance-attribute ¤
thread_id: str

HttpEventFilter ¤

Define the type, time and format of the messages in the stream.

The defaults allows to receive the less amount of message, with the smallest size.

ATTRIBUTE DESCRIPTION
scope

Type of events that will be sent in the stream.

TYPE: ScopeAvailables

moments

TYPE: Set[AllowedEventMoment]

format

TYPE: EventFormat

scope class-attribute instance-attribute ¤
scope: ScopeAvailables = Field('answer', description='\n    Type of events that will be sent in the stream.\n\n    * answer: Only the definitive answer will be sent\n    * deliberations: Messages between agents\n    * computations: connections with others systems and skills\n\n    Each level include the previous events.\n    ')

Type of events that will be sent in the stream.

  • answer: Only the definitive answer will be sent
  • deliberations: Messages between agents
  • computations: connections with others systems and skills

Each level include the previous events.

moments class-attribute instance-attribute ¤
moments: Set[AllowedEventMoment] = Field({'end'}, description='\n    Time of the event that will be sent.\n    * start: the start of every process\n    * stream: the intermediate events in the agent\n    * end: the final of the process\n    ')
format class-attribute instance-attribute ¤
format: EventFormat = Field('compact', description='\n    Use compact to receive only the event data.\n    Use extended to also receive the event metadata.\n    ')

stream_conversor ¤

CLASS DESCRIPTION
StreamFilter
FUNCTION DESCRIPTION
prepare_error_for_client

Prepara un error para enviarlo como evento

build_pre_filter
is_event_required
reduce_event
create_sse_event
stream_conversor

Conversor de eventos para el stream del Crew

ATTRIBUTE DESCRIPTION
log

Loger para el módulo

ScopeAvailables

EventFormat

AllowedEventMoment

log module-attribute ¤

log = get_logger()

Loger para el módulo

ScopeAvailables module-attribute ¤

ScopeAvailables = Literal['answer', 'deliberations', 'computations']

EventFormat module-attribute ¤

EventFormat = Literal['compact', 'extended']

AllowedEventMoment module-attribute ¤

AllowedEventMoment = Literal['start', 'stream', 'end']

StreamFilter ¤

ATTRIBUTE DESCRIPTION
include_names

TYPE: Optional[Sequence[str]]

include_tags

TYPE: Optional[Sequence[str]]

include_types

TYPE: Optional[Sequence[str]]

exclude_names

TYPE: Optional[Sequence[str]]

exclude_tags

TYPE: Optional[Sequence[str]]

exclude_types

TYPE: Optional[Sequence[str]]

include_names class-attribute instance-attribute ¤
include_names: Optional[Sequence[str]] = None
include_tags class-attribute instance-attribute ¤
include_tags: Optional[Sequence[str]] = None
include_types class-attribute instance-attribute ¤
include_types: Optional[Sequence[str]] = None
exclude_names class-attribute instance-attribute ¤
exclude_names: Optional[Sequence[str]] = None
exclude_tags class-attribute instance-attribute ¤
exclude_tags: Optional[Sequence[str]] = None
exclude_types class-attribute instance-attribute ¤
exclude_types: Optional[Sequence[str]] = None

prepare_error_for_client ¤

prepare_error_for_client(error: BaseException) -> str

Prepara un error para enviarlo como evento

PARAMETER DESCRIPTION
error ¤

Error generado en la aplicación

TYPE: BaseException

RETURNS DESCRIPTION
str

json con la serializacion del error

TYPE: str

build_pre_filter ¤

build_pre_filter(scope: ScopeAvailables) -> StreamFilter

is_event_required ¤

is_event_required(event: StreamEvent, allowed_event_moments: Set[AllowedEventMoment]) -> bool

reduce_event ¤

reduce_event(event)

create_sse_event ¤

create_sse_event(event: StreamEvent, event_format: EventFormat, serializer) -> ServerSentEvent

stream_conversor async ¤

stream_conversor(runnable: Runnable, input: CrewInput, config: RunnableConfig, scope: ScopeAvailables = 'answer', moments: Set[AllowedEventMoment] = {'end'}, event_format: EventFormat = 'compact') -> AsyncIterator[ServerSentEvent]

Conversor de eventos para el stream del Crew

PARAMETER DESCRIPTION
runnable ¤

runnable que se quiere convertir los eventos

TYPE: Runnable

input ¤

Data de entrada al runnable

TYPE: HttpInput

config ¤

configuración para el runnable

TYPE: RunnableConfig

RETURNS DESCRIPTION
AsyncIterator[ServerSentEvent]

AsyncIterator[ServerSentEvent]: Generador de eventos convertidos

YIELDS DESCRIPTION
AsyncIterator[ServerSentEvent]

Iterator[AsyncIterator[ServerSentEvent]]: Iterador de los eventos

muscle ¤

Handle the actions defined by the brain

MODULE DESCRIPTION
helpers

Handle the actions defined by the brain

muscle_base
muscle_base_test
muscle_types
CLASS DESCRIPTION
MuscleBase

Handle the execution of the Skills.

MuscleInputClarificationResponse
MuscleInputComputationRequested
MuscleOutputClarification
MuscleOutputResults
ATTRIBUTE DESCRIPTION
MuscleOutput

Union discriminada para MuscleOutput

MuscleOutput module-attribute ¤

Union discriminada para MuscleOutput

__all__ module-attribute ¤

__all__ = ['MuscleBase', 'MuscleInputClarificationResponse', 'MuscleInputComputationRequested', 'MuscleOutput', 'MuscleOutputClarification', 'MuscleOutputResults']

MuscleBase ¤

Handle the execution of the Skills.

Handle a queue of pending jobs and make the execution of each one.

Handle direct computations requested and computation that requires a clarification.

METHOD DESCRIPTION
ainvoke
invoke
async_invoke_config_parsed
ATTRIBUTE DESCRIPTION
name

TYPE: Optional[str]

agent_name

TYPE: str

skills

TYPE: List[SkillComputation]

config_specs

List configurable fields for this runnable.

TYPE: List[ConfigurableFieldSpec]

name class-attribute instance-attribute ¤

name: Optional[str] = 'cbr:muscle'

agent_name instance-attribute ¤

agent_name: str

skills class-attribute instance-attribute ¤

skills: List[SkillComputation] = []

config_specs property ¤

config_specs: List[ConfigurableFieldSpec]

List configurable fields for this runnable.

ainvoke async ¤

ainvoke(input: Input, config: Optional[RunnableConfig] = None) -> Output

invoke ¤

invoke(input: MuscleInput, config: RunnableConfig | None = None) -> MuscleOutput

async_invoke_config_parsed async ¤

async_invoke_config_parsed(input: MuscleInput, config_parsed: BaseModel, config_raw: RunnableConfig) -> MuscleOutput

MuscleInputClarificationResponse ¤

ATTRIBUTE DESCRIPTION
type

TYPE: Literal['muscle.input.clarification']

clarification_message

TYPE: ClarificationMessage

type class-attribute instance-attribute ¤

type: Literal['muscle.input.clarification'] = 'muscle.input.clarification'

clarification_message instance-attribute ¤

clarification_message: ClarificationMessage

MuscleInputComputationRequested ¤

ATTRIBUTE DESCRIPTION
type

TYPE: Literal['muscle.output.computations']

computations_required

TYPE: List[ComputationRequested]

type class-attribute instance-attribute ¤

type: Literal['muscle.output.computations'] = 'muscle.output.computations'

computations_required instance-attribute ¤

computations_required: List[ComputationRequested]

MuscleOutputClarification ¤

ATTRIBUTE DESCRIPTION
type

TYPE: Literal['muscle.output.clarification']

clarification_context

TYPE: ClarificationContext

clarification_requested

TYPE: SerializeAsAny[ClarificationRequested]

type class-attribute instance-attribute ¤

type: Literal['muscle.output.clarification'] = 'muscle.output.clarification'

clarification_context instance-attribute ¤

clarification_context: ClarificationContext

clarification_requested instance-attribute ¤

clarification_requested: SerializeAsAny[ClarificationRequested]

MuscleOutputResults ¤

ATTRIBUTE DESCRIPTION
type

TYPE: Literal['muscle.output.results']

computations_requested

TYPE: List[ComputationRequested]

computations_results

TYPE: List[ComputationResult]

type class-attribute instance-attribute ¤

type: Literal['muscle.output.results'] = 'muscle.output.results'

computations_requested class-attribute instance-attribute ¤

computations_requested: List[ComputationRequested] = []

computations_results class-attribute instance-attribute ¤

computations_results: List[ComputationResult] = []

helpers ¤

Handle the actions defined by the brain

MODULE DESCRIPTION
execute_computation
execute_computation_test
execute_computations_pending
execute_computations_pending_test
process_clarification_response
process_clarification_response_test
process_computations_request
process_computations_request_test

__all__ module-attribute ¤

__all__ = ['execute_computation', 'execute_computations_pending', 'process_clarification_response', 'process_computations_request']

execute_computation ¤

FUNCTION DESCRIPTION
execute_computation
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤
log = get_logger()

Loger para el módulo

execute_computation async ¤

execute_computation_test ¤

CLASS DESCRIPTION
FakeBrainSchema
FakeResultSchema
FakeClarificationSchema
FakeSkillComputationDirect
FakeSkillComputationWithClarification
FUNCTION DESCRIPTION
test_execute_computation_direct_success
test_execute_computation_with_clarification_success
test_execute_computation_invalid_option_request_pair
test_execute_computation_merges_config
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤
log = get_logger()

Loger para el módulo

FakeBrainSchema ¤
ATTRIBUTE DESCRIPTION
prop

TYPE: str

registry_id

TYPE: str

prop class-attribute instance-attribute ¤
prop: str = ''
registry_id cached property ¤
registry_id: str
FakeResultSchema ¤
ATTRIBUTE DESCRIPTION
response

TYPE: str

response class-attribute instance-attribute ¤
response: str = ''
FakeClarificationSchema ¤
ATTRIBUTE DESCRIPTION
prop

TYPE: str

prop class-attribute instance-attribute ¤
prop: str = ''
FakeSkillComputationDirect ¤
METHOD DESCRIPTION
async_executor
async_invoke_config_parsed
ainvoke
as_tool
invoke
get_output_schema
get_input_schema
ATTRIBUTE DESCRIPTION
name

TYPE: str

brain_args

TYPE: Dict[str, Any]

clarification_args

TYPE: Dict[str, Any]

computation_id

TYPE: str

description

TYPE: str

brain_schema

TYPE: FakeBrainSchema

result_schema

TYPE: FakeResultSchema

type

TYPE: Literal['skill.computation']

require_clarification

TYPE: bool

sub_type

TYPE: Literal['direct']

name class-attribute instance-attribute ¤
name: str = 'fake_op'
brain_args class-attribute instance-attribute ¤
brain_args: Dict[str, Any] = dict
clarification_args class-attribute instance-attribute ¤
clarification_args: Dict[str, Any] = dict
computation_id class-attribute instance-attribute ¤
computation_id: str = '22222'
description class-attribute instance-attribute ¤
description: str = ''
brain_schema class-attribute instance-attribute ¤
brain_schema: FakeBrainSchema = FakeBrainSchema()
result_schema class-attribute instance-attribute ¤
type class-attribute instance-attribute ¤
type: Literal['skill.computation'] = 'skill.computation'
require_clarification class-attribute instance-attribute ¤
require_clarification: bool = False
sub_type class-attribute instance-attribute ¤
sub_type: Literal['direct'] = 'direct'
async_executor async ¤
async_executor(input, config)
async_invoke_config_parsed async ¤
async_invoke_config_parsed(input: ComputationRequested, config_parsed: BaseModel, config_raw: RunnableConfig) -> ComputationResult[BrainSchema, ResultSchema]
ainvoke async ¤
ainvoke(input: Input, config: Optional[RunnableConfig] = None) -> Output
as_tool ¤
as_tool() -> Dict[str, Any]
invoke ¤
invoke(input: ComputationRequested, config: RunnableConfig | None = None) -> ComputationResult[BrainSchema, ResultSchema]
get_output_schema ¤
get_output_schema(config: Optional[RunnableConfig] = None) -> Type[ResultSchema]
get_input_schema ¤
get_input_schema(config: Optional[RunnableConfig] = None) -> Type[BrainSchema]
FakeSkillComputationWithClarification ¤
METHOD DESCRIPTION
async_executor
merge_brain_with_clarification
async_invoke_config_parsed
ainvoke
as_tool
invoke
get_output_schema
get_input_schema
get_clarification_schema
ATTRIBUTE DESCRIPTION
name

TYPE: str

brain_args

TYPE: Dict[str, Any]

clarification_args

TYPE: Dict[str, Any]

computation_id

TYPE: str

description

TYPE: str

brain_schema

TYPE: FakeBrainSchema

result_schema

TYPE: FakeResultSchema

clarification_schema

TYPE: FakeClarificationSchema

skill_input_schema

TYPE: FakeClarificationSchema

type

TYPE: Literal['skill.computation']

require_clarification

TYPE: bool

sub_type

TYPE: Literal['with-clarification']

name class-attribute instance-attribute ¤
name: str = 'fake_op'
brain_args class-attribute instance-attribute ¤
brain_args: Dict[str, Any] = dict
clarification_args class-attribute instance-attribute ¤
clarification_args: Dict[str, Any] = dict
computation_id class-attribute instance-attribute ¤
computation_id: str = '22222'
description class-attribute instance-attribute ¤
description: str = ''
brain_schema class-attribute instance-attribute ¤
brain_schema: FakeBrainSchema = FakeBrainSchema()
result_schema class-attribute instance-attribute ¤
clarification_schema class-attribute instance-attribute ¤
skill_input_schema class-attribute instance-attribute ¤
type class-attribute instance-attribute ¤
type: Literal['skill.computation'] = 'skill.computation'
require_clarification class-attribute instance-attribute ¤
require_clarification: bool = False
sub_type class-attribute instance-attribute ¤
sub_type: Literal['with-clarification'] = 'with-clarification'
async_executor async ¤
async_executor(skill_args, config)
merge_brain_with_clarification async ¤
merge_brain_with_clarification(brain_input, clarification_input)
async_invoke_config_parsed async ¤
async_invoke_config_parsed(input: ComputationRequestedWithClarification, config_parsed: BaseModel, config_raw: RunnableConfig) -> ComputationResult[SkillInputSchema, ResultSchema]
ainvoke async ¤
ainvoke(input: Input, config: Optional[RunnableConfig] = None) -> Output
as_tool ¤
as_tool() -> Dict[str, Any]
invoke ¤
invoke(input: ComputationRequested, config: RunnableConfig | None = None) -> ComputationResult[BrainSchema, ResultSchema]
get_output_schema ¤
get_output_schema(config: Optional[RunnableConfig] = None) -> Type[ResultSchema]
get_input_schema ¤
get_input_schema(config: Optional[RunnableConfig] = None) -> Type[BrainSchema]
get_clarification_schema ¤
get_clarification_schema(config: Optional[RunnableConfig] = None) -> Type[ClarificationSchema]
test_execute_computation_direct_success async ¤
test_execute_computation_direct_success()
test_execute_computation_with_clarification_success async ¤
test_execute_computation_with_clarification_success()
test_execute_computation_invalid_option_request_pair async ¤
test_execute_computation_invalid_option_request_pair()
test_execute_computation_merges_config async ¤
test_execute_computation_merges_config()

execute_computations_pending ¤

FUNCTION DESCRIPTION
execute_computations_pending
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤
log = get_logger()

Loger para el módulo

execute_computations_pending async ¤
execute_computations_pending(pending: List[ComputationRequested], results: List[ComputationResult], skills: List[SkillComputation], agent_name: str, config: RunnableConfig) -> MuscleOutput

execute_computations_pending_test ¤

CLASS DESCRIPTION
FakeBrainSchema
FakeResultSchema
FakeClarificationSchema
DummyDirect
DummyWithClarification
FUNCTION DESCRIPTION
test_empty_pending_returns_existing_results
test_clarification_branch_triggered
test_direct_computations_only_calls_execute_computation
test_mixed_options_prioritizes_clarification
test_config_passed_to_execute_computation
FakeBrainSchema ¤
ATTRIBUTE DESCRIPTION
prop

TYPE: str

registry_id

TYPE: str

prop class-attribute instance-attribute ¤
prop: str = ''
registry_id cached property ¤
registry_id: str
FakeResultSchema ¤
ATTRIBUTE DESCRIPTION
response

TYPE: str

response class-attribute instance-attribute ¤
response: str = ''
FakeClarificationSchema ¤
ATTRIBUTE DESCRIPTION
prop

TYPE: str

prop class-attribute instance-attribute ¤
prop: str = ''
DummyDirect ¤
METHOD DESCRIPTION
async_executor
ainvoke
async_invoke_config_parsed
as_tool
invoke
get_output_schema
get_input_schema
ATTRIBUTE DESCRIPTION
name

TYPE: str

brain_args

TYPE: Dict[str, Any]

clarification_args

TYPE: Dict[str, Any]

computation_id

TYPE: str

description

TYPE: str

brain_schema

TYPE: FakeBrainSchema

result_schema

TYPE: FakeResultSchema

type

TYPE: Literal['skill.computation']

require_clarification

TYPE: bool

sub_type

TYPE: Literal['direct']

name class-attribute instance-attribute ¤
name: str = 'direct-skill'
brain_args class-attribute instance-attribute ¤
brain_args: Dict[str, Any] = dict
clarification_args class-attribute instance-attribute ¤
clarification_args: Dict[str, Any] = dict
computation_id class-attribute instance-attribute ¤
computation_id: str = '22222'
description class-attribute instance-attribute ¤
description: str = ''
brain_schema class-attribute instance-attribute ¤
brain_schema: FakeBrainSchema = FakeBrainSchema()
result_schema class-attribute instance-attribute ¤
type class-attribute instance-attribute ¤
type: Literal['skill.computation'] = 'skill.computation'
require_clarification class-attribute instance-attribute ¤
require_clarification: bool = False
sub_type class-attribute instance-attribute ¤
sub_type: Literal['direct'] = 'direct'
async_executor async ¤
async_executor(input, config)
ainvoke async ¤
ainvoke(input, config)
async_invoke_config_parsed async ¤
async_invoke_config_parsed(input: ComputationRequested, config_parsed: BaseModel, config_raw: RunnableConfig) -> ComputationResult[BrainSchema, ResultSchema]
as_tool ¤
as_tool() -> Dict[str, Any]
invoke ¤
invoke(input: ComputationRequested, config: RunnableConfig | None = None) -> ComputationResult[BrainSchema, ResultSchema]
get_output_schema ¤
get_output_schema(config: Optional[RunnableConfig] = None) -> Type[ResultSchema]
get_input_schema ¤
get_input_schema(config: Optional[RunnableConfig] = None) -> Type[BrainSchema]
DummyWithClarification ¤
METHOD DESCRIPTION
async_executor
merge_brain_with_clarification
ainvoke
async_invoke_config_parsed
as_tool
invoke
get_output_schema
get_input_schema
get_clarification_schema
ATTRIBUTE DESCRIPTION
name

TYPE: str

brain_args

TYPE: Dict[str, Any]

clarification_args

TYPE: Dict[str, Any]

computation_id

TYPE: str

description

TYPE: str

brain_schema

TYPE: FakeBrainSchema

result_schema

TYPE: FakeResultSchema

clarification_schema

TYPE: FakeClarificationSchema

skill_input_schema

TYPE: FakeClarificationSchema

type

TYPE: Literal['skill.computation']

require_clarification

TYPE: bool

sub_type

TYPE: Literal['with-clarification']

name class-attribute instance-attribute ¤
name: str = 'clarify-skill'
brain_args class-attribute instance-attribute ¤
brain_args: Dict[str, Any] = dict
clarification_args class-attribute instance-attribute ¤
clarification_args: Dict[str, Any] = dict
computation_id class-attribute instance-attribute ¤
computation_id: str = '22222'
description class-attribute instance-attribute ¤
description: str = ''
brain_schema class-attribute instance-attribute ¤
brain_schema: FakeBrainSchema = FakeBrainSchema()
result_schema class-attribute instance-attribute ¤
clarification_schema class-attribute instance-attribute ¤
skill_input_schema class-attribute instance-attribute ¤
type class-attribute instance-attribute ¤
type: Literal['skill.computation'] = 'skill.computation'
require_clarification class-attribute instance-attribute ¤
require_clarification: bool = False
sub_type class-attribute instance-attribute ¤
sub_type: Literal['with-clarification'] = 'with-clarification'
async_executor async ¤
async_executor(input, config)
merge_brain_with_clarification async ¤
merge_brain_with_clarification(brain_input, clarification_input)
ainvoke async ¤
ainvoke(input, config)
async_invoke_config_parsed async ¤
async_invoke_config_parsed(input: ComputationRequestedWithClarification, config_parsed: BaseModel, config_raw: RunnableConfig) -> ComputationResult[SkillInputSchema, ResultSchema]
as_tool ¤
as_tool() -> Dict[str, Any]
invoke ¤
invoke(input: ComputationRequested, config: RunnableConfig | None = None) -> ComputationResult[BrainSchema, ResultSchema]
get_output_schema ¤
get_output_schema(config: Optional[RunnableConfig] = None) -> Type[ResultSchema]
get_input_schema ¤
get_input_schema(config: Optional[RunnableConfig] = None) -> Type[BrainSchema]
get_clarification_schema ¤
get_clarification_schema(config: Optional[RunnableConfig] = None) -> Type[ClarificationSchema]
test_empty_pending_returns_existing_results async ¤
test_empty_pending_returns_existing_results()
test_clarification_branch_triggered async ¤
test_clarification_branch_triggered()
test_direct_computations_only_calls_execute_computation async ¤
test_direct_computations_only_calls_execute_computation()
test_mixed_options_prioritizes_clarification async ¤
test_mixed_options_prioritizes_clarification()
test_config_passed_to_execute_computation async ¤
test_config_passed_to_execute_computation()

process_clarification_response ¤

FUNCTION DESCRIPTION
process_clarification_response
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤
log = get_logger()

Loger para el módulo

process_clarification_response async ¤
process_clarification_response(skills: List[SkillComputation], input: MuscleInputClarificationResponse, config: RunnableConfig, agent_name: str) -> MuscleOutput

process_clarification_response_test ¤

CLASS DESCRIPTION
DummySkill

Minimal concrete subclass for testing.

FUNCTION DESCRIPTION
test_raises_if_no_matching_computation_id
test_raises_if_no_matching_skill
test_successful_process_flow
DummySkill ¤

Minimal concrete subclass for testing.

METHOD DESCRIPTION
async_executor
merge_brain_with_clarification
async_invoke_config_parsed
ainvoke
as_tool
invoke
get_output_schema
get_input_schema
get_clarification_schema
ATTRIBUTE DESCRIPTION
name

TYPE: str

brain_args

TYPE: dict

clarification_args

TYPE: dict

computation_id

TYPE: str

description

TYPE: str

brain_schema

TYPE: dict

result_schema

TYPE: dict

clarification_schema

TYPE: dict

skill_input_schema

TYPE: dict

type

TYPE: Literal['skill.computation']

require_clarification

TYPE: bool

sub_type

TYPE: Literal['with-clarification']

name class-attribute instance-attribute ¤
name: str = 'skill1'
brain_args class-attribute instance-attribute ¤
brain_args: dict = {}
clarification_args class-attribute instance-attribute ¤
clarification_args: dict = {}
computation_id class-attribute instance-attribute ¤
computation_id: str = 'comp-1'
description class-attribute instance-attribute ¤
description: str = ''
brain_schema class-attribute instance-attribute ¤
brain_schema: dict = {}
result_schema class-attribute instance-attribute ¤
result_schema: dict = {}
clarification_schema class-attribute instance-attribute ¤
clarification_schema: dict = {}
skill_input_schema class-attribute instance-attribute ¤
skill_input_schema: dict = {}
type class-attribute instance-attribute ¤
type: Literal['skill.computation'] = 'skill.computation'
require_clarification class-attribute instance-attribute ¤
require_clarification: bool = False
sub_type class-attribute instance-attribute ¤
sub_type: Literal['with-clarification'] = 'with-clarification'
async_executor async ¤
async_executor(*a, **kw)
merge_brain_with_clarification async ¤
merge_brain_with_clarification(*a, **kw)
async_invoke_config_parsed async ¤
async_invoke_config_parsed(input: ComputationRequestedWithClarification, config_parsed: BaseModel, config_raw: RunnableConfig) -> ComputationResult[SkillInputSchema, ResultSchema]
ainvoke async ¤
ainvoke(input: Input, config: Optional[RunnableConfig] = None) -> Output
as_tool ¤
as_tool() -> Dict[str, Any]
invoke ¤
invoke(input: ComputationRequested, config: RunnableConfig | None = None) -> ComputationResult[BrainSchema, ResultSchema]
get_output_schema ¤
get_output_schema(config: Optional[RunnableConfig] = None) -> Type[ResultSchema]
get_input_schema ¤
get_input_schema(config: Optional[RunnableConfig] = None) -> Type[BrainSchema]
get_clarification_schema ¤
get_clarification_schema(config: Optional[RunnableConfig] = None) -> Type[ClarificationSchema]
test_raises_if_no_matching_computation_id async ¤
test_raises_if_no_matching_computation_id()
test_raises_if_no_matching_skill async ¤
test_raises_if_no_matching_skill()
test_successful_process_flow async ¤
test_successful_process_flow()

process_computations_request ¤

FUNCTION DESCRIPTION
process_computations_request
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤
log = get_logger()

Loger para el módulo

process_computations_request async ¤
process_computations_request(skills: List[SkillComputation], input: MuscleInputComputationRequested, config: RunnableConfig, agent_name: str) -> MuscleOutput

process_computations_request_test ¤

CLASS DESCRIPTION
FakeBrainSchema
FakeResultSchema
FakeClarificationSchema
DummyDirect
FUNCTION DESCRIPTION
test_process_computations_request_calls_execute_computations_pending
test_process_computations_request_passes_empty_pending
FakeBrainSchema ¤
ATTRIBUTE DESCRIPTION
prop

TYPE: str

registry_id

TYPE: str

prop class-attribute instance-attribute ¤
prop: str = ''
registry_id cached property ¤
registry_id: str
FakeResultSchema ¤
ATTRIBUTE DESCRIPTION
response

TYPE: str

response class-attribute instance-attribute ¤
response: str = ''
FakeClarificationSchema ¤
ATTRIBUTE DESCRIPTION
prop

TYPE: str

prop class-attribute instance-attribute ¤
prop: str = ''
DummyDirect ¤
METHOD DESCRIPTION
async_executor
ainvoke
async_invoke_config_parsed
as_tool
invoke
get_output_schema
get_input_schema
ATTRIBUTE DESCRIPTION
name

TYPE: str

brain_args

TYPE: Dict[str, Any]

clarification_args

TYPE: Dict[str, Any]

computation_id

TYPE: str

description

TYPE: str

brain_schema

TYPE: FakeBrainSchema

result_schema

TYPE: FakeResultSchema

type

TYPE: Literal['skill.computation']

require_clarification

TYPE: bool

sub_type

TYPE: Literal['direct']

name class-attribute instance-attribute ¤
name: str = 'direct-skill'
brain_args class-attribute instance-attribute ¤
brain_args: Dict[str, Any] = dict
clarification_args class-attribute instance-attribute ¤
clarification_args: Dict[str, Any] = dict
computation_id class-attribute instance-attribute ¤
computation_id: str = '22222'
description class-attribute instance-attribute ¤
description: str = ''
brain_schema class-attribute instance-attribute ¤
brain_schema: FakeBrainSchema = FakeBrainSchema()
result_schema class-attribute instance-attribute ¤
type class-attribute instance-attribute ¤
type: Literal['skill.computation'] = 'skill.computation'
require_clarification class-attribute instance-attribute ¤
require_clarification: bool = False
sub_type class-attribute instance-attribute ¤
sub_type: Literal['direct'] = 'direct'
async_executor async ¤
async_executor(input, config)
ainvoke async ¤
ainvoke(input, config)
async_invoke_config_parsed async ¤
async_invoke_config_parsed(input: ComputationRequested, config_parsed: BaseModel, config_raw: RunnableConfig) -> ComputationResult[BrainSchema, ResultSchema]
as_tool ¤
as_tool() -> Dict[str, Any]
invoke ¤
invoke(input: ComputationRequested, config: RunnableConfig | None = None) -> ComputationResult[BrainSchema, ResultSchema]
get_output_schema ¤
get_output_schema(config: Optional[RunnableConfig] = None) -> Type[ResultSchema]
get_input_schema ¤
get_input_schema(config: Optional[RunnableConfig] = None) -> Type[BrainSchema]
test_process_computations_request_calls_execute_computations_pending async ¤
test_process_computations_request_calls_execute_computations_pending()
test_process_computations_request_passes_empty_pending async ¤
test_process_computations_request_passes_empty_pending()

muscle_base ¤

CLASS DESCRIPTION
MuscleBase

Handle the execution of the Skills.

ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤

log = get_logger()

Loger para el módulo

MuscleBase ¤

Handle the execution of the Skills.

Handle a queue of pending jobs and make the execution of each one.

Handle direct computations requested and computation that requires a clarification.

METHOD DESCRIPTION
invoke
async_invoke_config_parsed
ainvoke
ATTRIBUTE DESCRIPTION
name

TYPE: Optional[str]

agent_name

TYPE: str

skills

TYPE: List[SkillComputation]

config_specs

List configurable fields for this runnable.

TYPE: List[ConfigurableFieldSpec]

name class-attribute instance-attribute ¤
name: Optional[str] = 'cbr:muscle'
agent_name instance-attribute ¤
agent_name: str
skills class-attribute instance-attribute ¤
skills: List[SkillComputation] = []
config_specs property ¤
config_specs: List[ConfigurableFieldSpec]

List configurable fields for this runnable.

invoke ¤
invoke(input: MuscleInput, config: RunnableConfig | None = None) -> MuscleOutput
async_invoke_config_parsed async ¤
async_invoke_config_parsed(input: MuscleInput, config_parsed: BaseModel, config_raw: RunnableConfig) -> MuscleOutput
ainvoke async ¤
ainvoke(input: Input, config: Optional[RunnableConfig] = None) -> Output

muscle_base_test ¤

CLASS DESCRIPTION
SumInput
SumOutput
TransferBrainSchema
TransferClarification
TransferInput
TransferOutput
SumSkill
TransferSKill
MuscleFake
FUNCTION DESCRIPTION
create_message
base_use_case_srv

Fixture para proveer un falso servicio de base para los use cases

config_runtime
test_empty_computations
test_one_computation_with_clarification
test_one_computation_direct
test_one_clarification_response
test_one_clarification_response_with_other_computation
test_one_clarification_response_with_other_clarification
test_stream_one_computation_direct
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

sum_computation

log module-attribute ¤

log = get_logger()

Loger para el módulo

sum_computation module-attribute ¤

sum_computation = SumSkill()

SumInput ¤

ATTRIBUTE DESCRIPTION
number_1

TYPE: int

number_2

TYPE: int

registry_id

TYPE: str

number_1 instance-attribute ¤
number_1: int
number_2 instance-attribute ¤
number_2: int
registry_id cached property ¤
registry_id: str

SumOutput ¤

ATTRIBUTE DESCRIPTION
result

TYPE: int

result instance-attribute ¤
result: int

TransferBrainSchema ¤

ATTRIBUTE DESCRIPTION
from_account

TYPE: str

to_account

TYPE: str

registry_id

TYPE: str

from_account instance-attribute ¤
from_account: str
to_account instance-attribute ¤
to_account: str
registry_id cached property ¤
registry_id: str

TransferClarification ¤

ATTRIBUTE DESCRIPTION
confirmation

TYPE: Literal['y', 'n']

confirmation instance-attribute ¤
confirmation: Literal['y', 'n']

TransferInput ¤

ATTRIBUTE DESCRIPTION
from_account

TYPE: str

to_account

TYPE: str

confirmation

TYPE: Literal['y', 'n']

from_account instance-attribute ¤
from_account: str
to_account instance-attribute ¤
to_account: str
confirmation instance-attribute ¤
confirmation: Literal['y', 'n']

TransferOutput ¤

ATTRIBUTE DESCRIPTION
result

TYPE: str

new_balance

TYPE: int

result instance-attribute ¤
result: str
new_balance instance-attribute ¤
new_balance: int

SumSkill ¤

METHOD DESCRIPTION
async_executor
async_invoke_config_parsed
ainvoke
as_tool
invoke
get_output_schema
get_input_schema
ATTRIBUTE DESCRIPTION
name

TYPE: str

description

TYPE: str

brain_schema

TYPE: Type[SumInput]

result_schema

TYPE: Type[SumOutput]

config_specs

TYPE: List[ConfigurableFieldSpec]

type

TYPE: Literal['skill.computation']

require_clarification

TYPE: bool

sub_type

TYPE: Literal['direct']

name class-attribute instance-attribute ¤
name: str = 'sum'
description class-attribute instance-attribute ¤
description: str = 'given two numbers return the sum of both'
brain_schema class-attribute instance-attribute ¤
brain_schema: Type[SumInput] = SumInput
result_schema class-attribute instance-attribute ¤
result_schema: Type[SumOutput] = SumOutput
config_specs property ¤
config_specs: List[ConfigurableFieldSpec]
type class-attribute instance-attribute ¤
type: Literal['skill.computation'] = 'skill.computation'
require_clarification class-attribute instance-attribute ¤
require_clarification: bool = False
sub_type class-attribute instance-attribute ¤
sub_type: Literal['direct'] = 'direct'
async_executor async ¤
async_executor(request: SumInput, config: RunnableConfig) -> SumOutput
async_invoke_config_parsed async ¤
async_invoke_config_parsed(input: ComputationRequested, config_parsed: BaseModel, config_raw: RunnableConfig) -> ComputationResult[BrainSchema, ResultSchema]
ainvoke async ¤
ainvoke(input: Input, config: Optional[RunnableConfig] = None) -> Output
as_tool ¤
as_tool() -> Dict[str, Any]
invoke ¤
invoke(input: ComputationRequested, config: RunnableConfig | None = None) -> ComputationResult[BrainSchema, ResultSchema]
get_output_schema ¤
get_output_schema(config: Optional[RunnableConfig] = None) -> Type[ResultSchema]
get_input_schema ¤
get_input_schema(config: Optional[RunnableConfig] = None) -> Type[BrainSchema]

TransferSKill ¤

METHOD DESCRIPTION
async_executor
merge_brain_with_clarification
async_invoke_config_parsed
ainvoke
as_tool
invoke
get_output_schema
get_input_schema
get_clarification_schema
ATTRIBUTE DESCRIPTION
name

TYPE: str

description

TYPE: str

brain_schema

TYPE: Type[TransferBrainSchema]

result_schema

TYPE: Type[TransferOutput]

skill_input_schema

TYPE: Type[TransferInput]

clarification_schema

TYPE: Type[TransferClarification]

config_specs

List configurable fields for this runnable.

TYPE: List[ConfigurableFieldSpec]

type

TYPE: Literal['skill.computation']

require_clarification

TYPE: bool

sub_type

TYPE: Literal['with-clarification']

name class-attribute instance-attribute ¤
name: str = 'transfer'
description class-attribute instance-attribute ¤
description: str = 'transfer money between accounts'
brain_schema class-attribute instance-attribute ¤
result_schema class-attribute instance-attribute ¤
skill_input_schema class-attribute instance-attribute ¤
skill_input_schema: Type[TransferInput] = TransferInput
clarification_schema class-attribute instance-attribute ¤
config_specs property ¤
config_specs: List[ConfigurableFieldSpec]

List configurable fields for this runnable.

type class-attribute instance-attribute ¤
type: Literal['skill.computation'] = 'skill.computation'
require_clarification class-attribute instance-attribute ¤
require_clarification: bool = False
sub_type class-attribute instance-attribute ¤
sub_type: Literal['with-clarification'] = 'with-clarification'
async_executor async ¤
async_executor(request: TransferInput, config: RunnableConfig) -> TransferOutput
merge_brain_with_clarification ¤
merge_brain_with_clarification(brain_input: TransferBrainSchema, clarification_input: TransferClarification) -> TransferInput
async_invoke_config_parsed async ¤
async_invoke_config_parsed(input: ComputationRequestedWithClarification, config_parsed: BaseModel, config_raw: RunnableConfig) -> ComputationResult[SkillInputSchema, ResultSchema]
ainvoke async ¤
ainvoke(input: Input, config: Optional[RunnableConfig] = None) -> Output
as_tool ¤
as_tool() -> Dict[str, Any]
invoke ¤
invoke(input: ComputationRequested, config: RunnableConfig | None = None) -> ComputationResult[BrainSchema, ResultSchema]
get_output_schema ¤
get_output_schema(config: Optional[RunnableConfig] = None) -> Type[ResultSchema]
get_input_schema ¤
get_input_schema(config: Optional[RunnableConfig] = None) -> Type[BrainSchema]
get_clarification_schema ¤
get_clarification_schema(config: Optional[RunnableConfig] = None) -> Type[ClarificationSchema]

MuscleFake ¤

METHOD DESCRIPTION
async_invoke_config_parsed
ainvoke
invoke
ATTRIBUTE DESCRIPTION
agent_name

TYPE: str

skills

TYPE: List[Skill]

name

TYPE: Optional[str]

config_specs

List configurable fields for this runnable.

TYPE: List[ConfigurableFieldSpec]

agent_name class-attribute instance-attribute ¤
agent_name: str = 'Adam_Smith'
skills class-attribute instance-attribute ¤
skills: List[Skill] = [SumSkill(), TransferSKill()]
name class-attribute instance-attribute ¤
name: Optional[str] = 'cbr:muscle'
config_specs property ¤
config_specs: List[ConfigurableFieldSpec]

List configurable fields for this runnable.

async_invoke_config_parsed async ¤
async_invoke_config_parsed(input: MuscleInput, config_parsed: BaseModel, config_raw: RunnableConfig) -> MuscleOutput
ainvoke async ¤
ainvoke(input: Input, config: Optional[RunnableConfig] = None) -> Output
invoke ¤
invoke(input: MuscleInput, config: RunnableConfig | None = None) -> MuscleOutput

create_message ¤

create_message(content: str)

base_use_case_srv ¤

base_use_case_srv()

Fixture para proveer un falso servicio de base para los use cases

config_runtime ¤

config_runtime(base_use_case_srv)

test_empty_computations async ¤

test_empty_computations(config_runtime)

test_one_computation_with_clarification async ¤

test_one_computation_with_clarification(config_runtime)

test_one_computation_direct async ¤

test_one_computation_direct(config_runtime)

test_one_clarification_response async ¤

test_one_clarification_response(config_runtime)

test_one_clarification_response_with_other_computation async ¤

test_one_clarification_response_with_other_computation(config_runtime)

test_one_clarification_response_with_other_clarification async ¤

test_one_clarification_response_with_other_clarification(config_runtime)

test_stream_one_computation_direct async ¤

test_stream_one_computation_direct(config_runtime)

muscle_types ¤

CLASS DESCRIPTION
MuscleInputComputationRequested
MuscleInputClarificationResponse
MuscleOutputClarification
MuscleOutputResults
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

MuscleInput

Union discriminada para MuscleInput

MuscleInputAdapter

TYPE: TypeAdapter[MuscleInput]

MuscleOutput

Union discriminada para MuscleOutput

MuscleOutputAdapter

TYPE: TypeAdapter[MuscleOutput]

log module-attribute ¤

log = get_logger()

Loger para el módulo

MuscleInput module-attribute ¤

Union discriminada para MuscleInput

MuscleInputAdapter module-attribute ¤

MuscleInputAdapter: TypeAdapter[MuscleInput] = TypeAdapter(MuscleInput)

MuscleOutput module-attribute ¤

Union discriminada para MuscleOutput

MuscleOutputAdapter module-attribute ¤

MuscleOutputAdapter: TypeAdapter[MuscleOutput] = TypeAdapter(MuscleOutput)

MuscleInputComputationRequested ¤

ATTRIBUTE DESCRIPTION
type

TYPE: Literal['muscle.output.computations']

computations_required

TYPE: List[ComputationRequested]

type class-attribute instance-attribute ¤
type: Literal['muscle.output.computations'] = 'muscle.output.computations'
computations_required instance-attribute ¤
computations_required: List[ComputationRequested]

MuscleInputClarificationResponse ¤

ATTRIBUTE DESCRIPTION
type

TYPE: Literal['muscle.input.clarification']

clarification_message

TYPE: ClarificationMessage

type class-attribute instance-attribute ¤
type: Literal['muscle.input.clarification'] = 'muscle.input.clarification'
clarification_message instance-attribute ¤
clarification_message: ClarificationMessage

MuscleOutputClarification ¤

ATTRIBUTE DESCRIPTION
type

TYPE: Literal['muscle.output.clarification']

clarification_context

TYPE: ClarificationContext

clarification_requested

TYPE: SerializeAsAny[ClarificationRequested]

type class-attribute instance-attribute ¤
type: Literal['muscle.output.clarification'] = 'muscle.output.clarification'
clarification_context instance-attribute ¤
clarification_context: ClarificationContext
clarification_requested instance-attribute ¤
clarification_requested: SerializeAsAny[ClarificationRequested]

MuscleOutputResults ¤

ATTRIBUTE DESCRIPTION
type

TYPE: Literal['muscle.output.results']

computations_requested

TYPE: List[ComputationRequested]

computations_results

TYPE: List[ComputationResult]

type class-attribute instance-attribute ¤
type: Literal['muscle.output.results'] = 'muscle.output.results'
computations_requested class-attribute instance-attribute ¤
computations_requested: List[ComputationRequested] = []
computations_results class-attribute instance-attribute ¤
computations_results: List[ComputationResult] = []

performance ¤

MODULE DESCRIPTION
aptitude
aptitude_base
aptitude_result
aptitude_summary
challenge
evaluator
execution_context
loader_object
loader_strategy_base
organizer
organizer_base
performance_review
performance_review_base
performance_review_summary
perforrmance_review_result
reporter_adapter_base
reporter_console
reporter_null
score
CLASS DESCRIPTION
CollaborationAptitude
SkillSelectionAptitude
SkillInterpretationAptitude
FreeResponseAptitude
StructuredResponseAptitude
PerformanceReviewResult
PerformanceReview
LoaderStrategyBase
LoaderObject
ReporterAdapterBase
ReporterConsole
Organizer
ATTRIBUTE DESCRIPTION
AptitudeAdapter

TYPE: TypeAdapter[Aptitude]

Aptitude

AptitudeAdapter module-attribute ¤

AptitudeAdapter: TypeAdapter[Aptitude] = TypeAdapter(Aptitude)

__all__ module-attribute ¤

__all__ = ['Aptitude', 'AptitudeAdapter', 'CollaborationAptitude', 'FreeResponseAptitude', 'LoaderObject', 'LoaderStrategyBase', 'Organizer', 'PerformanceReview', 'PerformanceReviewResult', 'ReporterAdapterBase', 'ReporterConsole', 'SkillInterpretationAptitude', 'SkillSelectionAptitude', 'StructuredResponseAptitude']

CollaborationAptitude ¤

METHOD DESCRIPTION
execute
ATTRIBUTE DESCRIPTION
summary

TYPE: AptitudeSummary

type

TYPE: Literal['performance.aptitude.collaboration']

name

TYPE: str

challenges

TYPE: Optional[List[CollaborationChallenge]]

summary property ¤

summary: AptitudeSummary

type class-attribute instance-attribute ¤

type: Literal['performance.aptitude.collaboration'] = 'performance.aptitude.collaboration'

name class-attribute instance-attribute ¤

name: str = 'Collaboration'

challenges class-attribute instance-attribute ¤

challenges: Optional[List[CollaborationChallenge]] = None

execute async ¤

execute(context: ExecutionContext) -> AptitudeResult

SkillSelectionAptitude ¤

METHOD DESCRIPTION
execute
ATTRIBUTE DESCRIPTION
summary

TYPE: AptitudeSummary

type

TYPE: Literal['performance.aptitude.skill_selection']

name

TYPE: str

challenges

TYPE: Optional[List[SkillSelectionChallenge]]

summary property ¤

summary: AptitudeSummary

type class-attribute instance-attribute ¤

type: Literal['performance.aptitude.skill_selection'] = 'performance.aptitude.skill_selection'

name class-attribute instance-attribute ¤

name: str = 'Skill Selection'

challenges class-attribute instance-attribute ¤

challenges: Optional[List[SkillSelectionChallenge]] = None

execute async ¤

execute(context: ExecutionContext) -> AptitudeResult

SkillInterpretationAptitude ¤

METHOD DESCRIPTION
execute
ATTRIBUTE DESCRIPTION
summary

TYPE: AptitudeSummary

type

TYPE: Literal['performance.aptitude.skill_interpretation']

name

TYPE: str

challenges

TYPE: Optional[List[SkillInterpretationChallenge]]

summary property ¤

summary: AptitudeSummary

type class-attribute instance-attribute ¤

type: Literal['performance.aptitude.skill_interpretation'] = 'performance.aptitude.skill_interpretation'

name class-attribute instance-attribute ¤

name: str = 'Skill Interpretation'

challenges class-attribute instance-attribute ¤

execute async ¤

execute(context: ExecutionContext) -> AptitudeResult

FreeResponseAptitude ¤

METHOD DESCRIPTION
execute
ATTRIBUTE DESCRIPTION
summary

TYPE: AptitudeSummary

type

TYPE: Literal['performance.aptitude.free_response']

name

TYPE: str

challenges

TYPE: Optional[List[FreeResponseChallenge]]

summary property ¤

summary: AptitudeSummary

type class-attribute instance-attribute ¤

type: Literal['performance.aptitude.free_response'] = 'performance.aptitude.free_response'

name class-attribute instance-attribute ¤

name: str = 'Free Response'

challenges class-attribute instance-attribute ¤

challenges: Optional[List[FreeResponseChallenge]] = None

execute async ¤

execute(context: ExecutionContext) -> AptitudeResult

StructuredResponseAptitude ¤

METHOD DESCRIPTION
execute
ATTRIBUTE DESCRIPTION
summary

TYPE: AptitudeSummary

type

TYPE: Literal['performance.aptitude.structured_response']

name

TYPE: str

challenges

TYPE: Optional[List[StructuredResponseChallenge]]

summary property ¤

summary: AptitudeSummary

type class-attribute instance-attribute ¤

type: Literal['performance.aptitude.structured_response'] = 'performance.aptitude.structured_response'

name class-attribute instance-attribute ¤

name: str = 'Structured Response'

challenges class-attribute instance-attribute ¤

execute async ¤

execute(context: ExecutionContext) -> AptitudeResult

PerformanceReviewResult ¤

ATTRIBUTE DESCRIPTION
date

TYPE: datetime

result

TYPE: Dict[str, Any]

global_score

TYPE: int

version

TYPE: str

name

TYPE: str

date instance-attribute ¤

date: datetime

result instance-attribute ¤

result: Dict[str, Any]

global_score instance-attribute ¤

global_score: int

version instance-attribute ¤

version: str

name instance-attribute ¤

name: str

PerformanceReview ¤

METHOD DESCRIPTION
execute
ATTRIBUTE DESCRIPTION
name

TYPE: str

agent_name

TYPE: str

team

TYPE: TeamBase

aptitudes

TYPE: List[Aptitude]

reporter

TYPE: ReporterAdapterBase

summary

TYPE: PerformanceReviewSummary

name instance-attribute ¤

name: str

agent_name instance-attribute ¤

agent_name: str

team instance-attribute ¤

team: TeamBase

aptitudes instance-attribute ¤

aptitudes: List[Aptitude]

reporter instance-attribute ¤

summary property ¤

execute async ¤

execute(configuration: RunnableConfig) -> PerformanceReviewResult

LoaderStrategyBase ¤

METHOD DESCRIPTION
load_aptitudes

load_aptitudes abstractmethod ¤

load_aptitudes(llm_judge: Optional[BaseLanguageModel]) -> List[Aptitude]

LoaderObject ¤

METHOD DESCRIPTION
load_aptitudes
ATTRIBUTE DESCRIPTION
collaboration

TYPE: List[ChallengeRaw]

skill_selection

TYPE: List[ChallengeRaw]

skill_interpretation

TYPE: List[ChallengeRaw]

free_response

TYPE: List[ChallengeRaw]

structured_response

TYPE: List[ChallengeRaw]

collaboration class-attribute instance-attribute ¤

collaboration: List[ChallengeRaw] = []

skill_selection class-attribute instance-attribute ¤

skill_selection: List[ChallengeRaw] = []

skill_interpretation class-attribute instance-attribute ¤

skill_interpretation: List[ChallengeRaw] = []

free_response class-attribute instance-attribute ¤

free_response: List[ChallengeRaw] = []

structured_response class-attribute instance-attribute ¤

structured_response: List[ChallengeRaw] = []

load_aptitudes ¤

load_aptitudes(llm_judge: Optional[BaseLanguageModel]) -> List[Aptitude]

ReporterAdapterBase ¤

METHOD DESCRIPTION
start_performance
start_aptitude
start_challenge
end_challenge
end_aptitude
end_performance

start_performance abstractmethod ¤

start_performance(summary: PerformanceReviewSummary) -> None

start_aptitude abstractmethod ¤

start_aptitude(summary: AptitudeSummary) -> None

start_challenge abstractmethod ¤

start_challenge(summary: ChallengeSummary) -> None

end_challenge abstractmethod ¤

end_challenge(result: ChallengeResult) -> None

end_aptitude abstractmethod ¤

end_aptitude(result: AptitudeResult) -> None

end_performance abstractmethod ¤

end_performance(result: PerformanceReviewResult) -> None

ReporterConsole ¤

METHOD DESCRIPTION
start_performance
start_aptitude
start_challenge
end_challenge
end_aptitude
end_performance

start_performance ¤

start_performance(summary: PerformanceReviewSummary) -> None

start_aptitude ¤

start_aptitude(summary: AptitudeSummary) -> None

start_challenge ¤

start_challenge(summary: ChallengeSummary) -> None

end_challenge ¤

end_challenge(result: ChallengeResult) -> None

end_aptitude ¤

end_aptitude(result: AptitudeResult) -> None

end_performance ¤

end_performance(result: PerformanceReviewResult) -> None

Organizer ¤

METHOD DESCRIPTION
organize
ATTRIBUTE DESCRIPTION
team

TYPE: TeamBase

loader

TYPE: LoaderStrategyBase

reporter

TYPE: ReporterAdapterBase

llm_judge

TYPE: Optional[BaseLanguageModel]

team instance-attribute ¤

team: TeamBase

loader instance-attribute ¤

reporter class-attribute instance-attribute ¤

llm_judge class-attribute instance-attribute ¤

llm_judge: Optional[BaseLanguageModel] = None

organize ¤

organize(name: str, subject: str) -> PerformanceReview

aptitude ¤

CLASS DESCRIPTION
CollaborationAptitude
SkillSelectionAptitude
SkillInterpretationAptitude
FreeResponseAptitude
StructuredResponseAptitude
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

Aptitude

AptitudeAdapter

TYPE: TypeAdapter[Aptitude]

log module-attribute ¤

log = get_logger()

Loger para el módulo

AptitudeAdapter module-attribute ¤

AptitudeAdapter: TypeAdapter[Aptitude] = TypeAdapter(Aptitude)

CollaborationAptitude ¤

METHOD DESCRIPTION
execute
ATTRIBUTE DESCRIPTION
type

TYPE: Literal['performance.aptitude.collaboration']

name

TYPE: str

challenges

TYPE: Optional[List[CollaborationChallenge]]

summary

TYPE: AptitudeSummary

type class-attribute instance-attribute ¤
type: Literal['performance.aptitude.collaboration'] = 'performance.aptitude.collaboration'
name class-attribute instance-attribute ¤
name: str = 'Collaboration'
challenges class-attribute instance-attribute ¤
challenges: Optional[List[CollaborationChallenge]] = None
summary property ¤
summary: AptitudeSummary
execute async ¤
execute(context: ExecutionContext) -> AptitudeResult

SkillSelectionAptitude ¤

METHOD DESCRIPTION
execute
ATTRIBUTE DESCRIPTION
type

TYPE: Literal['performance.aptitude.skill_selection']

name

TYPE: str

challenges

TYPE: Optional[List[SkillSelectionChallenge]]

summary

TYPE: AptitudeSummary

type class-attribute instance-attribute ¤
type: Literal['performance.aptitude.skill_selection'] = 'performance.aptitude.skill_selection'
name class-attribute instance-attribute ¤
name: str = 'Skill Selection'
challenges class-attribute instance-attribute ¤
challenges: Optional[List[SkillSelectionChallenge]] = None
summary property ¤
summary: AptitudeSummary
execute async ¤
execute(context: ExecutionContext) -> AptitudeResult

SkillInterpretationAptitude ¤

METHOD DESCRIPTION
execute
ATTRIBUTE DESCRIPTION
type

TYPE: Literal['performance.aptitude.skill_interpretation']

name

TYPE: str

challenges

TYPE: Optional[List[SkillInterpretationChallenge]]

summary

TYPE: AptitudeSummary

type class-attribute instance-attribute ¤
type: Literal['performance.aptitude.skill_interpretation'] = 'performance.aptitude.skill_interpretation'
name class-attribute instance-attribute ¤
name: str = 'Skill Interpretation'
challenges class-attribute instance-attribute ¤
summary property ¤
summary: AptitudeSummary
execute async ¤
execute(context: ExecutionContext) -> AptitudeResult

FreeResponseAptitude ¤

METHOD DESCRIPTION
execute
ATTRIBUTE DESCRIPTION
type

TYPE: Literal['performance.aptitude.free_response']

name

TYPE: str

challenges

TYPE: Optional[List[FreeResponseChallenge]]

summary

TYPE: AptitudeSummary

type class-attribute instance-attribute ¤
type: Literal['performance.aptitude.free_response'] = 'performance.aptitude.free_response'
name class-attribute instance-attribute ¤
name: str = 'Free Response'
challenges class-attribute instance-attribute ¤
challenges: Optional[List[FreeResponseChallenge]] = None
summary property ¤
summary: AptitudeSummary
execute async ¤
execute(context: ExecutionContext) -> AptitudeResult

StructuredResponseAptitude ¤

METHOD DESCRIPTION
execute
ATTRIBUTE DESCRIPTION
type

TYPE: Literal['performance.aptitude.structured_response']

name

TYPE: str

challenges

TYPE: Optional[List[StructuredResponseChallenge]]

summary

TYPE: AptitudeSummary

type class-attribute instance-attribute ¤
type: Literal['performance.aptitude.structured_response'] = 'performance.aptitude.structured_response'
name class-attribute instance-attribute ¤
name: str = 'Structured Response'
challenges class-attribute instance-attribute ¤
summary property ¤
summary: AptitudeSummary
execute async ¤
execute(context: ExecutionContext) -> AptitudeResult

aptitude_base ¤

CLASS DESCRIPTION
AptitudeBase
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

ChallengeType

log module-attribute ¤

log = get_logger()

Loger para el módulo

ChallengeType module-attribute ¤

ChallengeType = TypeVar('ChallengeType', bound=ChallengeBase)

AptitudeBase ¤

METHOD DESCRIPTION
execute
ATTRIBUTE DESCRIPTION
challenges

TYPE: List[ChallengeType]

name

TYPE: str

summary

TYPE: AptitudeSummary

challenges instance-attribute ¤
challenges: List[ChallengeType]
name instance-attribute ¤
name: str
summary property ¤
summary: AptitudeSummary
execute async ¤
execute(context: ExecutionContext) -> AptitudeResult

aptitude_result ¤

CLASS DESCRIPTION
AptitudeResult
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤

log = get_logger()

Loger para el módulo

AptitudeResult ¤

ATTRIBUTE DESCRIPTION
score

TYPE: int

results

TYPE: Dict[int, ChallengeResult]

score instance-attribute ¤
score: int
results instance-attribute ¤

aptitude_summary ¤

CLASS DESCRIPTION
AptitudeSummary
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤

log = get_logger()

Loger para el módulo

AptitudeSummary ¤

ATTRIBUTE DESCRIPTION
name

TYPE: str

challenges

TYPE: int

name instance-attribute ¤
name: str
challenges instance-attribute ¤
challenges: int

challenge ¤

MODULE DESCRIPTION
challenge
challenge_base
challenge_result
challenge_summary
collaboration
free_response
skill_interpretation
skill_selection
skill_selection_test
structured_response
CLASS DESCRIPTION
ChallengeSummary
ChallengeResult
ChallengeBase
CollaborationChallenge
SkillInterpretationChallenge
SkillSelectionChallenge
FreeResponseChallenge
StructuredResponseChallenge
ATTRIBUTE DESCRIPTION
Challenge

ChallengeAdapter

TYPE: TypeAdapter[Challenge]

ChallengeAdapter module-attribute ¤

ChallengeAdapter: TypeAdapter[Challenge] = TypeAdapter(Challenge)

__all__ module-attribute ¤

__all__ = ['Challenge', 'ChallengeAdapter', 'ChallengeSummary', 'ChallengeResult', 'ChallengeBase', 'CollaborationChallenge', 'SkillInterpretationChallenge', 'SkillSelectionChallenge', 'FreeResponseChallenge', 'StructuredResponseChallenge']

ChallengeSummary ¤

ATTRIBUTE DESCRIPTION
idx

TYPE: int

description

TYPE: str

idx instance-attribute ¤
idx: int
description instance-attribute ¤
description: str

ChallengeResult ¤

ATTRIBUTE DESCRIPTION
score

TYPE: int

fixed_aspects

TYPE: Dict[str, Score]

dynamic_aspects

TYPE: Dict[str, Score]

score instance-attribute ¤
score: int
fixed_aspects instance-attribute ¤
fixed_aspects: Dict[str, Score]
dynamic_aspects class-attribute instance-attribute ¤
dynamic_aspects: Dict[str, Score] = {}

ChallengeBase ¤

METHOD DESCRIPTION
ensure_unique_evaluators
execute
ATTRIBUTE DESCRIPTION
index

TYPE: int

data

TYPE: ChallengePayload

evaluators

TYPE: List[Evaluator]

summary

TYPE: ChallengeSummary

index instance-attribute ¤
index: int
data instance-attribute ¤
evaluators instance-attribute ¤
evaluators: List[Evaluator]
summary abstractmethod property ¤
ensure_unique_evaluators ¤
ensure_unique_evaluators(values)
execute async ¤
execute(context: ExecutionContext) -> ChallengeResult

CollaborationChallenge ¤

METHOD DESCRIPTION
ensure_unique_evaluators
execute
ATTRIBUTE DESCRIPTION
index

TYPE: int

data

TYPE: ChallengePayload

evaluators

TYPE: List[Evaluator]

type

TYPE: Literal['performance.challenge.collaboration']

summary

TYPE: ChallengeSummary

index instance-attribute ¤
index: int
data instance-attribute ¤
evaluators instance-attribute ¤
evaluators: List[Evaluator]
type class-attribute instance-attribute ¤
type: Literal['performance.challenge.collaboration'] = 'performance.challenge.collaboration'
summary property ¤
ensure_unique_evaluators ¤
ensure_unique_evaluators(values)
execute async ¤
execute(context: ExecutionContext) -> ChallengeResult

SkillInterpretationChallenge ¤

METHOD DESCRIPTION
ensure_unique_evaluators
execute
ATTRIBUTE DESCRIPTION
index

TYPE: int

data

TYPE: ChallengePayload

evaluators

TYPE: List[Evaluator]

summary

TYPE: ChallengeSummary

type

TYPE: Literal['performance.challenge.skill_interpretation']

index instance-attribute ¤
index: int
data instance-attribute ¤
evaluators instance-attribute ¤
evaluators: List[Evaluator]
summary abstractmethod property ¤
type class-attribute instance-attribute ¤
type: Literal['performance.challenge.skill_interpretation'] = 'performance.challenge.skill_interpretation'
ensure_unique_evaluators ¤
ensure_unique_evaluators(values)
execute ¤
execute(context: ExecutionContext) -> ChallengeResult

SkillSelectionChallenge ¤

METHOD DESCRIPTION
ensure_unique_evaluators
execute
ATTRIBUTE DESCRIPTION
index

TYPE: int

data

TYPE: ChallengePayload

evaluators

TYPE: List[Evaluator]

type

TYPE: Literal['performance.challenge.skill_selection']

summary

TYPE: ChallengeSummary

index instance-attribute ¤
index: int
data instance-attribute ¤
evaluators instance-attribute ¤
evaluators: List[Evaluator]
type class-attribute instance-attribute ¤
type: Literal['performance.challenge.skill_selection'] = 'performance.challenge.skill_selection'
summary property ¤
ensure_unique_evaluators ¤
ensure_unique_evaluators(values)
execute async ¤
execute(context: ExecutionContext) -> ChallengeResult

FreeResponseChallenge ¤

METHOD DESCRIPTION
ensure_unique_evaluators
execute
ATTRIBUTE DESCRIPTION
index

TYPE: int

data

TYPE: ChallengePayload

evaluators

TYPE: List[Evaluator]

summary

TYPE: ChallengeSummary

type

TYPE: Literal['performance.challenge.free_response']

index instance-attribute ¤
index: int
data instance-attribute ¤
evaluators instance-attribute ¤
evaluators: List[Evaluator]
summary abstractmethod property ¤
type class-attribute instance-attribute ¤
type: Literal['performance.challenge.free_response'] = 'performance.challenge.free_response'
ensure_unique_evaluators ¤
ensure_unique_evaluators(values)
execute ¤
execute(context: ExecutionContext) -> ChallengeResult

StructuredResponseChallenge ¤

METHOD DESCRIPTION
ensure_unique_evaluators
execute
ATTRIBUTE DESCRIPTION
index

TYPE: int

data

TYPE: ChallengePayload

evaluators

TYPE: List[Evaluator]

summary

TYPE: ChallengeSummary

type

TYPE: Literal['performance.challenge.structured_response']

index instance-attribute ¤
index: int
data instance-attribute ¤
evaluators instance-attribute ¤
evaluators: List[Evaluator]
summary abstractmethod property ¤
type class-attribute instance-attribute ¤
type: Literal['performance.challenge.structured_response'] = 'performance.challenge.structured_response'
ensure_unique_evaluators ¤
ensure_unique_evaluators(values)
execute ¤
execute(context: ExecutionContext) -> ChallengeResult

challenge ¤

ATTRIBUTE DESCRIPTION
log

Loger para el módulo

Challenge

ChallengeAdapter

TYPE: TypeAdapter[Challenge]

log module-attribute ¤
log = get_logger()

Loger para el módulo

ChallengeAdapter module-attribute ¤
ChallengeAdapter: TypeAdapter[Challenge] = TypeAdapter(Challenge)

challenge_base ¤

CLASS DESCRIPTION
ChallengePayloadBase
ChallengeBase
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

ChallengePayload

log module-attribute ¤
log = get_logger()

Loger para el módulo

ChallengePayload module-attribute ¤
ChallengePayload = TypeVar('ChallengePayload', bound=ChallengePayloadBase)
ChallengePayloadBase ¤
ChallengeBase ¤
METHOD DESCRIPTION
ensure_unique_evaluators
execute
ATTRIBUTE DESCRIPTION
index

TYPE: int

data

TYPE: ChallengePayload

evaluators

TYPE: List[Evaluator]

summary

TYPE: ChallengeSummary

index instance-attribute ¤
index: int
data instance-attribute ¤
evaluators instance-attribute ¤
evaluators: List[Evaluator]
summary abstractmethod property ¤
ensure_unique_evaluators ¤
ensure_unique_evaluators(values)
execute async ¤
execute(context: ExecutionContext) -> ChallengeResult

challenge_result ¤

CLASS DESCRIPTION
ChallengeResult
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤
log = get_logger()

Loger para el módulo

ChallengeResult ¤
ATTRIBUTE DESCRIPTION
score

TYPE: int

fixed_aspects

TYPE: Dict[str, Score]

dynamic_aspects

TYPE: Dict[str, Score]

score instance-attribute ¤
score: int
fixed_aspects instance-attribute ¤
fixed_aspects: Dict[str, Score]
dynamic_aspects class-attribute instance-attribute ¤
dynamic_aspects: Dict[str, Score] = {}

challenge_summary ¤

CLASS DESCRIPTION
ChallengeSummary
ChallengeSummary ¤
ATTRIBUTE DESCRIPTION
idx

TYPE: int

description

TYPE: str

idx instance-attribute ¤
idx: int
description instance-attribute ¤
description: str

collaboration ¤

CLASS DESCRIPTION
CollaborationChallengePayload
CollaborationChallenge
FUNCTION DESCRIPTION
create_message
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤
log = get_logger()

Loger para el módulo

CollaborationChallengePayload ¤
ATTRIBUTE DESCRIPTION
user_name

TYPE: str

message_content

TYPE: str

message_to

TYPE: str

ideal

TYPE: str

user_name instance-attribute ¤
user_name: str
message_content instance-attribute ¤
message_content: str
message_to instance-attribute ¤
message_to: str
ideal instance-attribute ¤
ideal: str
CollaborationChallenge ¤
METHOD DESCRIPTION
ensure_unique_evaluators
execute
ATTRIBUTE DESCRIPTION
type

TYPE: Literal['performance.challenge.collaboration']

summary

TYPE: ChallengeSummary

index

TYPE: int

data

TYPE: ChallengePayload

evaluators

TYPE: List[Evaluator]

type class-attribute instance-attribute ¤
type: Literal['performance.challenge.collaboration'] = 'performance.challenge.collaboration'
summary property ¤
index instance-attribute ¤
index: int
data instance-attribute ¤
evaluators instance-attribute ¤
evaluators: List[Evaluator]
ensure_unique_evaluators ¤
ensure_unique_evaluators(values)
execute async ¤
execute(context: ExecutionContext) -> ChallengeResult
create_message ¤
create_message(content: str)

free_response ¤

CLASS DESCRIPTION
FreeResponseChallengePayload
FreeResponseChallenge
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤
log = get_logger()

Loger para el módulo

FreeResponseChallengePayload ¤
FreeResponseChallenge ¤
METHOD DESCRIPTION
execute
ensure_unique_evaluators
ATTRIBUTE DESCRIPTION
type

TYPE: Literal['performance.challenge.free_response']

index

TYPE: int

data

TYPE: ChallengePayload

evaluators

TYPE: List[Evaluator]

summary

TYPE: ChallengeSummary

type class-attribute instance-attribute ¤
type: Literal['performance.challenge.free_response'] = 'performance.challenge.free_response'
index instance-attribute ¤
index: int
data instance-attribute ¤
evaluators instance-attribute ¤
evaluators: List[Evaluator]
summary abstractmethod property ¤
execute ¤
execute(context: ExecutionContext) -> ChallengeResult
ensure_unique_evaluators ¤
ensure_unique_evaluators(values)

skill_interpretation ¤

CLASS DESCRIPTION
SkillInterpretationChallengePayload
SkillInterpretationChallenge
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤
log = get_logger()

Loger para el módulo

SkillInterpretationChallengePayload ¤
SkillInterpretationChallenge ¤
METHOD DESCRIPTION
execute
ensure_unique_evaluators
ATTRIBUTE DESCRIPTION
type

TYPE: Literal['performance.challenge.skill_interpretation']

index

TYPE: int

data

TYPE: ChallengePayload

evaluators

TYPE: List[Evaluator]

summary

TYPE: ChallengeSummary

type class-attribute instance-attribute ¤
type: Literal['performance.challenge.skill_interpretation'] = 'performance.challenge.skill_interpretation'
index instance-attribute ¤
index: int
data instance-attribute ¤
evaluators instance-attribute ¤
evaluators: List[Evaluator]
summary abstractmethod property ¤
execute ¤
execute(context: ExecutionContext) -> ChallengeResult
ensure_unique_evaluators ¤
ensure_unique_evaluators(values)

skill_selection ¤

CLASS DESCRIPTION
ExpectedSkill
SkillSelectionChallengePayload
SkillSelectionChallenge
FUNCTION DESCRIPTION
create_message
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤
log = get_logger()

Loger para el módulo

ExpectedSkill ¤
ATTRIBUTE DESCRIPTION
name

TYPE: str

arguments

TYPE: Dict[str, Any]

name instance-attribute ¤
name: str
arguments instance-attribute ¤
arguments: Dict[str, Any]
SkillSelectionChallengePayload ¤
ATTRIBUTE DESCRIPTION
expected_skills

TYPE: List[ExpectedSkill]

message_content

TYPE: str

user_name

TYPE: str

expected_skills instance-attribute ¤
expected_skills: List[ExpectedSkill]
message_content instance-attribute ¤
message_content: str
user_name instance-attribute ¤
user_name: str
SkillSelectionChallenge ¤
METHOD DESCRIPTION
ensure_unique_evaluators
execute
ATTRIBUTE DESCRIPTION
type

TYPE: Literal['performance.challenge.skill_selection']

summary

TYPE: ChallengeSummary

index

TYPE: int

data

TYPE: ChallengePayload

evaluators

TYPE: List[Evaluator]

type class-attribute instance-attribute ¤
type: Literal['performance.challenge.skill_selection'] = 'performance.challenge.skill_selection'
summary property ¤
index instance-attribute ¤
index: int
data instance-attribute ¤
evaluators instance-attribute ¤
evaluators: List[Evaluator]
ensure_unique_evaluators ¤
ensure_unique_evaluators(values)
execute async ¤
execute(context: ExecutionContext) -> ChallengeResult
create_message ¤
create_message(content: str)

skill_selection_test ¤

CLASS DESCRIPTION
MathInput
MathOutput
SumSkill
MultiplySkill
FUNCTION DESCRIPTION
fake_brain

Fixture para proveer el falso brain

context
test_invalid_expectations
test_partial_skill_selection
test_correct_skill_selection
test_none_correct_skill_selection
test_invalid_structure_for_arguments
test_non_equal_received_to_expected
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤
log = get_logger()

Loger para el módulo

MathInput ¤
ATTRIBUTE DESCRIPTION
number_1

TYPE: int

number_2

TYPE: int

registry_id

TYPE: str

number_1 instance-attribute ¤
number_1: int
number_2 instance-attribute ¤
number_2: int
registry_id cached property ¤
registry_id: str
MathOutput ¤
ATTRIBUTE DESCRIPTION
result

TYPE: int

result instance-attribute ¤
result: int
SumSkill ¤
METHOD DESCRIPTION
async_executor
async_invoke_config_parsed
ainvoke
as_tool
invoke
get_output_schema
get_input_schema
ATTRIBUTE DESCRIPTION
name

TYPE: str

description

TYPE: str

brain_schema

TYPE: Type[MathInput]

result_schema

TYPE: Type[MathOutput]

config_specs

TYPE: List[ConfigurableFieldSpec]

type

TYPE: Literal['skill.computation']

require_clarification

TYPE: bool

sub_type

TYPE: Literal['direct']

name class-attribute instance-attribute ¤
name: str = 'sum'
description class-attribute instance-attribute ¤
description: str = 'given two numbers return the sum of both'
brain_schema class-attribute instance-attribute ¤
brain_schema: Type[MathInput] = MathInput
result_schema class-attribute instance-attribute ¤
result_schema: Type[MathOutput] = MathOutput
config_specs property ¤
config_specs: List[ConfigurableFieldSpec]
type class-attribute instance-attribute ¤
type: Literal['skill.computation'] = 'skill.computation'
require_clarification class-attribute instance-attribute ¤
require_clarification: bool = False
sub_type class-attribute instance-attribute ¤
sub_type: Literal['direct'] = 'direct'
async_executor async ¤
async_executor(request: MathInput, config: RunnableConfig) -> MathOutput
async_invoke_config_parsed async ¤
async_invoke_config_parsed(input: ComputationRequested, config_parsed: BaseModel, config_raw: RunnableConfig) -> ComputationResult[BrainSchema, ResultSchema]
ainvoke async ¤
ainvoke(input: Input, config: Optional[RunnableConfig] = None) -> Output
as_tool ¤
as_tool() -> Dict[str, Any]
invoke ¤
invoke(input: ComputationRequested, config: RunnableConfig | None = None) -> ComputationResult[BrainSchema, ResultSchema]
get_output_schema ¤
get_output_schema(config: Optional[RunnableConfig] = None) -> Type[ResultSchema]
get_input_schema ¤
get_input_schema(config: Optional[RunnableConfig] = None) -> Type[BrainSchema]
MultiplySkill ¤
METHOD DESCRIPTION
async_executor
async_invoke_config_parsed
ainvoke
as_tool
invoke
get_output_schema
get_input_schema
ATTRIBUTE DESCRIPTION
name

TYPE: str

description

TYPE: str

brain_schema

TYPE: Type[MathInput]

result_schema

TYPE: Type[MathOutput]

config_specs

TYPE: List[ConfigurableFieldSpec]

type

TYPE: Literal['skill.computation']

require_clarification

TYPE: bool

sub_type

TYPE: Literal['direct']

name class-attribute instance-attribute ¤
name: str = 'multiply'
description class-attribute instance-attribute ¤
description: str = 'given two numbers return the multiply of both'
brain_schema class-attribute instance-attribute ¤
brain_schema: Type[MathInput] = MathInput
result_schema class-attribute instance-attribute ¤
result_schema: Type[MathOutput] = MathOutput
config_specs property ¤
config_specs: List[ConfigurableFieldSpec]
type class-attribute instance-attribute ¤
type: Literal['skill.computation'] = 'skill.computation'
require_clarification class-attribute instance-attribute ¤
require_clarification: bool = False
sub_type class-attribute instance-attribute ¤
sub_type: Literal['direct'] = 'direct'
async_executor async ¤
async_executor(request: MathInput, config: RunnableConfig) -> MathOutput
async_invoke_config_parsed async ¤
async_invoke_config_parsed(input: ComputationRequested, config_parsed: BaseModel, config_raw: RunnableConfig) -> ComputationResult[BrainSchema, ResultSchema]
ainvoke async ¤
ainvoke(input: Input, config: Optional[RunnableConfig] = None) -> Output
as_tool ¤
as_tool() -> Dict[str, Any]
invoke ¤
invoke(input: ComputationRequested, config: RunnableConfig | None = None) -> ComputationResult[BrainSchema, ResultSchema]
get_output_schema ¤
get_output_schema(config: Optional[RunnableConfig] = None) -> Type[ResultSchema]
get_input_schema ¤
get_input_schema(config: Optional[RunnableConfig] = None) -> Type[BrainSchema]
fake_brain ¤
fake_brain()

Fixture para proveer el falso brain

context ¤
context(fake_brain)
test_invalid_expectations async ¤
test_invalid_expectations(context)
test_partial_skill_selection async ¤
test_partial_skill_selection(context)
test_correct_skill_selection async ¤
test_correct_skill_selection(context)
test_none_correct_skill_selection async ¤
test_none_correct_skill_selection(context)
test_invalid_structure_for_arguments async ¤
test_invalid_structure_for_arguments(context)
test_non_equal_received_to_expected async ¤
test_non_equal_received_to_expected(context)

structured_response ¤

CLASS DESCRIPTION
StructuredResponseChallengePayload
StructuredResponseChallenge
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤
log = get_logger()

Loger para el módulo

StructuredResponseChallengePayload ¤
StructuredResponseChallenge ¤
METHOD DESCRIPTION
execute
ensure_unique_evaluators
ATTRIBUTE DESCRIPTION
type

TYPE: Literal['performance.challenge.structured_response']

index

TYPE: int

data

TYPE: ChallengePayload

evaluators

TYPE: List[Evaluator]

summary

TYPE: ChallengeSummary

type class-attribute instance-attribute ¤
type: Literal['performance.challenge.structured_response'] = 'performance.challenge.structured_response'
index instance-attribute ¤
index: int
data instance-attribute ¤
evaluators instance-attribute ¤
evaluators: List[Evaluator]
summary abstractmethod property ¤
execute ¤
execute(context: ExecutionContext) -> ChallengeResult
ensure_unique_evaluators ¤
ensure_unique_evaluators(values)

evaluator ¤

MODULE DESCRIPTION
evaluator
evaluator_base
model_based
rule_based
CLASS DESCRIPTION
EvaluatorBase
ContainEvaluator
IsInstanceEvaluator
MatchEvaluator
PydanticModelChecker
PydanticModelEquality
SubSetEvaluator
CorrectnessEvaluator
ATTRIBUTE DESCRIPTION
Evaluator

EvaluatorAdapter

TYPE: TypeAdapter[Evaluator]

EvaluatorAdapter module-attribute ¤

EvaluatorAdapter: TypeAdapter[Evaluator] = TypeAdapter(Evaluator)

__all__ module-attribute ¤

__all__ = ['ContainEvaluator', 'CorrectnessEvaluator', 'Evaluator', 'EvaluatorAdapter', 'EvaluatorBase', 'IsInstanceEvaluator', 'MatchEvaluator', 'PydanticModelChecker', 'PydanticModelEquality', 'SubSetEvaluator']

EvaluatorBase ¤

METHOD DESCRIPTION
evaluate
ATTRIBUTE DESCRIPTION
name

TYPE: str

name instance-attribute ¤
name: str
evaluate abstractmethod async ¤
evaluate(input: str, received: str, expected: str, alias: Optional[str] = None) -> Score

ContainEvaluator ¤

METHOD DESCRIPTION
evaluate
ATTRIBUTE DESCRIPTION
evaluator

TYPE: Literal['rule_based']

name

TYPE: Literal['contain']

evaluator class-attribute instance-attribute ¤
evaluator: Literal['rule_based'] = 'rule_based'
name class-attribute instance-attribute ¤
name: Literal['contain'] = 'contain'
evaluate async ¤
evaluate(input: str, received: str, expected: str, alias: Optional[str] = None) -> ScoreBooleanDirect

IsInstanceEvaluator ¤

METHOD DESCRIPTION
evaluate
ATTRIBUTE DESCRIPTION
evaluator

TYPE: Literal['rule_based']

name

TYPE: Literal['is_instance']

evaluator class-attribute instance-attribute ¤
evaluator: Literal['rule_based'] = 'rule_based'
name class-attribute instance-attribute ¤
name: Literal['is_instance'] = 'is_instance'
evaluate async ¤
evaluate(input: str, received: Any, expected: Type[Any], alias: Optional[str] = None) -> ScoreBooleanDirect

MatchEvaluator ¤

METHOD DESCRIPTION
evaluate
ATTRIBUTE DESCRIPTION
evaluator

TYPE: Literal['rule_based']

name

TYPE: Literal['match']

evaluator class-attribute instance-attribute ¤
evaluator: Literal['rule_based'] = 'rule_based'
name class-attribute instance-attribute ¤
name: Literal['match'] = 'match'
evaluate async ¤
evaluate(input: str, received: str, expected: str, alias: Optional[str] = None) -> ScoreBooleanDirect

PydanticModelChecker ¤

METHOD DESCRIPTION
evaluate
ATTRIBUTE DESCRIPTION
evaluator

TYPE: Literal['rule_based']

name

TYPE: Literal['contain']

model

TYPE: Type[BaseModel]

evaluator class-attribute instance-attribute ¤
evaluator: Literal['rule_based'] = 'rule_based'
name class-attribute instance-attribute ¤
name: Literal['contain'] = 'contain'
model instance-attribute ¤
model: Type[BaseModel]
evaluate async ¤
evaluate(input: str, received: Any, expected: Any, alias: Optional[str] = None) -> ScoreBooleanDirect

PydanticModelEquality ¤

METHOD DESCRIPTION
evaluate
ATTRIBUTE DESCRIPTION
evaluator

TYPE: Literal['rule_based']

name

TYPE: Literal['pydantic_model_equality']

model

TYPE: Type[BaseModel]

evaluator class-attribute instance-attribute ¤
evaluator: Literal['rule_based'] = 'rule_based'
name class-attribute instance-attribute ¤
name: Literal['pydantic_model_equality'] = 'pydantic_model_equality'
model instance-attribute ¤
model: Type[BaseModel]
evaluate async ¤
evaluate(input: str, received: Any, expected: Any, alias: Optional[str] = None) -> ScoreBooleanDirect

SubSetEvaluator ¤

METHOD DESCRIPTION
evaluate
ATTRIBUTE DESCRIPTION
evaluator

TYPE: Literal['rule_based']

name

TYPE: Literal['sub_set']

evaluator class-attribute instance-attribute ¤
evaluator: Literal['rule_based'] = 'rule_based'
name class-attribute instance-attribute ¤
name: Literal['sub_set'] = 'sub_set'
evaluate async ¤
evaluate(input: str, received: List[str], expected: List[str], alias: Optional[str] = None) -> ScorePercentDirect

CorrectnessEvaluator ¤

METHOD DESCRIPTION
evaluate
ATTRIBUTE DESCRIPTION
llm_judge

TYPE: BaseLanguageModel

evaluator

TYPE: Literal['model_based']

name

TYPE: Literal['correctness']

llm_judge instance-attribute ¤
llm_judge: BaseLanguageModel
evaluator class-attribute instance-attribute ¤
evaluator: Literal['model_based'] = 'model_based'
name class-attribute instance-attribute ¤
name: Literal['correctness'] = 'correctness'
evaluate async ¤
evaluate(input: str, received: str, expected: str, alias: Optional[str] = None) -> ScoreCategoricalBinary | ScoreError

evaluator ¤

ATTRIBUTE DESCRIPTION
log

Loger para el módulo

Evaluator

EvaluatorAdapter

TYPE: TypeAdapter[Evaluator]

log module-attribute ¤
log = get_logger()

Loger para el módulo

EvaluatorAdapter module-attribute ¤
EvaluatorAdapter: TypeAdapter[Evaluator] = TypeAdapter(Evaluator)

evaluator_base ¤

CLASS DESCRIPTION
EvaluatorBase
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤
log = get_logger()

Loger para el módulo

EvaluatorBase ¤
METHOD DESCRIPTION
evaluate
ATTRIBUTE DESCRIPTION
name

TYPE: str

name instance-attribute ¤
name: str
evaluate abstractmethod async ¤
evaluate(input: str, received: str, expected: str, alias: Optional[str] = None) -> Score

model_based ¤

MODULE DESCRIPTION
coherence
correctness
model_evaluator_base
toxicity
CLASS DESCRIPTION
CorrectnessEvaluator
ToxicityEvaluator
CoherenceEvaluator
__all__ module-attribute ¤
__all__ = ['CorrectnessEvaluator', 'ToxicityEvaluator', 'CoherenceEvaluator']
CorrectnessEvaluator ¤
METHOD DESCRIPTION
evaluate
ATTRIBUTE DESCRIPTION
llm_judge

TYPE: BaseLanguageModel

evaluator

TYPE: Literal['model_based']

name

TYPE: Literal['correctness']

llm_judge instance-attribute ¤
llm_judge: BaseLanguageModel
evaluator class-attribute instance-attribute ¤
evaluator: Literal['model_based'] = 'model_based'
name class-attribute instance-attribute ¤
name: Literal['correctness'] = 'correctness'
evaluate async ¤
evaluate(input: str, received: str, expected: str, alias: Optional[str] = None) -> ScoreCategoricalBinary | ScoreError
ToxicityEvaluator ¤
METHOD DESCRIPTION
evaluate
ATTRIBUTE DESCRIPTION
llm_judge

TYPE: BaseLanguageModel

evaluator

TYPE: Literal['model_based']

name

TYPE: Literal['toxicity']

llm_judge instance-attribute ¤
llm_judge: BaseLanguageModel
evaluator class-attribute instance-attribute ¤
evaluator: Literal['model_based'] = 'model_based'
name class-attribute instance-attribute ¤
name: Literal['toxicity'] = 'toxicity'
evaluate async ¤
evaluate(input: str, received: str, expected: str, alias: Optional[str] = None) -> ScorePercentInverse
CoherenceEvaluator ¤
METHOD DESCRIPTION
evaluate
ATTRIBUTE DESCRIPTION
llm_judge

TYPE: BaseLanguageModel

evaluator

TYPE: Literal['model_based']

name

TYPE: Literal['coherence']

llm_judge instance-attribute ¤
llm_judge: BaseLanguageModel
evaluator class-attribute instance-attribute ¤
evaluator: Literal['model_based'] = 'model_based'
name class-attribute instance-attribute ¤
name: Literal['coherence'] = 'coherence'
evaluate async ¤
evaluate(input: str, received: str, expected: str, alias: Optional[str] = None) -> ScorePercentDirect | ScoreError
coherence ¤
CLASS DESCRIPTION
OpenAIWrapper
CoherenceEvaluator
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤
log = get_logger()

Loger para el módulo

OpenAIWrapper ¤
OpenAIWrapper(llm_judge: BaseLanguageModel)
METHOD DESCRIPTION
load_model
generate
a_generate
get_model_name
ATTRIBUTE DESCRIPTION
llm_judge

llm_judge instance-attribute ¤
llm_judge = llm_judge
load_model ¤
load_model()
generate ¤
generate(prompt: str) -> str
a_generate async ¤
a_generate(prompt: str) -> str
get_model_name ¤
get_model_name()
CoherenceEvaluator ¤
METHOD DESCRIPTION
evaluate
ATTRIBUTE DESCRIPTION
name

TYPE: Literal['coherence']

llm_judge

TYPE: BaseLanguageModel

evaluator

TYPE: Literal['model_based']

name class-attribute instance-attribute ¤
name: Literal['coherence'] = 'coherence'
llm_judge instance-attribute ¤
llm_judge: BaseLanguageModel
evaluator class-attribute instance-attribute ¤
evaluator: Literal['model_based'] = 'model_based'
evaluate async ¤
evaluate(input: str, received: str, expected: str, alias: Optional[str] = None) -> ScorePercentDirect | ScoreError
correctness ¤
CLASS DESCRIPTION
CorrectnessEvaluator
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤
log = get_logger()

Loger para el módulo

CorrectnessEvaluator ¤
METHOD DESCRIPTION
evaluate
ATTRIBUTE DESCRIPTION
name

TYPE: Literal['correctness']

llm_judge

TYPE: BaseLanguageModel

evaluator

TYPE: Literal['model_based']

name class-attribute instance-attribute ¤
name: Literal['correctness'] = 'correctness'
llm_judge instance-attribute ¤
llm_judge: BaseLanguageModel
evaluator class-attribute instance-attribute ¤
evaluator: Literal['model_based'] = 'model_based'
evaluate async ¤
evaluate(input: str, received: str, expected: str, alias: Optional[str] = None) -> ScoreCategoricalBinary | ScoreError
model_evaluator_base ¤
CLASS DESCRIPTION
ModelEvaluatorBase
ModelEvaluatorBase ¤
METHOD DESCRIPTION
evaluate
ATTRIBUTE DESCRIPTION
llm_judge

TYPE: BaseLanguageModel

evaluator

TYPE: Literal['model_based']

name

TYPE: str

llm_judge instance-attribute ¤
llm_judge: BaseLanguageModel
evaluator class-attribute instance-attribute ¤
evaluator: Literal['model_based'] = 'model_based'
name instance-attribute ¤
name: str
evaluate abstractmethod async ¤
evaluate(input: str, received: str, expected: str, alias: Optional[str] = None) -> Score
toxicity ¤
CLASS DESCRIPTION
OpenAIWrapper
ToxicityEvaluator
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤
log = get_logger()

Loger para el módulo

OpenAIWrapper ¤
OpenAIWrapper(llm_judge: BaseLanguageModel)
METHOD DESCRIPTION
load_model
generate
a_generate
get_model_name
ATTRIBUTE DESCRIPTION
llm_judge

llm_judge instance-attribute ¤
llm_judge = llm_judge
load_model ¤
load_model()
generate ¤
generate(prompt: str) -> str
a_generate async ¤
a_generate(prompt: str) -> str
get_model_name ¤
get_model_name()
ToxicityEvaluator ¤
METHOD DESCRIPTION
evaluate
ATTRIBUTE DESCRIPTION
name

TYPE: Literal['toxicity']

llm_judge

TYPE: BaseLanguageModel

evaluator

TYPE: Literal['model_based']

name class-attribute instance-attribute ¤
name: Literal['toxicity'] = 'toxicity'
llm_judge instance-attribute ¤
llm_judge: BaseLanguageModel
evaluator class-attribute instance-attribute ¤
evaluator: Literal['model_based'] = 'model_based'
evaluate async ¤
evaluate(input: str, received: str, expected: str, alias: Optional[str] = None) -> ScorePercentInverse

rule_based ¤

MODULE DESCRIPTION
contain
is_instance
match
pydantic_model_checker
pydantic_model_checker_test
pydantic_model_equality
pydantic_model_equality_test
rule_evaluator_base
sub_set
CLASS DESCRIPTION
ContainEvaluator
MatchEvaluator
IsInstanceEvaluator
SubSetEvaluator
PydanticModelChecker
PydanticModelEquality
__all__ module-attribute ¤
__all__ = ['ContainEvaluator', 'IsInstanceEvaluator', 'MatchEvaluator', 'PydanticModelChecker', 'PydanticModelEquality', 'SubSetEvaluator']
ContainEvaluator ¤
METHOD DESCRIPTION
evaluate
ATTRIBUTE DESCRIPTION
evaluator

TYPE: Literal['rule_based']

name

TYPE: Literal['contain']

evaluator class-attribute instance-attribute ¤
evaluator: Literal['rule_based'] = 'rule_based'
name class-attribute instance-attribute ¤
name: Literal['contain'] = 'contain'
evaluate async ¤
evaluate(input: str, received: str, expected: str, alias: Optional[str] = None) -> ScoreBooleanDirect
MatchEvaluator ¤
METHOD DESCRIPTION
evaluate
ATTRIBUTE DESCRIPTION
evaluator

TYPE: Literal['rule_based']

name

TYPE: Literal['match']

evaluator class-attribute instance-attribute ¤
evaluator: Literal['rule_based'] = 'rule_based'
name class-attribute instance-attribute ¤
name: Literal['match'] = 'match'
evaluate async ¤
evaluate(input: str, received: str, expected: str, alias: Optional[str] = None) -> ScoreBooleanDirect
IsInstanceEvaluator ¤
METHOD DESCRIPTION
evaluate
ATTRIBUTE DESCRIPTION
evaluator

TYPE: Literal['rule_based']

name

TYPE: Literal['is_instance']

evaluator class-attribute instance-attribute ¤
evaluator: Literal['rule_based'] = 'rule_based'
name class-attribute instance-attribute ¤
name: Literal['is_instance'] = 'is_instance'
evaluate async ¤
evaluate(input: str, received: Any, expected: Type[Any], alias: Optional[str] = None) -> ScoreBooleanDirect
SubSetEvaluator ¤
METHOD DESCRIPTION
evaluate
ATTRIBUTE DESCRIPTION
evaluator

TYPE: Literal['rule_based']

name

TYPE: Literal['sub_set']

evaluator class-attribute instance-attribute ¤
evaluator: Literal['rule_based'] = 'rule_based'
name class-attribute instance-attribute ¤
name: Literal['sub_set'] = 'sub_set'
evaluate async ¤
evaluate(input: str, received: List[str], expected: List[str], alias: Optional[str] = None) -> ScorePercentDirect
PydanticModelChecker ¤
METHOD DESCRIPTION
evaluate
ATTRIBUTE DESCRIPTION
evaluator

TYPE: Literal['rule_based']

name

TYPE: Literal['contain']

model

TYPE: Type[BaseModel]

evaluator class-attribute instance-attribute ¤
evaluator: Literal['rule_based'] = 'rule_based'
name class-attribute instance-attribute ¤
name: Literal['contain'] = 'contain'
model instance-attribute ¤
model: Type[BaseModel]
evaluate async ¤
evaluate(input: str, received: Any, expected: Any, alias: Optional[str] = None) -> ScoreBooleanDirect
PydanticModelEquality ¤
METHOD DESCRIPTION
evaluate
ATTRIBUTE DESCRIPTION
evaluator

TYPE: Literal['rule_based']

name

TYPE: Literal['pydantic_model_equality']

model

TYPE: Type[BaseModel]

evaluator class-attribute instance-attribute ¤
evaluator: Literal['rule_based'] = 'rule_based'
name class-attribute instance-attribute ¤
name: Literal['pydantic_model_equality'] = 'pydantic_model_equality'
model instance-attribute ¤
model: Type[BaseModel]
evaluate async ¤
evaluate(input: str, received: Any, expected: Any, alias: Optional[str] = None) -> ScoreBooleanDirect
contain ¤
CLASS DESCRIPTION
ContainEvaluator
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤
log = get_logger()

Loger para el módulo

ContainEvaluator ¤
METHOD DESCRIPTION
evaluate
ATTRIBUTE DESCRIPTION
name

TYPE: Literal['contain']

evaluator

TYPE: Literal['rule_based']

name class-attribute instance-attribute ¤
name: Literal['contain'] = 'contain'
evaluator class-attribute instance-attribute ¤
evaluator: Literal['rule_based'] = 'rule_based'
evaluate async ¤
evaluate(input: str, received: str, expected: str, alias: Optional[str] = None) -> ScoreBooleanDirect
is_instance ¤
CLASS DESCRIPTION
IsInstanceEvaluator
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤
log = get_logger()

Loger para el módulo

IsInstanceEvaluator ¤
METHOD DESCRIPTION
evaluate
ATTRIBUTE DESCRIPTION
name

TYPE: Literal['is_instance']

evaluator

TYPE: Literal['rule_based']

name class-attribute instance-attribute ¤
name: Literal['is_instance'] = 'is_instance'
evaluator class-attribute instance-attribute ¤
evaluator: Literal['rule_based'] = 'rule_based'
evaluate async ¤
evaluate(input: str, received: Any, expected: Type[Any], alias: Optional[str] = None) -> ScoreBooleanDirect
match ¤
CLASS DESCRIPTION
MatchEvaluator
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤
log = get_logger()

Loger para el módulo

MatchEvaluator ¤
METHOD DESCRIPTION
evaluate
ATTRIBUTE DESCRIPTION
name

TYPE: Literal['match']

evaluator

TYPE: Literal['rule_based']

name class-attribute instance-attribute ¤
name: Literal['match'] = 'match'
evaluator class-attribute instance-attribute ¤
evaluator: Literal['rule_based'] = 'rule_based'
evaluate async ¤
evaluate(input: str, received: str, expected: str, alias: Optional[str] = None) -> ScoreBooleanDirect
pydantic_model_checker ¤
CLASS DESCRIPTION
PydanticModelChecker
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤
log = get_logger()

Loger para el módulo

PydanticModelChecker ¤
METHOD DESCRIPTION
evaluate
ATTRIBUTE DESCRIPTION
name

TYPE: Literal['contain']

model

TYPE: Type[BaseModel]

evaluator

TYPE: Literal['rule_based']

name class-attribute instance-attribute ¤
name: Literal['contain'] = 'contain'
model instance-attribute ¤
model: Type[BaseModel]
evaluator class-attribute instance-attribute ¤
evaluator: Literal['rule_based'] = 'rule_based'
evaluate async ¤
evaluate(input: str, received: Any, expected: Any, alias: Optional[str] = None) -> ScoreBooleanDirect
pydantic_model_checker_test ¤
CLASS DESCRIPTION
MyModel
FUNCTION DESCRIPTION
evaluator
test_received_none
test_alias_handling
test_string_received
test_json_invalid
test_json_valid
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤
log = get_logger()

Loger para el módulo

MyModel ¤
ATTRIBUTE DESCRIPTION
from_account

TYPE: str

to_account

TYPE: str

from_account instance-attribute ¤
from_account: str
to_account instance-attribute ¤
to_account: str
evaluator ¤
evaluator()
test_received_none async ¤
test_received_none(evaluator)
test_alias_handling async ¤
test_alias_handling(evaluator)
test_string_received async ¤
test_string_received(evaluator)
test_json_invalid async ¤
test_json_invalid(evaluator)
test_json_valid async ¤
test_json_valid(evaluator)
pydantic_model_equality ¤
CLASS DESCRIPTION
PydanticModelEquality
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤
log = get_logger()

Loger para el módulo

PydanticModelEquality ¤
METHOD DESCRIPTION
evaluate
ATTRIBUTE DESCRIPTION
name

TYPE: Literal['pydantic_model_equality']

model

TYPE: Type[BaseModel]

evaluator

TYPE: Literal['rule_based']

name class-attribute instance-attribute ¤
name: Literal['pydantic_model_equality'] = 'pydantic_model_equality'
model instance-attribute ¤
model: Type[BaseModel]
evaluator class-attribute instance-attribute ¤
evaluator: Literal['rule_based'] = 'rule_based'
evaluate async ¤
evaluate(input: str, received: Any, expected: Any, alias: Optional[str] = None) -> ScoreBooleanDirect
pydantic_model_equality_test ¤
CLASS DESCRIPTION
MyModel
FUNCTION DESCRIPTION
evaluator
test_evaluate_matching_models
test_evaluate_non_matching_models
test_evaluate_invalid_data
test_evaluate_alias_name
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤
log = get_logger()

Loger para el módulo

MyModel ¤
ATTRIBUTE DESCRIPTION
from_account

TYPE: str

to_account

TYPE: str

from_account instance-attribute ¤
from_account: str
to_account instance-attribute ¤
to_account: str
evaluator ¤
evaluator()
test_evaluate_matching_models async ¤
test_evaluate_matching_models(evaluator)
test_evaluate_non_matching_models async ¤
test_evaluate_non_matching_models(evaluator)
test_evaluate_invalid_data async ¤
test_evaluate_invalid_data(evaluator)
test_evaluate_alias_name async ¤
test_evaluate_alias_name(evaluator)
rule_evaluator_base ¤
CLASS DESCRIPTION
RuleEvaluatorBase
RuleEvaluatorBase ¤
METHOD DESCRIPTION
evaluate
ATTRIBUTE DESCRIPTION
evaluator

TYPE: Literal['rule_based']

name

TYPE: str

evaluator class-attribute instance-attribute ¤
evaluator: Literal['rule_based'] = 'rule_based'
name instance-attribute ¤
name: str
evaluate abstractmethod async ¤
evaluate(input: str, received: str, expected: str, alias: Optional[str] = None) -> Score
sub_set ¤
CLASS DESCRIPTION
SubSetEvaluator
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤
log = get_logger()

Loger para el módulo

SubSetEvaluator ¤
METHOD DESCRIPTION
evaluate
ATTRIBUTE DESCRIPTION
name

TYPE: Literal['sub_set']

evaluator

TYPE: Literal['rule_based']

name class-attribute instance-attribute ¤
name: Literal['sub_set'] = 'sub_set'
evaluator class-attribute instance-attribute ¤
evaluator: Literal['rule_based'] = 'rule_based'
evaluate async ¤
evaluate(input: str, received: List[str], expected: List[str], alias: Optional[str] = None) -> ScorePercentDirect

execution_context ¤

CLASS DESCRIPTION
ExecutionContext
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤

log = get_logger()

Loger para el módulo

ExecutionContext ¤

ATTRIBUTE DESCRIPTION
brain

TYPE: BrainBase

configuration

TYPE: RunnableConfig

reporter

TYPE: ReporterAdapterBase

brain instance-attribute ¤
brain: BrainBase
configuration instance-attribute ¤
configuration: RunnableConfig
reporter instance-attribute ¤

loader_object ¤

CLASS DESCRIPTION
LoaderObject
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

ChallengeRaw

log module-attribute ¤

log = get_logger()

Loger para el módulo

ChallengeRaw module-attribute ¤

ChallengeRaw = Dict[str, Any]

LoaderObject ¤

METHOD DESCRIPTION
load_aptitudes
ATTRIBUTE DESCRIPTION
collaboration

TYPE: List[ChallengeRaw]

skill_selection

TYPE: List[ChallengeRaw]

skill_interpretation

TYPE: List[ChallengeRaw]

free_response

TYPE: List[ChallengeRaw]

structured_response

TYPE: List[ChallengeRaw]

collaboration class-attribute instance-attribute ¤
collaboration: List[ChallengeRaw] = []
skill_selection class-attribute instance-attribute ¤
skill_selection: List[ChallengeRaw] = []
skill_interpretation class-attribute instance-attribute ¤
skill_interpretation: List[ChallengeRaw] = []
free_response class-attribute instance-attribute ¤
free_response: List[ChallengeRaw] = []
structured_response class-attribute instance-attribute ¤
structured_response: List[ChallengeRaw] = []
load_aptitudes ¤
load_aptitudes(llm_judge: Optional[BaseLanguageModel]) -> List[Aptitude]

loader_strategy_base ¤

CLASS DESCRIPTION
LoaderStrategyBase
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤

log = get_logger()

Loger para el módulo

LoaderStrategyBase ¤

METHOD DESCRIPTION
load_aptitudes
load_aptitudes abstractmethod ¤
load_aptitudes(llm_judge: Optional[BaseLanguageModel]) -> List[Aptitude]

organizer ¤

CLASS DESCRIPTION
Organizer
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤

log = get_logger()

Loger para el módulo

Organizer ¤

METHOD DESCRIPTION
organize
ATTRIBUTE DESCRIPTION
team

TYPE: TeamBase

loader

TYPE: LoaderStrategyBase

reporter

TYPE: ReporterAdapterBase

llm_judge

TYPE: Optional[BaseLanguageModel]

team instance-attribute ¤
team: TeamBase
loader instance-attribute ¤
reporter class-attribute instance-attribute ¤
llm_judge class-attribute instance-attribute ¤
llm_judge: Optional[BaseLanguageModel] = None
organize ¤
organize(name: str, subject: str) -> PerformanceReview

organizer_base ¤

CLASS DESCRIPTION
OrganizerBase
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤

log = get_logger()

Loger para el módulo

OrganizerBase ¤

METHOD DESCRIPTION
organize
ATTRIBUTE DESCRIPTION
team

TYPE: TeamBase

loader

TYPE: LoaderStrategyBase

reporter

TYPE: ReporterAdapterBase

llm_judge

TYPE: Optional[BaseLanguageModel]

team instance-attribute ¤
team: TeamBase
loader instance-attribute ¤
reporter class-attribute instance-attribute ¤
llm_judge class-attribute instance-attribute ¤
llm_judge: Optional[BaseLanguageModel] = None
organize abstractmethod ¤
organize(name: str, subject: str, config_runtime: RunnableConfig) -> PerformanceReviewBase

performance_review ¤

CLASS DESCRIPTION
PerformanceReview
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤

log = get_logger()

Loger para el módulo

PerformanceReview ¤

METHOD DESCRIPTION
execute
ATTRIBUTE DESCRIPTION
name

TYPE: str

agent_name

TYPE: str

team

TYPE: TeamBase

aptitudes

TYPE: List[Aptitude]

reporter

TYPE: ReporterAdapterBase

summary

TYPE: PerformanceReviewSummary

name instance-attribute ¤
name: str
agent_name instance-attribute ¤
agent_name: str
team instance-attribute ¤
team: TeamBase
aptitudes instance-attribute ¤
aptitudes: List[Aptitude]
reporter instance-attribute ¤
summary property ¤
execute async ¤
execute(configuration: RunnableConfig) -> PerformanceReviewResult

performance_review_base ¤

CLASS DESCRIPTION
PerformanceReviewBase

PerformanceReviewBase ¤

METHOD DESCRIPTION
execute
ATTRIBUTE DESCRIPTION
name

TYPE: str

agent_name

TYPE: str

team

TYPE: TeamBase

aptitudes

TYPE: List[Aptitude]

reporter

TYPE: ReporterAdapterBase

summary

TYPE: PerformanceReviewSummary

name instance-attribute ¤
name: str
agent_name instance-attribute ¤
agent_name: str
team instance-attribute ¤
team: TeamBase
aptitudes instance-attribute ¤
aptitudes: List[Aptitude]
reporter instance-attribute ¤
summary property ¤
execute abstractmethod async ¤
execute(runnable_configuration: RunnableConfig) -> PerformanceReviewResult

performance_review_summary ¤

CLASS DESCRIPTION
PerformanceReviewSummary
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤

log = get_logger()

Loger para el módulo

PerformanceReviewSummary ¤

ATTRIBUTE DESCRIPTION
name

TYPE: str

agent_name

TYPE: str

aptitudes

TYPE: int

name instance-attribute ¤
name: str
agent_name instance-attribute ¤
agent_name: str
aptitudes instance-attribute ¤
aptitudes: int

perforrmance_review_result ¤

CLASS DESCRIPTION
PerformanceReviewResult

PerformanceReviewResult ¤

ATTRIBUTE DESCRIPTION
date

TYPE: datetime

result

TYPE: Dict[str, Any]

global_score

TYPE: int

version

TYPE: str

name

TYPE: str

date instance-attribute ¤
date: datetime
result instance-attribute ¤
result: Dict[str, Any]
global_score instance-attribute ¤
global_score: int
version instance-attribute ¤
version: str
name instance-attribute ¤
name: str

reporter_adapter_base ¤

CLASS DESCRIPTION
ReporterAdapterBase
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤

log = get_logger()

Loger para el módulo

ReporterAdapterBase ¤

METHOD DESCRIPTION
start_performance
start_aptitude
start_challenge
end_challenge
end_aptitude
end_performance
start_performance abstractmethod ¤
start_performance(summary: PerformanceReviewSummary) -> None
start_aptitude abstractmethod ¤
start_aptitude(summary: AptitudeSummary) -> None
start_challenge abstractmethod ¤
start_challenge(summary: ChallengeSummary) -> None
end_challenge abstractmethod ¤
end_challenge(result: ChallengeResult) -> None
end_aptitude abstractmethod ¤
end_aptitude(result: AptitudeResult) -> None
end_performance abstractmethod ¤
end_performance(result: PerformanceReviewResult) -> None

reporter_console ¤

CLASS DESCRIPTION
ReporterConsole
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤

log = get_logger()

Loger para el módulo

ReporterConsole ¤

METHOD DESCRIPTION
start_performance
start_aptitude
start_challenge
end_challenge
end_aptitude
end_performance
start_performance ¤
start_performance(summary: PerformanceReviewSummary) -> None
start_aptitude ¤
start_aptitude(summary: AptitudeSummary) -> None
start_challenge ¤
start_challenge(summary: ChallengeSummary) -> None
end_challenge ¤
end_challenge(result: ChallengeResult) -> None
end_aptitude ¤
end_aptitude(result: AptitudeResult) -> None
end_performance ¤
end_performance(result: PerformanceReviewResult) -> None

reporter_null ¤

CLASS DESCRIPTION
ReporterNull
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤

log = get_logger()

Loger para el módulo

ReporterNull ¤

METHOD DESCRIPTION
start_performance
start_aptitude
start_challenge
end_challenge
end_aptitude
end_performance
start_performance ¤
start_performance(summary: PerformanceReviewSummary) -> None
start_aptitude ¤
start_aptitude(summary: AptitudeSummary) -> None
start_challenge ¤
start_challenge(summary: ChallengeSummary) -> None
end_challenge ¤
end_challenge(result: ChallengeResult) -> None
end_aptitude ¤
end_aptitude(result: AptitudeResult) -> None
end_performance ¤
end_performance(result: PerformanceReviewResult) -> None

score ¤

MODULE DESCRIPTION
score
score_base
CLASS DESCRIPTION
ScoreBase
ScoreBoolean
ScoreBooleanDirect
ScoreBooleanInverse
ScoreCategorialInverse
ScoreCategorical
ScoreCategoricalBinary
ScoreCategoricalDirect
ScoreError
ScorePercent
ScorePercentDirect
ScorePercentInverse
ATTRIBUTE DESCRIPTION
Score

ScoreAdapter

TYPE: TypeAdapter[Score]

Score module-attribute ¤

ScoreAdapter module-attribute ¤

ScoreAdapter: TypeAdapter[Score] = TypeAdapter(Score)

__all__ module-attribute ¤

__all__ = ['Score', 'ScoreAdapter', 'ScoreBase', 'ScoreBoolean', 'ScoreCategoricalBinary', 'ScoreBooleanDirect', 'ScoreBooleanInverse', 'ScoreCategorialInverse', 'ScoreCategorical', 'ScoreCategoricalDirect', 'ScoreError', 'ScorePercent', 'ScorePercentDirect', 'ScorePercentInverse']

ScoreBase ¤

ATTRIBUTE DESCRIPTION
name

TYPE: str

explanation

TYPE: Optional[str]

points

TYPE: Percent

name instance-attribute ¤
name: str
explanation class-attribute instance-attribute ¤
explanation: Optional[str] = None
points abstractmethod property ¤
points: Percent

ScoreBoolean ¤

ATTRIBUTE DESCRIPTION
name

TYPE: str

explanation

TYPE: Optional[str]

points

TYPE: Percent

type

TYPE: Literal['performance.challenge.score.boolean']

value

TYPE: bool

name instance-attribute ¤
name: str
explanation class-attribute instance-attribute ¤
explanation: Optional[str] = None
points abstractmethod property ¤
points: Percent
type class-attribute instance-attribute ¤
type: Literal['performance.challenge.score.boolean'] = 'performance.challenge.score.boolean'
value instance-attribute ¤
value: bool

ScoreBooleanDirect ¤

ATTRIBUTE DESCRIPTION
name

TYPE: str

explanation

TYPE: Optional[str]

type

TYPE: Literal['performance.challenge.score.boolean']

value

TYPE: bool

points

TYPE: Percent

name instance-attribute ¤
name: str
explanation class-attribute instance-attribute ¤
explanation: Optional[str] = None
type class-attribute instance-attribute ¤
type: Literal['performance.challenge.score.boolean'] = 'performance.challenge.score.boolean'
value instance-attribute ¤
value: bool
points property ¤
points: Percent

ScoreBooleanInverse ¤

ATTRIBUTE DESCRIPTION
name

TYPE: str

explanation

TYPE: Optional[str]

type

TYPE: Literal['performance.challenge.score.boolean']

value

TYPE: bool

points

TYPE: Percent

name instance-attribute ¤
name: str
explanation class-attribute instance-attribute ¤
explanation: Optional[str] = None
type class-attribute instance-attribute ¤
type: Literal['performance.challenge.score.boolean'] = 'performance.challenge.score.boolean'
value instance-attribute ¤
value: bool
points property ¤
points: Percent

ScoreCategorialInverse ¤

ATTRIBUTE DESCRIPTION
name

TYPE: str

explanation

TYPE: Optional[str]

type

TYPE: Literal['performance.challenge.score.categorical']

value

TYPE: List[CategoryName]

max_categories_allowed

TYPE: int

points

TYPE: Percent

name instance-attribute ¤
name: str
explanation class-attribute instance-attribute ¤
explanation: Optional[str] = None
type class-attribute instance-attribute ¤
type: Literal['performance.challenge.score.categorical'] = 'performance.challenge.score.categorical'
value instance-attribute ¤
max_categories_allowed class-attribute instance-attribute ¤
max_categories_allowed: int = Field(ge=1, le=10)
points property ¤
points: Percent

ScoreCategorical ¤

ATTRIBUTE DESCRIPTION
name

TYPE: str

explanation

TYPE: Optional[str]

points

TYPE: Percent

type

TYPE: Literal['performance.challenge.score.categorical']

value

TYPE: List[CategoryName]

max_categories_allowed

TYPE: int

name instance-attribute ¤
name: str
explanation class-attribute instance-attribute ¤
explanation: Optional[str] = None
points abstractmethod property ¤
points: Percent
type class-attribute instance-attribute ¤
type: Literal['performance.challenge.score.categorical'] = 'performance.challenge.score.categorical'
value instance-attribute ¤
max_categories_allowed class-attribute instance-attribute ¤
max_categories_allowed: int = Field(ge=1, le=10)

ScoreCategoricalBinary ¤

ATTRIBUTE DESCRIPTION
name

TYPE: str

explanation

TYPE: Optional[str]

type

TYPE: Literal['performance.challenge.score.categorical']

value

TYPE: List[CategoryName]

max_categories_allowed

TYPE: int

correct_categories

TYPE: List[CategoryName]

points

TYPE: Percent

name instance-attribute ¤
name: str
explanation class-attribute instance-attribute ¤
explanation: Optional[str] = None
type class-attribute instance-attribute ¤
type: Literal['performance.challenge.score.categorical'] = 'performance.challenge.score.categorical'
value instance-attribute ¤
max_categories_allowed class-attribute instance-attribute ¤
max_categories_allowed: int = 1
correct_categories instance-attribute ¤
correct_categories: List[CategoryName]
points property ¤
points: Percent

ScoreCategoricalDirect ¤

ATTRIBUTE DESCRIPTION
name

TYPE: str

explanation

TYPE: Optional[str]

type

TYPE: Literal['performance.challenge.score.categorical']

value

TYPE: List[CategoryName]

max_categories_allowed

TYPE: int

points

TYPE: Percent

name instance-attribute ¤
name: str
explanation class-attribute instance-attribute ¤
explanation: Optional[str] = None
type class-attribute instance-attribute ¤
type: Literal['performance.challenge.score.categorical'] = 'performance.challenge.score.categorical'
value instance-attribute ¤
max_categories_allowed class-attribute instance-attribute ¤
max_categories_allowed: int = Field(ge=1, le=10)
points property ¤
points: Percent

ScoreError ¤

ATTRIBUTE DESCRIPTION
name

TYPE: str

explanation

TYPE: Optional[str]

type

TYPE: Literal['performance.challenge.score.error']

source

TYPE: Any

points

TYPE: Percent

name instance-attribute ¤
name: str
explanation class-attribute instance-attribute ¤
explanation: Optional[str] = None
type class-attribute instance-attribute ¤
type: Literal['performance.challenge.score.error'] = 'performance.challenge.score.error'
source instance-attribute ¤
source: Any
points property ¤
points: Percent

ScorePercent ¤

ATTRIBUTE DESCRIPTION
name

TYPE: str

explanation

TYPE: Optional[str]

points

TYPE: Percent

type

TYPE: Literal['performance.challenge.score.percent']

value

TYPE: int

name instance-attribute ¤
name: str
explanation class-attribute instance-attribute ¤
explanation: Optional[str] = None
points abstractmethod property ¤
points: Percent
type class-attribute instance-attribute ¤
type: Literal['performance.challenge.score.percent'] = 'performance.challenge.score.percent'
value class-attribute instance-attribute ¤
value: int = Field(ge=0, le=100)

ScorePercentDirect ¤

ATTRIBUTE DESCRIPTION
name

TYPE: str

explanation

TYPE: Optional[str]

type

TYPE: Literal['performance.challenge.score.percent']

value

TYPE: int

points

TYPE: Percent

name instance-attribute ¤
name: str
explanation class-attribute instance-attribute ¤
explanation: Optional[str] = None
type class-attribute instance-attribute ¤
type: Literal['performance.challenge.score.percent'] = 'performance.challenge.score.percent'
value class-attribute instance-attribute ¤
value: int = Field(ge=0, le=100)
points property ¤
points: Percent

ScorePercentInverse ¤

ATTRIBUTE DESCRIPTION
name

TYPE: str

explanation

TYPE: Optional[str]

type

TYPE: Literal['performance.challenge.score.percent']

value

TYPE: int

points

TYPE: Percent

name instance-attribute ¤
name: str
explanation class-attribute instance-attribute ¤
explanation: Optional[str] = None
type class-attribute instance-attribute ¤
type: Literal['performance.challenge.score.percent'] = 'performance.challenge.score.percent'
value class-attribute instance-attribute ¤
value: int = Field(ge=0, le=100)
points property ¤
points: Percent

score ¤

CLASS DESCRIPTION
ScorePercent
ScorePercentDirect
ScorePercentInverse
ScoreBoolean
ScoreBooleanDirect
ScoreBooleanInverse
ScoreCategorical
ScoreCategoricalDirect
ScoreCategorialInverse
ScoreCategoricalBinary
ScoreError
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

CategoryName

Score

ScoreAdapter

TYPE: TypeAdapter[Score]

log module-attribute ¤
log = get_logger()

Loger para el módulo

CategoryName module-attribute ¤
CategoryName = str
Score module-attribute ¤
ScoreAdapter module-attribute ¤
ScoreAdapter: TypeAdapter[Score] = TypeAdapter(Score)
ScorePercent ¤
ATTRIBUTE DESCRIPTION
type

TYPE: Literal['performance.challenge.score.percent']

value

TYPE: int

name

TYPE: str

explanation

TYPE: Optional[str]

points

TYPE: Percent

type class-attribute instance-attribute ¤
type: Literal['performance.challenge.score.percent'] = 'performance.challenge.score.percent'
value class-attribute instance-attribute ¤
value: int = Field(ge=0, le=100)
name instance-attribute ¤
name: str
explanation class-attribute instance-attribute ¤
explanation: Optional[str] = None
points abstractmethod property ¤
points: Percent
ScorePercentDirect ¤
ATTRIBUTE DESCRIPTION
points

TYPE: Percent

name

TYPE: str

explanation

TYPE: Optional[str]

type

TYPE: Literal['performance.challenge.score.percent']

value

TYPE: int

points property ¤
points: Percent
name instance-attribute ¤
name: str
explanation class-attribute instance-attribute ¤
explanation: Optional[str] = None
type class-attribute instance-attribute ¤
type: Literal['performance.challenge.score.percent'] = 'performance.challenge.score.percent'
value class-attribute instance-attribute ¤
value: int = Field(ge=0, le=100)
ScorePercentInverse ¤
ATTRIBUTE DESCRIPTION
points

TYPE: Percent

name

TYPE: str

explanation

TYPE: Optional[str]

type

TYPE: Literal['performance.challenge.score.percent']

value

TYPE: int

points property ¤
points: Percent
name instance-attribute ¤
name: str
explanation class-attribute instance-attribute ¤
explanation: Optional[str] = None
type class-attribute instance-attribute ¤
type: Literal['performance.challenge.score.percent'] = 'performance.challenge.score.percent'
value class-attribute instance-attribute ¤
value: int = Field(ge=0, le=100)
ScoreBoolean ¤
ATTRIBUTE DESCRIPTION
type

TYPE: Literal['performance.challenge.score.boolean']

value

TYPE: bool

name

TYPE: str

explanation

TYPE: Optional[str]

points

TYPE: Percent

type class-attribute instance-attribute ¤
type: Literal['performance.challenge.score.boolean'] = 'performance.challenge.score.boolean'
value instance-attribute ¤
value: bool
name instance-attribute ¤
name: str
explanation class-attribute instance-attribute ¤
explanation: Optional[str] = None
points abstractmethod property ¤
points: Percent
ScoreBooleanDirect ¤
ATTRIBUTE DESCRIPTION
points

TYPE: Percent

name

TYPE: str

explanation

TYPE: Optional[str]

type

TYPE: Literal['performance.challenge.score.boolean']

value

TYPE: bool

points property ¤
points: Percent
name instance-attribute ¤
name: str
explanation class-attribute instance-attribute ¤
explanation: Optional[str] = None
type class-attribute instance-attribute ¤
type: Literal['performance.challenge.score.boolean'] = 'performance.challenge.score.boolean'
value instance-attribute ¤
value: bool
ScoreBooleanInverse ¤
ATTRIBUTE DESCRIPTION
points

TYPE: Percent

name

TYPE: str

explanation

TYPE: Optional[str]

type

TYPE: Literal['performance.challenge.score.boolean']

value

TYPE: bool

points property ¤
points: Percent
name instance-attribute ¤
name: str
explanation class-attribute instance-attribute ¤
explanation: Optional[str] = None
type class-attribute instance-attribute ¤
type: Literal['performance.challenge.score.boolean'] = 'performance.challenge.score.boolean'
value instance-attribute ¤
value: bool
ScoreCategorical ¤
ATTRIBUTE DESCRIPTION
type

TYPE: Literal['performance.challenge.score.categorical']

value

TYPE: List[CategoryName]

max_categories_allowed

TYPE: int

name

TYPE: str

explanation

TYPE: Optional[str]

points

TYPE: Percent

type class-attribute instance-attribute ¤
type: Literal['performance.challenge.score.categorical'] = 'performance.challenge.score.categorical'
value instance-attribute ¤
max_categories_allowed class-attribute instance-attribute ¤
max_categories_allowed: int = Field(ge=1, le=10)
name instance-attribute ¤
name: str
explanation class-attribute instance-attribute ¤
explanation: Optional[str] = None
points abstractmethod property ¤
points: Percent
ScoreCategoricalDirect ¤
ATTRIBUTE DESCRIPTION
points

TYPE: Percent

name

TYPE: str

explanation

TYPE: Optional[str]

type

TYPE: Literal['performance.challenge.score.categorical']

value

TYPE: List[CategoryName]

max_categories_allowed

TYPE: int

points property ¤
points: Percent
name instance-attribute ¤
name: str
explanation class-attribute instance-attribute ¤
explanation: Optional[str] = None
type class-attribute instance-attribute ¤
type: Literal['performance.challenge.score.categorical'] = 'performance.challenge.score.categorical'
value instance-attribute ¤
max_categories_allowed class-attribute instance-attribute ¤
max_categories_allowed: int = Field(ge=1, le=10)
ScoreCategorialInverse ¤
ATTRIBUTE DESCRIPTION
points

TYPE: Percent

name

TYPE: str

explanation

TYPE: Optional[str]

type

TYPE: Literal['performance.challenge.score.categorical']

value

TYPE: List[CategoryName]

max_categories_allowed

TYPE: int

points property ¤
points: Percent
name instance-attribute ¤
name: str
explanation class-attribute instance-attribute ¤
explanation: Optional[str] = None
type class-attribute instance-attribute ¤
type: Literal['performance.challenge.score.categorical'] = 'performance.challenge.score.categorical'
value instance-attribute ¤
max_categories_allowed class-attribute instance-attribute ¤
max_categories_allowed: int = Field(ge=1, le=10)
ScoreCategoricalBinary ¤
ATTRIBUTE DESCRIPTION
max_categories_allowed

TYPE: int

correct_categories

TYPE: List[CategoryName]

points

TYPE: Percent

name

TYPE: str

explanation

TYPE: Optional[str]

type

TYPE: Literal['performance.challenge.score.categorical']

value

TYPE: List[CategoryName]

max_categories_allowed class-attribute instance-attribute ¤
max_categories_allowed: int = 1
correct_categories instance-attribute ¤
correct_categories: List[CategoryName]
points property ¤
points: Percent
name instance-attribute ¤
name: str
explanation class-attribute instance-attribute ¤
explanation: Optional[str] = None
type class-attribute instance-attribute ¤
type: Literal['performance.challenge.score.categorical'] = 'performance.challenge.score.categorical'
value instance-attribute ¤
ScoreError ¤
ATTRIBUTE DESCRIPTION
type

TYPE: Literal['performance.challenge.score.error']

source

TYPE: Any

points

TYPE: Percent

name

TYPE: str

explanation

TYPE: Optional[str]

type class-attribute instance-attribute ¤
type: Literal['performance.challenge.score.error'] = 'performance.challenge.score.error'
source instance-attribute ¤
source: Any
points property ¤
points: Percent
name instance-attribute ¤
name: str
explanation class-attribute instance-attribute ¤
explanation: Optional[str] = None

score_base ¤

CLASS DESCRIPTION
ScoreBase
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

Percent

log module-attribute ¤
log = get_logger()

Loger para el módulo

Percent module-attribute ¤
Percent = int
ScoreBase ¤
ATTRIBUTE DESCRIPTION
name

TYPE: str

explanation

TYPE: Optional[str]

points

TYPE: Percent

name instance-attribute ¤
name: str
explanation class-attribute instance-attribute ¤
explanation: Optional[str] = None
points abstractmethod property ¤
points: Percent

runnables ¤

MODULE DESCRIPTION
injection_exception
runnable_streameable
with_async_invoke_config_verified_test
with_async_stream_config_verified_test
with_config_verified
with_invoke_config_verified_test
CLASS DESCRIPTION
InjectionException
WithAsyncInvokeConfigVerified
WithInvokeConfigVerified
WithAsyncStreamConfigVerified
RunnableStreameable

__all__ module-attribute ¤

__all__ = ['InjectionException', 'RunnableStreameable', 'WithAsyncInvokeConfigVerified', 'WithInvokeConfigVerified', 'WithAsyncStreamConfigVerified']

InjectionException ¤

InjectionException(dependency: str)

WithAsyncInvokeConfigVerified ¤

METHOD DESCRIPTION
async_invoke_config_parsed
ainvoke

async_invoke_config_parsed abstractmethod async ¤

async_invoke_config_parsed(input: Input, config_parsed: BaseModel, config_raw: Optional[RunnableConfig] = None) -> Output

ainvoke async ¤

ainvoke(input: Input, config: Optional[RunnableConfig] = None) -> Output

WithInvokeConfigVerified ¤

METHOD DESCRIPTION
invoke_config_parsed
invoke

invoke_config_parsed abstractmethod ¤

invoke_config_parsed(input: Input, config_parsed: BaseModel, config_raw: Optional[RunnableConfig] = None) -> Output

invoke ¤

invoke(input: Input, config: Optional[RunnableConfig] = None) -> Output

WithAsyncStreamConfigVerified ¤

METHOD DESCRIPTION
astream_config_parsed
astream

astream_config_parsed abstractmethod async ¤

astream_config_parsed(input: Input, config_parsed: BaseModel, config_raw: RunnableConfig, run_manager: CallbackManagerForChainRun, **kwargs: Optional[Any]) -> AsyncIterator[Output]

astream async ¤

astream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) -> AsyncIterator[Output]

RunnableStreameable ¤

injection_exception ¤

CLASS DESCRIPTION
InjectionException

InjectionException ¤

InjectionException(dependency: str)

runnable_streameable ¤

CLASS DESCRIPTION
RunnableStreameable
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

Input

Output

Tipos genéricos para la clase RunnableStremeable

log module-attribute ¤

log = get_logger()

Loger para el módulo

Input module-attribute ¤

Input = TypeVar('Input', bound=BaseModel)

Output module-attribute ¤

Output = TypeVar('Output', bound=BaseModel)

Tipos genéricos para la clase RunnableStremeable

RunnableStreameable ¤

with_async_invoke_config_verified_test ¤

CLASS DESCRIPTION
InputModel
OutputModel
FakeAsyncInvokable
FUNCTION DESCRIPTION
test_invoke_with_valid_parameters
test_invoke_with_incomplete_parameters
test_invoke_with_wrong_parameters
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤

log = get_logger()

Loger para el módulo

InputModel ¤

ATTRIBUTE DESCRIPTION
message

TYPE: str

message instance-attribute ¤
message: str

OutputModel ¤

ATTRIBUTE DESCRIPTION
result

TYPE: str

result instance-attribute ¤
result: str

FakeAsyncInvokable ¤

METHOD DESCRIPTION
invoke
async_invoke_config_parsed
ainvoke
ATTRIBUTE DESCRIPTION
config_specs

TYPE: List[ConfigurableFieldSpec]

config_specs property ¤
config_specs: List[ConfigurableFieldSpec]
invoke ¤
invoke(input: Any, config: Optional[RunnableConfig] = None, **kwargs: Any)
async_invoke_config_parsed async ¤
async_invoke_config_parsed(input: BaseModel, config_parsed: BaseModel, config_raw: Optional[RunnableConfig] = None) -> str
ainvoke async ¤
ainvoke(input: Input, config: Optional[RunnableConfig] = None) -> Output

test_invoke_with_valid_parameters async ¤

test_invoke_with_valid_parameters()

test_invoke_with_incomplete_parameters async ¤

test_invoke_with_incomplete_parameters()

test_invoke_with_wrong_parameters async ¤

test_invoke_with_wrong_parameters()

with_async_stream_config_verified_test ¤

CLASS DESCRIPTION
InputModel
OutputModel
FakeStreamable
FUNCTION DESCRIPTION
test_invoke_with_valid_parameters
test_invoke_with_incomplete_parameters
test_invoke_with_wrong_parameters
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤

log = get_logger()

Loger para el módulo

InputModel ¤

ATTRIBUTE DESCRIPTION
message

TYPE: str

message instance-attribute ¤
message: str

OutputModel ¤

ATTRIBUTE DESCRIPTION
result

TYPE: str

result instance-attribute ¤
result: str

FakeStreamable ¤

METHOD DESCRIPTION
invoke
astream_config_parsed
astream
ATTRIBUTE DESCRIPTION
config_specs

TYPE: List[ConfigurableFieldSpec]

config_specs property ¤
config_specs: List[ConfigurableFieldSpec]
invoke ¤
invoke(input: Any, config: Optional[RunnableConfig] = None, **kwargs: Any)
astream_config_parsed async ¤
astream_config_parsed(input: InputModel, config_parsed: BaseModel, config_raw: RunnableConfig, run_manager: CallbackManagerForChainRun, **kwargs: Optional[Any]) -> AsyncIterator[Dict[str, Any]]
astream async ¤
astream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) -> AsyncIterator[Output]

test_invoke_with_valid_parameters async ¤

test_invoke_with_valid_parameters()

test_invoke_with_incomplete_parameters async ¤

test_invoke_with_incomplete_parameters()

test_invoke_with_wrong_parameters async ¤

test_invoke_with_wrong_parameters()

with_config_verified ¤

CLASS DESCRIPTION
WithInvokeConfigVerified
WithAsyncStreamConfigVerified
WithAsyncInvokeConfigVerified
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

Input

Output

Tipos genéricos para la mixins de configuracion verificada

log module-attribute ¤

log = get_logger()

Loger para el módulo

Input module-attribute ¤

Input = TypeVar('Input', bound=BaseModel)

Output module-attribute ¤

Output = TypeVar('Output', bound=BaseModel)

Tipos genéricos para la mixins de configuracion verificada

WithInvokeConfigVerified ¤

METHOD DESCRIPTION
invoke_config_parsed
invoke
invoke_config_parsed abstractmethod ¤
invoke_config_parsed(input: Input, config_parsed: BaseModel, config_raw: Optional[RunnableConfig] = None) -> Output
invoke ¤
invoke(input: Input, config: Optional[RunnableConfig] = None) -> Output

WithAsyncStreamConfigVerified ¤

METHOD DESCRIPTION
astream_config_parsed
astream
astream_config_parsed abstractmethod async ¤
astream_config_parsed(input: Input, config_parsed: BaseModel, config_raw: RunnableConfig, run_manager: CallbackManagerForChainRun, **kwargs: Optional[Any]) -> AsyncIterator[Output]
astream async ¤
astream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) -> AsyncIterator[Output]

WithAsyncInvokeConfigVerified ¤

METHOD DESCRIPTION
async_invoke_config_parsed
ainvoke
async_invoke_config_parsed abstractmethod async ¤
async_invoke_config_parsed(input: Input, config_parsed: BaseModel, config_raw: Optional[RunnableConfig] = None) -> Output
ainvoke async ¤
ainvoke(input: Input, config: Optional[RunnableConfig] = None) -> Output

with_invoke_config_verified_test ¤

CLASS DESCRIPTION
FakeInvokable
FUNCTION DESCRIPTION
test_invoke_with_valid_parameters
test_invoke_with_incomplete_parameters
test_invoke_with_wrong_parameters
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤

log = get_logger()

Loger para el módulo

FakeInvokable ¤

METHOD DESCRIPTION
invoke_config_parsed
invoke
ATTRIBUTE DESCRIPTION
config_specs

TYPE: List[ConfigurableFieldSpec]

config_specs property ¤
config_specs: List[ConfigurableFieldSpec]
invoke_config_parsed ¤
invoke_config_parsed(input: BaseModel, config_parsed: BaseModel, config_raw: Optional[RunnableConfig] = None) -> str
invoke ¤
invoke(input: Input, config: Optional[RunnableConfig] = None) -> Output

test_invoke_with_valid_parameters async ¤

test_invoke_with_valid_parameters()

test_invoke_with_incomplete_parameters async ¤

test_invoke_with_incomplete_parameters()

test_invoke_with_wrong_parameters async ¤

test_invoke_with_wrong_parameters()

skill ¤

MODULE DESCRIPTION
skill
skill_base
skill_computation
skill_contribute
skill_structured_response
types
CLASS DESCRIPTION
SkillComputationDirect
SkillComputationWithClarification
SkillContribute
SkillStructuredResponse
ComputationRequested
ComputationRequestedWithClarification
ComputationResult
BrainSchemaBase
ClarificationSchemaBase
SkillInputSchemaBase
ResultSchemaBase
ATTRIBUTE DESCRIPTION
SkillComputation

Skill

Union discriminada para Skill

BrainSchema

ClarificationSchema

SkillInputSchema

ResultSchema

Tipos genéricos para la clase Computation

Skill module-attribute ¤

Union discriminada para Skill

BrainSchema module-attribute ¤

BrainSchema = TypeVar('BrainSchema', bound=BrainSchemaBase)

ClarificationSchema module-attribute ¤

ClarificationSchema = TypeVar('ClarificationSchema', bound=ClarificationSchemaBase)

SkillInputSchema module-attribute ¤

SkillInputSchema = TypeVar('SkillInputSchema', bound=Union[BrainSchemaBase, SkillInputSchemaBase])

ResultSchema module-attribute ¤

ResultSchema = TypeVar('ResultSchema', bound=ResultSchemaBase)

Tipos genéricos para la clase Computation

__all__ module-attribute ¤

__all__ = ['ComputationRequested', 'ComputationRequestedWithClarification', 'ComputationResult', 'Skill', 'SkillComputation', 'SkillContribute', 'SkillStructuredResponse', 'SkillComputationDirect', 'SkillComputationWithClarification', 'BrainSchema', 'BrainSchemaBase', 'ClarificationSchema', 'ClarificationSchemaBase', 'SkillInputSchema', 'SkillInputSchemaBase', 'ResultSchema', 'ResultSchemaBase']

SkillComputationDirect ¤

METHOD DESCRIPTION
ainvoke
as_tool
invoke
get_output_schema
get_input_schema
async_executor

Ejecución del computo del skill

async_invoke_config_parsed
ATTRIBUTE DESCRIPTION
name

TYPE: str

description

TYPE: str

brain_schema

TYPE: Type[BrainSchema]

type

TYPE: Literal['skill.computation']

require_clarification

TYPE: bool

result_schema

TYPE: Type[ResultSchema]

sub_type

TYPE: Literal['direct']

name instance-attribute ¤

name: str

description instance-attribute ¤

description: str

brain_schema instance-attribute ¤

brain_schema: Type[BrainSchema]

type class-attribute instance-attribute ¤

type: Literal['skill.computation'] = 'skill.computation'

require_clarification class-attribute instance-attribute ¤

require_clarification: bool = False

result_schema instance-attribute ¤

result_schema: Type[ResultSchema]

sub_type class-attribute instance-attribute ¤

sub_type: Literal['direct'] = 'direct'

ainvoke async ¤

ainvoke(input: Input, config: Optional[RunnableConfig] = None) -> Output

as_tool ¤

as_tool() -> Dict[str, Any]

invoke ¤

invoke(input: ComputationRequested, config: RunnableConfig | None = None) -> ComputationResult[BrainSchema, ResultSchema]

get_output_schema ¤

get_output_schema(config: Optional[RunnableConfig] = None) -> Type[ResultSchema]

get_input_schema ¤

get_input_schema(config: Optional[RunnableConfig] = None) -> Type[BrainSchema]

async_executor abstractmethod async ¤

async_executor(skill_args: BrainSchema, config: BaseModel) -> ResultSchema

Ejecución del computo del skill

Encargado de procesar los datos de entrada y generar el resultado.

RETURNS DESCRIPTION
ResultSchema

resultado de ejecutar el computo

TYPE: ResultSchema

async_invoke_config_parsed async ¤

async_invoke_config_parsed(input: ComputationRequested, config_parsed: BaseModel, config_raw: RunnableConfig) -> ComputationResult[BrainSchema, ResultSchema]

SkillComputationWithClarification ¤

METHOD DESCRIPTION
ainvoke
as_tool
invoke
get_output_schema
get_input_schema
merge_brain_with_clarification
async_executor

Ejecución del computo del skill

get_clarification_schema
async_invoke_config_parsed
ATTRIBUTE DESCRIPTION
name

TYPE: str

description

TYPE: str

brain_schema

TYPE: Type[BrainSchema]

type

TYPE: Literal['skill.computation']

require_clarification

TYPE: bool

result_schema

TYPE: Type[ResultSchema]

sub_type

TYPE: Literal['with-clarification']

clarification_schema

TYPE: Type[ClarificationSchema]

skill_input_schema

TYPE: Type[SkillInputSchema]

name instance-attribute ¤

name: str

description instance-attribute ¤

description: str

brain_schema instance-attribute ¤

brain_schema: Type[BrainSchema]

type class-attribute instance-attribute ¤

type: Literal['skill.computation'] = 'skill.computation'

require_clarification class-attribute instance-attribute ¤

require_clarification: bool = False

result_schema instance-attribute ¤

result_schema: Type[ResultSchema]

sub_type class-attribute instance-attribute ¤

sub_type: Literal['with-clarification'] = 'with-clarification'

clarification_schema instance-attribute ¤

clarification_schema: Type[ClarificationSchema]

skill_input_schema instance-attribute ¤

skill_input_schema: Type[SkillInputSchema]

ainvoke async ¤

ainvoke(input: Input, config: Optional[RunnableConfig] = None) -> Output

as_tool ¤

as_tool() -> Dict[str, Any]

invoke ¤

invoke(input: ComputationRequested, config: RunnableConfig | None = None) -> ComputationResult[BrainSchema, ResultSchema]

get_output_schema ¤

get_output_schema(config: Optional[RunnableConfig] = None) -> Type[ResultSchema]

get_input_schema ¤

get_input_schema(config: Optional[RunnableConfig] = None) -> Type[BrainSchema]

merge_brain_with_clarification abstractmethod ¤

merge_brain_with_clarification(brain_input: BrainSchema, clarification_input: ClarificationSchema) -> SkillInputSchema

async_executor abstractmethod async ¤

async_executor(skill_args: SkillInputSchema, config: BaseModel) -> ResultSchema

Ejecución del computo del skill

Encargado de procesar los datos de entrada y generar el resultado.

RETURNS DESCRIPTION
ResultSchema

resultado de ejecutar el computo

TYPE: ResultSchema

get_clarification_schema ¤

get_clarification_schema(config: Optional[RunnableConfig] = None) -> Type[ClarificationSchema]

async_invoke_config_parsed async ¤

async_invoke_config_parsed(input: ComputationRequestedWithClarification, config_parsed: BaseModel, config_raw: RunnableConfig) -> ComputationResult[SkillInputSchema, ResultSchema]

SkillContribute ¤

METHOD DESCRIPTION
as_tool
ATTRIBUTE DESCRIPTION
type

TYPE: Literal['skill.forward']

name

TYPE: str

description

TYPE: str

brain_schema

TYPE: Type[SendContribution]

type class-attribute instance-attribute ¤

type: Literal['skill.forward'] = 'skill.forward'

name class-attribute instance-attribute ¤

name: str = 'send_message_to_colleague'

description class-attribute instance-attribute ¤

description: str = 'Send a message to a colleague'

brain_schema class-attribute instance-attribute ¤

as_tool ¤

as_tool() -> Dict[str, Any]

SkillStructuredResponse ¤

METHOD DESCRIPTION
as_tool
ATTRIBUTE DESCRIPTION
name

TYPE: str

description

TYPE: str

brain_schema

TYPE: Type[BrainSchema]

type

TYPE: Literal['skill.response_structured']

name instance-attribute ¤

name: str

description instance-attribute ¤

description: str

brain_schema instance-attribute ¤

brain_schema: Type[BrainSchema]

type class-attribute instance-attribute ¤

type: Literal['skill.response_structured'] = 'skill.response_structured'

as_tool ¤

as_tool() -> Dict[str, Any]

ComputationRequested ¤

METHOD DESCRIPTION
is_lc_serializable
get_lc_namespace
lc_id

A unique identifier for this class for serialization purposes.

ATTRIBUTE DESCRIPTION
name

TYPE: str

brain_args

TYPE: Dict[str, Any]

computation_id

TYPE: str

lc_attributes

TYPE: Dict

name instance-attribute ¤

name: str

brain_args instance-attribute ¤

brain_args: Dict[str, Any]

computation_id instance-attribute ¤

computation_id: str

lc_attributes property ¤

lc_attributes: Dict

is_lc_serializable classmethod ¤

is_lc_serializable() -> bool

get_lc_namespace classmethod ¤

get_lc_namespace() -> List[str]

lc_id classmethod ¤

lc_id() -> list[str]

A unique identifier for this class for serialization purposes.

The unique identifier is a list of strings that describes the path to the object. For example, for the class langchain.llms.openai.OpenAI, the id is ["langchain", "llms", "openai", "OpenAI"].

ComputationRequestedWithClarification ¤

METHOD DESCRIPTION
is_lc_serializable
get_lc_namespace
lc_id

A unique identifier for this class for serialization purposes.

ATTRIBUTE DESCRIPTION
name

TYPE: str

brain_args

TYPE: Dict[str, Any]

clarification_args

TYPE: Dict[str, Any]

computation_id

TYPE: str

lc_attributes

TYPE: Dict

name instance-attribute ¤

name: str

brain_args instance-attribute ¤

brain_args: Dict[str, Any]

clarification_args instance-attribute ¤

clarification_args: Dict[str, Any]

computation_id instance-attribute ¤

computation_id: str

lc_attributes property ¤

lc_attributes: Dict

is_lc_serializable classmethod ¤

is_lc_serializable() -> bool

get_lc_namespace classmethod ¤

get_lc_namespace() -> List[str]

lc_id classmethod ¤

lc_id() -> list[str]

A unique identifier for this class for serialization purposes.

The unique identifier is a list of strings that describes the path to the object. For example, for the class langchain.llms.openai.OpenAI, the id is ["langchain", "llms", "openai", "OpenAI"].

ComputationResult ¤

METHOD DESCRIPTION
is_lc_serializable
get_lc_namespace
ATTRIBUTE DESCRIPTION
computation_id

TYPE: str

name

TYPE: str

skill_args

TYPE: SkillInputSchema

result

TYPE: ResultSchema

lc_attributes

TYPE: Dict

computation_id instance-attribute ¤

computation_id: str

name instance-attribute ¤

name: str

skill_args instance-attribute ¤

skill_args: SkillInputSchema

result instance-attribute ¤

result: ResultSchema

lc_attributes property ¤

lc_attributes: Dict

is_lc_serializable classmethod ¤

is_lc_serializable() -> bool

get_lc_namespace classmethod ¤

get_lc_namespace() -> List[str]

BrainSchemaBase ¤

ATTRIBUTE DESCRIPTION
registry_id

TYPE: str

registry_id cached property ¤

registry_id: str

ClarificationSchemaBase ¤

SkillInputSchemaBase ¤

ResultSchemaBase ¤

skill ¤

ATTRIBUTE DESCRIPTION
log

Loger para el módulo

Skill

Union discriminada para Skill

SkillAdapter

TYPE: TypeAdapter[Skill]

log module-attribute ¤

log = get_logger()

Loger para el módulo

Skill module-attribute ¤

Union discriminada para Skill

SkillAdapter module-attribute ¤

SkillAdapter: TypeAdapter[Skill] = TypeAdapter(Skill)

skill_base ¤

CLASS DESCRIPTION
ToolModel
SkillBase
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤

log = get_logger()

Loger para el módulo

ToolModel ¤

ATTRIBUTE DESCRIPTION
name

TYPE: str

description

TYPE: str

parameters

TYPE: Dict[str, Any]

name instance-attribute ¤
name: str
description instance-attribute ¤
description: str
parameters instance-attribute ¤
parameters: Dict[str, Any]

SkillBase ¤

METHOD DESCRIPTION
as_tool
ATTRIBUTE DESCRIPTION
name

TYPE: str

description

TYPE: str

brain_schema

TYPE: Type[BrainSchema]

name instance-attribute ¤
name: str
description instance-attribute ¤
description: str
brain_schema instance-attribute ¤
brain_schema: Type[BrainSchema]
as_tool ¤
as_tool() -> Dict[str, Any]

skill_computation ¤

CLASS DESCRIPTION
SkillComputationBase
SkillComputationDirect
SkillComputationWithClarification
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

SkillComputation

SkillComputationAdapter

TYPE: TypeAdapter[SkillComputation]

log module-attribute ¤

log = get_logger()

Loger para el módulo

SkillComputationAdapter module-attribute ¤

SkillComputationAdapter: TypeAdapter[SkillComputation] = TypeAdapter(SkillComputation)

SkillComputationBase ¤

METHOD DESCRIPTION
invoke
get_output_schema
get_input_schema
async_invoke_config_parsed
as_tool
ATTRIBUTE DESCRIPTION
type

TYPE: Literal['skill.computation']

require_clarification

TYPE: bool

brain_schema

TYPE: Type[BrainSchema]

result_schema

TYPE: Type[ResultSchema]

name

TYPE: str

description

TYPE: str

type class-attribute instance-attribute ¤
type: Literal['skill.computation'] = 'skill.computation'
require_clarification class-attribute instance-attribute ¤
require_clarification: bool = False
brain_schema instance-attribute ¤
brain_schema: Type[BrainSchema]
result_schema instance-attribute ¤
result_schema: Type[ResultSchema]
name instance-attribute ¤
name: str
description instance-attribute ¤
description: str
invoke ¤
invoke(input: ComputationRequested, config: RunnableConfig | None = None) -> ComputationResult[BrainSchema, ResultSchema]
get_output_schema ¤
get_output_schema(config: Optional[RunnableConfig] = None) -> Type[ResultSchema]
get_input_schema ¤
get_input_schema(config: Optional[RunnableConfig] = None) -> Type[BrainSchema]
async_invoke_config_parsed abstractmethod async ¤
async_invoke_config_parsed(input: Union[ComputationRequested, ComputationRequestedWithClarification], config_parsed: BaseModel, config_raw: RunnableConfig) -> ComputationResult
as_tool ¤
as_tool() -> Dict[str, Any]

SkillComputationDirect ¤

METHOD DESCRIPTION
async_executor

Ejecución del computo del skill

async_invoke_config_parsed
ainvoke
as_tool
invoke
get_output_schema
get_input_schema
ATTRIBUTE DESCRIPTION
sub_type

TYPE: Literal['direct']

name

TYPE: str

description

TYPE: str

brain_schema

TYPE: Type[BrainSchema]

type

TYPE: Literal['skill.computation']

require_clarification

TYPE: bool

result_schema

TYPE: Type[ResultSchema]

sub_type class-attribute instance-attribute ¤
sub_type: Literal['direct'] = 'direct'
name instance-attribute ¤
name: str
description instance-attribute ¤
description: str
brain_schema instance-attribute ¤
brain_schema: Type[BrainSchema]
type class-attribute instance-attribute ¤
type: Literal['skill.computation'] = 'skill.computation'
require_clarification class-attribute instance-attribute ¤
require_clarification: bool = False
result_schema instance-attribute ¤
result_schema: Type[ResultSchema]
async_executor abstractmethod async ¤
async_executor(skill_args: BrainSchema, config: BaseModel) -> ResultSchema

Ejecución del computo del skill

Encargado de procesar los datos de entrada y generar el resultado.

RETURNS DESCRIPTION
ResultSchema

resultado de ejecutar el computo

TYPE: ResultSchema

async_invoke_config_parsed async ¤
async_invoke_config_parsed(input: ComputationRequested, config_parsed: BaseModel, config_raw: RunnableConfig) -> ComputationResult[BrainSchema, ResultSchema]
ainvoke async ¤
ainvoke(input: Input, config: Optional[RunnableConfig] = None) -> Output
as_tool ¤
as_tool() -> Dict[str, Any]
invoke ¤
invoke(input: ComputationRequested, config: RunnableConfig | None = None) -> ComputationResult[BrainSchema, ResultSchema]
get_output_schema ¤
get_output_schema(config: Optional[RunnableConfig] = None) -> Type[ResultSchema]
get_input_schema ¤
get_input_schema(config: Optional[RunnableConfig] = None) -> Type[BrainSchema]

SkillComputationWithClarification ¤

METHOD DESCRIPTION
merge_brain_with_clarification
async_executor

Ejecución del computo del skill

get_clarification_schema
async_invoke_config_parsed
ainvoke
as_tool
invoke
get_output_schema
get_input_schema
ATTRIBUTE DESCRIPTION
sub_type

TYPE: Literal['with-clarification']

clarification_schema

TYPE: Type[ClarificationSchema]

skill_input_schema

TYPE: Type[SkillInputSchema]

name

TYPE: str

description

TYPE: str

brain_schema

TYPE: Type[BrainSchema]

type

TYPE: Literal['skill.computation']

require_clarification

TYPE: bool

result_schema

TYPE: Type[ResultSchema]

sub_type class-attribute instance-attribute ¤
sub_type: Literal['with-clarification'] = 'with-clarification'
clarification_schema instance-attribute ¤
clarification_schema: Type[ClarificationSchema]
skill_input_schema instance-attribute ¤
skill_input_schema: Type[SkillInputSchema]
name instance-attribute ¤
name: str
description instance-attribute ¤
description: str
brain_schema instance-attribute ¤
brain_schema: Type[BrainSchema]
type class-attribute instance-attribute ¤
type: Literal['skill.computation'] = 'skill.computation'
require_clarification class-attribute instance-attribute ¤
require_clarification: bool = False
result_schema instance-attribute ¤
result_schema: Type[ResultSchema]
merge_brain_with_clarification abstractmethod ¤
merge_brain_with_clarification(brain_input: BrainSchema, clarification_input: ClarificationSchema) -> SkillInputSchema
async_executor abstractmethod async ¤
async_executor(skill_args: SkillInputSchema, config: BaseModel) -> ResultSchema

Ejecución del computo del skill

Encargado de procesar los datos de entrada y generar el resultado.

RETURNS DESCRIPTION
ResultSchema

resultado de ejecutar el computo

TYPE: ResultSchema

get_clarification_schema ¤
get_clarification_schema(config: Optional[RunnableConfig] = None) -> Type[ClarificationSchema]
async_invoke_config_parsed async ¤
async_invoke_config_parsed(input: ComputationRequestedWithClarification, config_parsed: BaseModel, config_raw: RunnableConfig) -> ComputationResult[SkillInputSchema, ResultSchema]
ainvoke async ¤
ainvoke(input: Input, config: Optional[RunnableConfig] = None) -> Output
as_tool ¤
as_tool() -> Dict[str, Any]
invoke ¤
invoke(input: ComputationRequested, config: RunnableConfig | None = None) -> ComputationResult[BrainSchema, ResultSchema]
get_output_schema ¤
get_output_schema(config: Optional[RunnableConfig] = None) -> Type[ResultSchema]
get_input_schema ¤
get_input_schema(config: Optional[RunnableConfig] = None) -> Type[BrainSchema]

skill_contribute ¤

CLASS DESCRIPTION
SendContribution
SkillContribute
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤

log = get_logger()

Loger para el módulo

SendContribution ¤

ATTRIBUTE DESCRIPTION
to

TYPE: str

message

TYPE: str

registry_id

TYPE: str

to instance-attribute ¤
to: str
message instance-attribute ¤
message: str
registry_id cached property ¤
registry_id: str

SkillContribute ¤

METHOD DESCRIPTION
as_tool
ATTRIBUTE DESCRIPTION
type

TYPE: Literal['skill.forward']

name

TYPE: str

description

TYPE: str

brain_schema

TYPE: Type[SendContribution]

type class-attribute instance-attribute ¤
type: Literal['skill.forward'] = 'skill.forward'
name class-attribute instance-attribute ¤
name: str = 'send_message_to_colleague'
description class-attribute instance-attribute ¤
description: str = 'Send a message to a colleague'
brain_schema class-attribute instance-attribute ¤
as_tool ¤
as_tool() -> Dict[str, Any]

skill_structured_response ¤

CLASS DESCRIPTION
SkillStructuredResponse
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤

log = get_logger()

Loger para el módulo

SkillStructuredResponse ¤

METHOD DESCRIPTION
as_tool
ATTRIBUTE DESCRIPTION
type

TYPE: Literal['skill.response_structured']

name

TYPE: str

description

TYPE: str

brain_schema

TYPE: Type[BrainSchema]

type class-attribute instance-attribute ¤
type: Literal['skill.response_structured'] = 'skill.response_structured'
name instance-attribute ¤
name: str
description instance-attribute ¤
description: str
brain_schema instance-attribute ¤
brain_schema: Type[BrainSchema]
as_tool ¤
as_tool() -> Dict[str, Any]

types ¤

CLASS DESCRIPTION
BrainSchemaBase
ClarificationSchemaBase
SkillInputSchemaBase
ResultSchemaBase
ComputationRequested
ComputationRequestedWithClarification
ComputationResult
FUNCTION DESCRIPTION
get_all_subclasses

Get subclasses

ATTRIBUTE DESCRIPTION
log

Loger para el módulo

BrainSchema

ClarificationSchema

SkillInputSchema

ResultSchema

Tipos genéricos para la clase Computation

log module-attribute ¤

log = get_logger()

Loger para el módulo

BrainSchema module-attribute ¤

BrainSchema = TypeVar('BrainSchema', bound=BrainSchemaBase)

ClarificationSchema module-attribute ¤

ClarificationSchema = TypeVar('ClarificationSchema', bound=ClarificationSchemaBase)

SkillInputSchema module-attribute ¤

SkillInputSchema = TypeVar('SkillInputSchema', bound=Union[BrainSchemaBase, SkillInputSchemaBase])

ResultSchema module-attribute ¤

ResultSchema = TypeVar('ResultSchema', bound=ResultSchemaBase)

Tipos genéricos para la clase Computation

BrainSchemaBase ¤

ATTRIBUTE DESCRIPTION
registry_id

TYPE: str

registry_id cached property ¤
registry_id: str

ClarificationSchemaBase ¤

SkillInputSchemaBase ¤

ResultSchemaBase ¤

ComputationRequested ¤

METHOD DESCRIPTION
is_lc_serializable
get_lc_namespace
lc_id

A unique identifier for this class for serialization purposes.

ATTRIBUTE DESCRIPTION
name

TYPE: str

brain_args

TYPE: Dict[str, Any]

computation_id

TYPE: str

lc_attributes

TYPE: Dict

name instance-attribute ¤
name: str
brain_args instance-attribute ¤
brain_args: Dict[str, Any]
computation_id instance-attribute ¤
computation_id: str
lc_attributes property ¤
lc_attributes: Dict
is_lc_serializable classmethod ¤
is_lc_serializable() -> bool
get_lc_namespace classmethod ¤
get_lc_namespace() -> List[str]
lc_id classmethod ¤
lc_id() -> list[str]

A unique identifier for this class for serialization purposes.

The unique identifier is a list of strings that describes the path to the object. For example, for the class langchain.llms.openai.OpenAI, the id is ["langchain", "llms", "openai", "OpenAI"].

ComputationRequestedWithClarification ¤

METHOD DESCRIPTION
is_lc_serializable
get_lc_namespace
lc_id

A unique identifier for this class for serialization purposes.

ATTRIBUTE DESCRIPTION
name

TYPE: str

brain_args

TYPE: Dict[str, Any]

clarification_args

TYPE: Dict[str, Any]

computation_id

TYPE: str

lc_attributes

TYPE: Dict

name instance-attribute ¤
name: str
brain_args instance-attribute ¤
brain_args: Dict[str, Any]
clarification_args instance-attribute ¤
clarification_args: Dict[str, Any]
computation_id instance-attribute ¤
computation_id: str
lc_attributes property ¤
lc_attributes: Dict
is_lc_serializable classmethod ¤
is_lc_serializable() -> bool
get_lc_namespace classmethod ¤
get_lc_namespace() -> List[str]
lc_id classmethod ¤
lc_id() -> list[str]

A unique identifier for this class for serialization purposes.

The unique identifier is a list of strings that describes the path to the object. For example, for the class langchain.llms.openai.OpenAI, the id is ["langchain", "llms", "openai", "OpenAI"].

ComputationResult ¤

METHOD DESCRIPTION
is_lc_serializable
get_lc_namespace
ATTRIBUTE DESCRIPTION
computation_id

TYPE: str

name

TYPE: str

skill_args

TYPE: SkillInputSchema

result

TYPE: ResultSchema

lc_attributes

TYPE: Dict

computation_id instance-attribute ¤
computation_id: str
name instance-attribute ¤
name: str
skill_args instance-attribute ¤
skill_args: SkillInputSchema
result instance-attribute ¤
result: ResultSchema
lc_attributes property ¤
lc_attributes: Dict
is_lc_serializable classmethod ¤
is_lc_serializable() -> bool
get_lc_namespace classmethod ¤
get_lc_namespace() -> List[str]

get_all_subclasses ¤

get_all_subclasses(cls)

Get subclasses

stream_conversor ¤

CLASS DESCRIPTION
StreamFilter
FUNCTION DESCRIPTION
prepare_error_for_client

Prepara un error para enviarlo como evento

build_pre_filter
is_event_required
reduce_event
create_sse_event
stream_conversor

Conversor de eventos para el stream del Crew

ATTRIBUTE DESCRIPTION
log

Loger para el módulo

ScopeAvailables

EventFormat

AllowedEventMoment

log module-attribute ¤

log = get_logger()

Loger para el módulo

ScopeAvailables module-attribute ¤

ScopeAvailables = Literal['answer', 'deliberations', 'computations']

EventFormat module-attribute ¤

EventFormat = Literal['compact', 'extended']

AllowedEventMoment module-attribute ¤

AllowedEventMoment = Literal['start', 'stream', 'end']

StreamFilter ¤

ATTRIBUTE DESCRIPTION
include_names

TYPE: Optional[Sequence[str]]

include_tags

TYPE: Optional[Sequence[str]]

include_types

TYPE: Optional[Sequence[str]]

exclude_names

TYPE: Optional[Sequence[str]]

exclude_tags

TYPE: Optional[Sequence[str]]

exclude_types

TYPE: Optional[Sequence[str]]

include_names class-attribute instance-attribute ¤

include_names: Optional[Sequence[str]] = None

include_tags class-attribute instance-attribute ¤

include_tags: Optional[Sequence[str]] = None

include_types class-attribute instance-attribute ¤

include_types: Optional[Sequence[str]] = None

exclude_names class-attribute instance-attribute ¤

exclude_names: Optional[Sequence[str]] = None

exclude_tags class-attribute instance-attribute ¤

exclude_tags: Optional[Sequence[str]] = None

exclude_types class-attribute instance-attribute ¤

exclude_types: Optional[Sequence[str]] = None

prepare_error_for_client ¤

prepare_error_for_client(error: BaseException) -> str

Prepara un error para enviarlo como evento

PARAMETER DESCRIPTION

error ¤

Error generado en la aplicación

TYPE: BaseException

RETURNS DESCRIPTION
str

json con la serializacion del error

TYPE: str

build_pre_filter ¤

build_pre_filter(scope: ScopeAvailables) -> StreamFilter

is_event_required ¤

is_event_required(event: StreamEvent, allowed_event_moments: Set[AllowedEventMoment]) -> bool

reduce_event ¤

reduce_event(event)

create_sse_event ¤

create_sse_event(event: StreamEvent, event_format: EventFormat, serializer) -> ServerSentEvent

stream_conversor async ¤

stream_conversor(runnable: Runnable, input: CrewInput, config: RunnableConfig, scope: ScopeAvailables = 'answer', moments: Set[AllowedEventMoment] = {'end'}, event_format: EventFormat = 'compact') -> AsyncIterator[ServerSentEvent]

Conversor de eventos para el stream del Crew

PARAMETER DESCRIPTION

runnable ¤

runnable que se quiere convertir los eventos

TYPE: Runnable

input ¤

Data de entrada al runnable

TYPE: HttpInput

config ¤

configuración para el runnable

TYPE: RunnableConfig

RETURNS DESCRIPTION
AsyncIterator[ServerSentEvent]

AsyncIterator[ServerSentEvent]: Generador de eventos convertidos

YIELDS DESCRIPTION
AsyncIterator[ServerSentEvent]

Iterator[AsyncIterator[ServerSentEvent]]: Iterador de los eventos

team ¤

MODULE DESCRIPTION
distribution_strategy
team_base
team_base_test
CLASS DESCRIPTION
TeamBase
DistributionStrategyInterface
RandomStrategy
SupervisionStrategy

__all__ module-attribute ¤

__all__ = ['DistributionStrategyInterface', 'RandomStrategy', 'SupervisionStrategy', 'TeamBase']

TeamBase ¤

TeamBase(**data)
METHOD DESCRIPTION
astream_config_parsed

Asynchronously streams the output of the collaborator.

astream
async_invoke_config_parsed

Asynchronously invokes the collaborator with a parsed configuration.

ainvoke
invoke

Invokes the collaborator.

join_team
get_member_by_name
ATTRIBUTE DESCRIPTION
name

TYPE: str

job_description

TYPE: str

team_instructions

TYPE: str

distribution_strategy

TYPE: DistributionStrategyInterface

members

TYPE: List[AgentBase]

options_built_in

TYPE: List[Skill]

config_specs

TYPE: List[ConfigurableFieldSpec]

name class-attribute instance-attribute ¤

name: str = 'Team'

job_description instance-attribute ¤

job_description: str

team_instructions class-attribute instance-attribute ¤

team_instructions: str = 'You are part of a team of colleagues.Please use tool if you need to send a message to anyone.\n\nMembers:\n'

distribution_strategy instance-attribute ¤

distribution_strategy: DistributionStrategyInterface

members instance-attribute ¤

members: List[AgentBase]

options_built_in class-attribute instance-attribute ¤

options_built_in: List[Skill] = []

config_specs property ¤

config_specs: List[ConfigurableFieldSpec]

astream_config_parsed async ¤

astream_config_parsed(input: CollaboratorInput, config_parsed: BaseModel, config_raw: RunnableConfig, run_manager: CallbackManagerForChainRun, **kwargs: Optional[Any]) -> AsyncIterator[Dict[str, Any]]

Asynchronously streams the output of the collaborator.

PARAMETER DESCRIPTION
input ¤

The input data for the collaborator.

TYPE: CollaboratorInput

config_parsed ¤

The parsed configuration.

TYPE: BaseModel

config_raw ¤

The raw runnable configuration.

TYPE: RunnableConfig

run_manager ¤

The run manager.

TYPE: CallbackManagerForChainRun

**kwargs ¤

Optional keyword arguments.

TYPE: Optional[Any] DEFAULT: {}

YIELDS DESCRIPTION
dict

The chunks of the output.

astream async ¤

astream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) -> AsyncIterator[Output]

async_invoke_config_parsed async ¤

async_invoke_config_parsed(input: CollaboratorInput, config_parsed: BaseModel, config_raw: RunnableConfig) -> CollaboratorOutput

Asynchronously invokes the collaborator with a parsed configuration.

PARAMETER DESCRIPTION
input ¤

The input data for the collaborator.

TYPE: CollaboratorInput

config_parsed ¤

The parsed configuration.

TYPE: BaseModel

config_raw ¤

The raw runnable configuration.

TYPE: RunnableConfig

RETURNS DESCRIPTION
CollaboratorOutput

The output of the collaborator.

TYPE: CollaboratorOutput

ainvoke async ¤

ainvoke(input: Input, config: Optional[RunnableConfig] = None) -> Output

invoke ¤

invoke(input: CollaboratorInput, config: RunnableConfig | None = None) -> CollaboratorOutput

Invokes the collaborator.

RAISES DESCRIPTION
Exception

Collaborator can only be called asynchronously.

join_team ¤

join_team(team_membership: TeamMembership)

get_member_by_name ¤

get_member_by_name(agent_name: str) -> AgentBase

DistributionStrategyInterface ¤

METHOD DESCRIPTION
execute

execute abstractmethod ¤

execute() -> AgentBase

RandomStrategy ¤

METHOD DESCRIPTION
execute
ATTRIBUTE DESCRIPTION
members

TYPE: List[AgentBase]

members instance-attribute ¤

members: List[AgentBase]

execute ¤

execute() -> AgentBase

SupervisionStrategy ¤

METHOD DESCRIPTION
execute
ATTRIBUTE DESCRIPTION
supervisor

TYPE: AgentBase

supervisor instance-attribute ¤

supervisor: AgentBase

execute ¤

execute() -> AgentBase

distribution_strategy ¤

CLASS DESCRIPTION
DistributionStrategyInterface
RandomStrategy
SupervisionStrategy

DistributionStrategyInterface ¤

METHOD DESCRIPTION
execute
execute abstractmethod ¤
execute() -> AgentBase

RandomStrategy ¤

METHOD DESCRIPTION
execute
ATTRIBUTE DESCRIPTION
members

TYPE: List[AgentBase]

members instance-attribute ¤
members: List[AgentBase]
execute ¤
execute() -> AgentBase

SupervisionStrategy ¤

METHOD DESCRIPTION
execute
ATTRIBUTE DESCRIPTION
supervisor

TYPE: AgentBase

supervisor instance-attribute ¤
supervisor: AgentBase
execute ¤
execute() -> AgentBase

team_base ¤

CLASS DESCRIPTION
TeamBase
FUNCTION DESCRIPTION
start
distributor
evaluate_distributor
agent_node
router
evaluate_router
collaborator
cleaner

Nodo final del graph, se utiliza para cualquier limpieza

ATTRIBUTE DESCRIPTION
log

Loger para el módulo

log module-attribute ¤

log = get_logger()

Loger para el módulo

TeamBase ¤

TeamBase(**data)
METHOD DESCRIPTION
join_team
get_member_by_name
astream_config_parsed

Asynchronously streams the output of the collaborator.

astream
async_invoke_config_parsed

Asynchronously invokes the collaborator with a parsed configuration.

ainvoke
invoke

Invokes the collaborator.

ATTRIBUTE DESCRIPTION
name

TYPE: str

job_description

TYPE: str

team_instructions

TYPE: str

distribution_strategy

TYPE: DistributionStrategyInterface

members

TYPE: List[AgentBase]

options_built_in

TYPE: List[Skill]

config_specs

TYPE: List[ConfigurableFieldSpec]

name class-attribute instance-attribute ¤
name: str = 'Team'
job_description instance-attribute ¤
job_description: str
team_instructions class-attribute instance-attribute ¤
team_instructions: str = 'You are part of a team of colleagues.Please use tool if you need to send a message to anyone.\n\nMembers:\n'
distribution_strategy instance-attribute ¤
distribution_strategy: DistributionStrategyInterface
members instance-attribute ¤
members: List[AgentBase]
options_built_in class-attribute instance-attribute ¤
options_built_in: List[Skill] = []
config_specs property ¤
config_specs: List[ConfigurableFieldSpec]
join_team ¤
join_team(team_membership: TeamMembership)
get_member_by_name ¤
get_member_by_name(agent_name: str) -> AgentBase
astream_config_parsed async ¤
astream_config_parsed(input: CollaboratorInput, config_parsed: BaseModel, config_raw: RunnableConfig, run_manager: CallbackManagerForChainRun, **kwargs: Optional[Any]) -> AsyncIterator[Dict[str, Any]]

Asynchronously streams the output of the collaborator.

PARAMETER DESCRIPTION
input ¤

The input data for the collaborator.

TYPE: CollaboratorInput

config_parsed ¤

The parsed configuration.

TYPE: BaseModel

config_raw ¤

The raw runnable configuration.

TYPE: RunnableConfig

run_manager ¤

The run manager.

TYPE: CallbackManagerForChainRun

**kwargs ¤

Optional keyword arguments.

TYPE: Optional[Any] DEFAULT: {}

YIELDS DESCRIPTION
dict

The chunks of the output.

astream async ¤
astream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) -> AsyncIterator[Output]
async_invoke_config_parsed async ¤
async_invoke_config_parsed(input: CollaboratorInput, config_parsed: BaseModel, config_raw: RunnableConfig) -> CollaboratorOutput

Asynchronously invokes the collaborator with a parsed configuration.

PARAMETER DESCRIPTION
input ¤

The input data for the collaborator.

TYPE: CollaboratorInput

config_parsed ¤

The parsed configuration.

TYPE: BaseModel

config_raw ¤

The raw runnable configuration.

TYPE: RunnableConfig

RETURNS DESCRIPTION
CollaboratorOutput

The output of the collaborator.

TYPE: CollaboratorOutput

ainvoke async ¤
ainvoke(input: Input, config: Optional[RunnableConfig] = None) -> Output
invoke ¤
invoke(input: CollaboratorInput, config: RunnableConfig | None = None) -> CollaboratorOutput

Invokes the collaborator.

RAISES DESCRIPTION
Exception

Collaborator can only be called asynchronously.

start ¤

start(state: CollaboratorState, config: RunnableConfig)

distributor ¤

distributor(default_agent: str)

evaluate_distributor ¤

evaluate_distributor(state: CollaboratorState, config: RunnableConfig)

agent_node ¤

agent_node(agent: AgentBase)

router ¤

router(state: CollaboratorState, config: RunnableConfig)

evaluate_router ¤

evaluate_router(state: CollaboratorState, config: RunnableConfig)

collaborator ¤

collaborator(state: CollaboratorState, config: RunnableConfig)

cleaner ¤

cleaner(state: CollaboratorState, config: RunnableConfig)

Nodo final del graph, se utiliza para cualquier limpieza que se quiera hacer al final del graph.

Actualmente no se realiza ninguna operación, ya que en el estado se encuentra la variable output que se devuelve como resultado de la ejecución.

team_base_test ¤

CLASS DESCRIPTION
SumInput
SumOutput
SingleItemsInput
ListItemsInput
TransferBrainSchema
TransferClarification
TransferInput
TransferOutput
SumSkill
TransferSKill
AgentAdamSmith
AgentSupervisor
FUNCTION DESCRIPTION
situation_builder
create_message
use_cases_srv

Fixture para proveer el falso llm_srv

config_fake_llm
team_base
test_what_is_my_name
test_sum_with_tool
test_response_structured
test_clarification_request
test_handle_clarification_response
test_stream_what_is_my_name
ATTRIBUTE DESCRIPTION
log

Loger para el módulo

sum_computation

list_items_computation

TYPE: Skill

tools_availables

log module-attribute ¤

log = get_logger()

Loger para el módulo

sum_computation module-attribute ¤

sum_computation = SumSkill()

list_items_computation module-attribute ¤

list_items_computation: Skill = SkillStructuredResponse(name='list_items', description='shows a list of items in a structured format for the user \nuse this tool when a user anwser for list of items', brain_schema=ListItemsInput)

tools_availables module-attribute ¤

SumInput ¤

ATTRIBUTE DESCRIPTION
number_1

TYPE: int

number_2

TYPE: int

registry_id

TYPE: str

number_1 instance-attribute ¤
number_1: int
number_2 instance-attribute ¤
number_2: int
registry_id cached property ¤
registry_id: str

SumOutput ¤

ATTRIBUTE DESCRIPTION
result

TYPE: int

result instance-attribute ¤
result: int

SingleItemsInput ¤

ATTRIBUTE DESCRIPTION
name

TYPE: str

description

TYPE: str

name instance-attribute ¤
name: str
description instance-attribute ¤
description: str

ListItemsInput ¤

ATTRIBUTE DESCRIPTION
items

TYPE: List[SingleItemsInput]

registry_id

TYPE: str

items instance-attribute ¤
registry_id cached property ¤
registry_id: str

TransferBrainSchema ¤

ATTRIBUTE DESCRIPTION
from_account

TYPE: str

to_account

TYPE: str

registry_id

TYPE: str

from_account instance-attribute ¤
from_account: str
to_account instance-attribute ¤
to_account: str
registry_id cached property ¤
registry_id: str

TransferClarification ¤

ATTRIBUTE DESCRIPTION
confirmation

TYPE: Literal['y', 'n']

confirmation instance-attribute ¤
confirmation: Literal['y', 'n']

TransferInput ¤

ATTRIBUTE DESCRIPTION
from_account

TYPE: str

to_account

TYPE: str

confirmation

TYPE: Literal['y', 'n']

from_account instance-attribute ¤
from_account: str
to_account instance-attribute ¤
to_account: str
confirmation instance-attribute ¤
confirmation: Literal['y', 'n']

TransferOutput ¤

ATTRIBUTE DESCRIPTION
result

TYPE: str

new_balance

TYPE: int

result instance-attribute ¤
result: str
new_balance instance-attribute ¤
new_balance: int

SumSkill ¤

METHOD DESCRIPTION
async_executor
async_invoke_config_parsed
ainvoke
as_tool
invoke
get_output_schema
get_input_schema
ATTRIBUTE DESCRIPTION
name

TYPE: str

description

TYPE: str

brain_schema

TYPE: Type[SumInput]

result_schema

TYPE: Type[SumOutput]

config_specs

TYPE: List[ConfigurableFieldSpec]

type

TYPE: Literal['skill.computation']

require_clarification

TYPE: bool

sub_type

TYPE: Literal['direct']

name class-attribute instance-attribute ¤
name: str = 'sum'
description class-attribute instance-attribute ¤
description: str = 'given two numbers return the sum of both'
brain_schema class-attribute instance-attribute ¤
brain_schema: Type[SumInput] = SumInput
result_schema class-attribute instance-attribute ¤
result_schema: Type[SumOutput] = SumOutput
config_specs property ¤
config_specs: List[ConfigurableFieldSpec]
type class-attribute instance-attribute ¤
type: Literal['skill.computation'] = 'skill.computation'
require_clarification class-attribute instance-attribute ¤
require_clarification: bool = False
sub_type class-attribute instance-attribute ¤
sub_type: Literal['direct'] = 'direct'
async_executor async ¤
async_executor(request: SumInput, config: RunnableConfig) -> SumOutput
async_invoke_config_parsed async ¤
async_invoke_config_parsed(input: ComputationRequested, config_parsed: BaseModel, config_raw: RunnableConfig) -> ComputationResult[BrainSchema, ResultSchema]
ainvoke async ¤
ainvoke(input: Input, config: Optional[RunnableConfig] = None) -> Output
as_tool ¤
as_tool() -> Dict[str, Any]
invoke ¤
invoke(input: ComputationRequested, config: RunnableConfig | None = None) -> ComputationResult[BrainSchema, ResultSchema]
get_output_schema ¤
get_output_schema(config: Optional[RunnableConfig] = None) -> Type[ResultSchema]
get_input_schema ¤
get_input_schema(config: Optional[RunnableConfig] = None) -> Type[BrainSchema]

TransferSKill ¤

METHOD DESCRIPTION
async_executor
merge_brain_with_clarification
async_invoke_config_parsed
ainvoke
as_tool
invoke
get_output_schema
get_input_schema
get_clarification_schema
ATTRIBUTE DESCRIPTION
name

TYPE: str

description

TYPE: str

brain_schema

TYPE: Type[TransferBrainSchema]

result_schema

TYPE: Type[TransferOutput]

skill_input_schema

TYPE: Type[TransferInput]

clarification_schema

TYPE: Type[TransferClarification]

type

TYPE: Literal['skill.computation']

require_clarification

TYPE: bool

sub_type

TYPE: Literal['with-clarification']

name class-attribute instance-attribute ¤
name: str = 'transfer'
description class-attribute instance-attribute ¤
description: str = 'transfer money between accounts'
brain_schema class-attribute instance-attribute ¤
result_schema class-attribute instance-attribute ¤
skill_input_schema class-attribute instance-attribute ¤
skill_input_schema: Type[TransferInput] = TransferInput
clarification_schema class-attribute instance-attribute ¤
type class-attribute instance-attribute ¤
type: Literal['skill.computation'] = 'skill.computation'
require_clarification class-attribute instance-attribute ¤
require_clarification: bool = False
sub_type class-attribute instance-attribute ¤
sub_type: Literal['with-clarification'] = 'with-clarification'
async_executor async ¤
async_executor(request: TransferInput, config: RunnableConfig) -> TransferOutput
merge_brain_with_clarification ¤
merge_brain_with_clarification(brain_input: TransferBrainSchema, clarification_input: TransferClarification) -> TransferInput
async_invoke_config_parsed async ¤
async_invoke_config_parsed(input: ComputationRequestedWithClarification, config_parsed: BaseModel, config_raw: RunnableConfig) -> ComputationResult[SkillInputSchema, ResultSchema]
ainvoke async ¤
ainvoke(input: Input, config: Optional[RunnableConfig] = None) -> Output
as_tool ¤
as_tool() -> Dict[str, Any]
invoke ¤
invoke(input: ComputationRequested, config: RunnableConfig | None = None) -> ComputationResult[BrainSchema, ResultSchema]
get_output_schema ¤
get_output_schema(config: Optional[RunnableConfig] = None) -> Type[ResultSchema]
get_input_schema ¤
get_input_schema(config: Optional[RunnableConfig] = None) -> Type[BrainSchema]
get_clarification_schema ¤
get_clarification_schema(config: Optional[RunnableConfig] = None) -> Type[ClarificationSchema]

AgentAdamSmith ¤

AgentAdamSmith(**data)
METHOD DESCRIPTION
astream_config_parsed

Asynchronously streams the output of the collaborator.

astream
async_invoke_config_parsed

Asynchronously invokes the collaborator with a parsed configuration.

ainvoke
join_team

Assign the agent to a team and update instructions.

invoke

Invokes the collaborator.

ATTRIBUTE DESCRIPTION
name

TYPE: str

job_description

TYPE: str

public_bio

TYPE: str

options

TYPE: List[Skill]

situation_builder

TYPE: Optional[SituationBuilderFn]

config_specs

Get the merged configuration specifications for the agent.

TYPE: List[ConfigurableFieldSpec]

agent_name_intro

TYPE: str

private_bio

TYPE: Optional[str]

directives

TYPE: Optional[str]

examples

TYPE: Optional[str]

team_membership

TYPE: Optional[TeamMembership]

options_built_in

TYPE: List[Skill]

history_strategy

TYPE: HistoryStrategyInterface

instructions_transformer

TYPE: Optional[InstructionsTransformerFn]

name class-attribute instance-attribute ¤
name: str = 'Adam_Smith'
job_description class-attribute instance-attribute ¤
job_description: str = 'Expert in Finance and Mathematics'
public_bio class-attribute instance-attribute ¤
public_bio: str = '\n    If the question is about Finance and Mathematics, you handle the answer\n    using the tools at your disposition to give the most accurate answer.\n    '
options class-attribute instance-attribute ¤
situation_builder class-attribute instance-attribute ¤
config_specs property ¤
config_specs: List[ConfigurableFieldSpec]

Get the merged configuration specifications for the agent.

RETURNS DESCRIPTION
List[ConfigurableFieldSpec]

List of configuration field specs.

agent_name_intro class-attribute instance-attribute ¤
agent_name_intro: str = 'Your name is '
private_bio class-attribute instance-attribute ¤
private_bio: Optional[str] = None
directives class-attribute instance-attribute ¤
directives: Optional[str] = None
examples class-attribute instance-attribute ¤
examples: Optional[str] = None
team_membership class-attribute instance-attribute ¤
team_membership: Optional[TeamMembership] = None
options_built_in class-attribute instance-attribute ¤
options_built_in: List[Skill] = []
history_strategy class-attribute instance-attribute ¤
instructions_transformer class-attribute instance-attribute ¤
instructions_transformer: Optional[InstructionsTransformerFn] = None
astream_config_parsed async ¤
astream_config_parsed(input: CollaboratorInput, config_parsed: BaseModel, config_raw: RunnableConfig, run_manager: CallbackManagerForChainRun, **kwargs: Optional[Any]) -> AsyncIterator[Dict[str, Any]]

Asynchronously streams the output of the collaborator.

PARAMETER DESCRIPTION
input ¤

The input data for the collaborator.

TYPE: CollaboratorInput

config_parsed ¤

The parsed configuration.

TYPE: BaseModel

config_raw ¤

The raw runnable configuration.

TYPE: RunnableConfig

run_manager ¤

The run manager.

TYPE: CallbackManagerForChainRun

**kwargs ¤

Optional keyword arguments.

TYPE: Optional[Any] DEFAULT: {}

YIELDS DESCRIPTION
dict

The chunks of the output.

astream async ¤
astream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) -> AsyncIterator[Output]
async_invoke_config_parsed async ¤
async_invoke_config_parsed(input: CollaboratorInput, config_parsed: BaseModel, config_raw: RunnableConfig) -> CollaboratorOutput

Asynchronously invokes the collaborator with a parsed configuration.

PARAMETER DESCRIPTION
input ¤

The input data for the collaborator.

TYPE: CollaboratorInput

config_parsed ¤

The parsed configuration.

TYPE: BaseModel

config_raw ¤

The raw runnable configuration.

TYPE: RunnableConfig

RETURNS DESCRIPTION
CollaboratorOutput

The output of the collaborator.

TYPE: CollaboratorOutput

ainvoke async ¤
ainvoke(input: Input, config: Optional[RunnableConfig] = None) -> Output
join_team ¤

Assign the agent to a team and update instructions.

PARAMETER DESCRIPTION
team_membership ¤

The team membership object.

TYPE: TeamMembership

invoke ¤
invoke(input: CollaboratorInput, config: RunnableConfig | None = None) -> CollaboratorOutput

Invokes the collaborator.

RAISES DESCRIPTION
Exception

Collaborator can only be called asynchronously.

AgentSupervisor ¤

AgentSupervisor(**data)
METHOD DESCRIPTION
astream_config_parsed

Asynchronously streams the output of the collaborator.

astream
async_invoke_config_parsed

Asynchronously invokes the collaborator with a parsed configuration.

ainvoke
join_team

Assign the agent to a team and update instructions.

invoke

Invokes the collaborator.

ATTRIBUTE DESCRIPTION
name

TYPE: str

job_description

TYPE: str

public_bio

TYPE: str

options

TYPE: List[Skill]

config_specs

Get the merged configuration specifications for the agent.

TYPE: List[ConfigurableFieldSpec]

agent_name_intro

TYPE: str

private_bio

TYPE: Optional[str]

directives

TYPE: Optional[str]

examples

TYPE: Optional[str]

team_membership

TYPE: Optional[TeamMembership]

options_built_in

TYPE: List[Skill]

history_strategy

TYPE: HistoryStrategyInterface

situation_builder

TYPE: Optional[SituationBuilderFn]

instructions_transformer

TYPE: Optional[InstructionsTransformerFn]

name class-attribute instance-attribute ¤
name: str = 'Pablo'
job_description class-attribute instance-attribute ¤
job_description: str = "\n    Select the best team member to answer the user's question\n    "
public_bio class-attribute instance-attribute ¤
public_bio: str = '\n    You are a agent who work in a team trying to answer the questions\n    from {user_name}.\n\n    If the questions can be answered by other expert in the team\n    use the tool send_message_to_colleague to ask for help.\n\n    '
options class-attribute instance-attribute ¤
options: List[Skill] = []
config_specs property ¤
config_specs: List[ConfigurableFieldSpec]

Get the merged configuration specifications for the agent.

RETURNS DESCRIPTION
List[ConfigurableFieldSpec]

List of configuration field specs.

agent_name_intro class-attribute instance-attribute ¤
agent_name_intro: str = 'Your name is '
private_bio class-attribute instance-attribute ¤
private_bio: Optional[str] = None
directives class-attribute instance-attribute ¤
directives: Optional[str] = None
examples class-attribute instance-attribute ¤
examples: Optional[str] = None
team_membership class-attribute instance-attribute ¤
team_membership: Optional[TeamMembership] = None
options_built_in class-attribute instance-attribute ¤
options_built_in: List[Skill] = []
history_strategy class-attribute instance-attribute ¤
situation_builder class-attribute instance-attribute ¤
situation_builder: Optional[SituationBuilderFn] = None
instructions_transformer class-attribute instance-attribute ¤
instructions_transformer: Optional[InstructionsTransformerFn] = None
astream_config_parsed async ¤
astream_config_parsed(input: CollaboratorInput, config_parsed: BaseModel, config_raw: RunnableConfig, run_manager: CallbackManagerForChainRun, **kwargs: Optional[Any]) -> AsyncIterator[Dict[str, Any]]

Asynchronously streams the output of the collaborator.

PARAMETER DESCRIPTION
input ¤

The input data for the collaborator.

TYPE: CollaboratorInput

config_parsed ¤

The parsed configuration.

TYPE: BaseModel

config_raw ¤

The raw runnable configuration.

TYPE: RunnableConfig

run_manager ¤

The run manager.

TYPE: CallbackManagerForChainRun

**kwargs ¤

Optional keyword arguments.

TYPE: Optional[Any] DEFAULT: {}

YIELDS DESCRIPTION
dict

The chunks of the output.

astream async ¤
astream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) -> AsyncIterator[Output]
async_invoke_config_parsed async ¤
async_invoke_config_parsed(input: CollaboratorInput, config_parsed: BaseModel, config_raw: RunnableConfig) -> CollaboratorOutput

Asynchronously invokes the collaborator with a parsed configuration.

PARAMETER DESCRIPTION
input ¤

The input data for the collaborator.

TYPE: CollaboratorInput

config_parsed ¤

The parsed configuration.

TYPE: BaseModel

config_raw ¤

The raw runnable configuration.

TYPE: RunnableConfig

RETURNS DESCRIPTION
CollaboratorOutput

The output of the collaborator.

TYPE: CollaboratorOutput

ainvoke async ¤
ainvoke(input: Input, config: Optional[RunnableConfig] = None) -> Output
join_team ¤

Assign the agent to a team and update instructions.

PARAMETER DESCRIPTION
team_membership ¤

The team membership object.

TYPE: TeamMembership

invoke ¤
invoke(input: CollaboratorInput, config: RunnableConfig | None = None) -> CollaboratorOutput

Invokes the collaborator.

RAISES DESCRIPTION
Exception

Collaborator can only be called asynchronously.

situation_builder ¤

situation_builder(input, config)

create_message ¤

create_message(content: str)

use_cases_srv ¤

use_cases_srv()

Fixture para proveer el falso llm_srv

config_fake_llm ¤

config_fake_llm(use_cases_srv)

team_base ¤

team_base()

test_what_is_my_name async ¤

test_what_is_my_name(team_base, config_fake_llm)

test_sum_with_tool async ¤

test_sum_with_tool(team_base, config_fake_llm)

test_response_structured async ¤

test_response_structured(team_base, config_fake_llm)

test_clarification_request async ¤

test_clarification_request(team_base, config_fake_llm)

test_handle_clarification_response async ¤

test_handle_clarification_response(team_base, config_fake_llm)

test_stream_what_is_my_name async ¤

test_stream_what_is_my_name(team_base, config_fake_llm)