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 |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
CollaboratorInput |
|
CollaboratorOutput |
|
FreshMessage |
|
PublicMessage |
|
BrainSchema |
|
Skill |
Union discriminada para Skill
|
SkillComputation |
|
CrewInput |
|
CrewOutput |
|
CollaboratorInput
module-attribute
¤
CollaboratorInput = Union[CollaboratorInputFresh, CollaboratorInputClarification]
CollaboratorOutput
module-attribute
¤
CollaboratorOutput = Union[CollaboratorOutputClarification[BrainSchema], CollaboratorOutputResponse, CollaboratorOutputResponseStructured, CollaboratorOutputContribution]
Skill
module-attribute
¤
Union discriminada para Skill
SkillComputation
module-attribute
¤
SkillComputation = Union[SkillComputationDirect[BrainSchema, ResultSchema], SkillComputationWithClarification[BrainSchema, ClarificationSchema, SkillInputSchema, ResultSchema]]
__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:
|
job_description |
TYPE:
|
agent_name_intro |
TYPE:
|
public_bio |
|
private_bio |
|
directives |
|
examples |
|
team_membership |
TYPE:
|
options |
|
options_built_in |
|
history_strategy |
TYPE:
|
situation_builder |
TYPE:
|
instructions_transformer |
|
config_specs |
Get the merged configuration specifications for the agent.
TYPE:
|
team_membership
class-attribute
instance-attribute
¤
team_membership: Optional[TeamMembership] = None
history_strategy
class-attribute
instance-attribute
¤
history_strategy: HistoryStrategyInterface = MaxMessagesStrategy()
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 |
|---|---|
|
The input data for the collaborator.
TYPE:
|
|
The parsed configuration.
TYPE:
|
|
The raw runnable configuration.
TYPE:
|
|
The run manager.
TYPE:
|
|
Optional keyword arguments. |
| 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 |
|---|---|
|
The input data for the collaborator.
TYPE:
|
|
The parsed configuration.
TYPE:
|
|
The raw runnable configuration.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
CollaboratorOutput
|
The output of the collaborator.
TYPE:
|
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)
Assign the agent to a team and update instructions.
| PARAMETER | DESCRIPTION |
|---|---|
|
The team membership object.
TYPE:
|
DistributionStrategyInterface
¤
RandomStrategy
¤
SupervisionStrategy
¤
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:
|
job_description |
TYPE:
|
team_instructions |
TYPE:
|
distribution_strategy |
|
members |
|
options_built_in |
|
config_specs |
TYPE:
|
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'
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 |
|---|---|
|
The input data for the collaborator.
TYPE:
|
|
The parsed configuration.
TYPE:
|
|
The raw runnable configuration.
TYPE:
|
|
The run manager.
TYPE:
|
|
Optional keyword arguments. |
| 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 |
|---|---|
|
The input data for the collaborator.
TYPE:
|
|
The parsed configuration.
TYPE:
|
|
The raw runnable configuration.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
CollaboratorOutput
|
The output of the collaborator.
TYPE:
|
invoke
¤
invoke(input: CollaboratorInput, config: RunnableConfig | None = None) -> CollaboratorOutput
Invokes the collaborator.
| RAISES | DESCRIPTION |
|---|---|
Exception
|
Collaborator can only be called asynchronously. |
AgentMessage
¤
| METHOD | DESCRIPTION |
|---|---|
is_lc_serializable |
|
get_lc_namespace |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
author |
TYPE:
|
to |
TYPE:
|
id |
TYPE:
|
timestamp |
TYPE:
|
lc_attributes |
TYPE:
|
ClarificationRequested
¤
| METHOD | DESCRIPTION |
|---|---|
is_lc_serializable |
|
get_lc_namespace |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
name |
TYPE:
|
clarification_id |
TYPE:
|
brain_args |
|
lc_attributes |
TYPE:
|
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:
|
| 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. |
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]
join_team
abstractmethod
¤
join_team(team_membership: TeamMembership)
Abstract method to make the collaborator join a team.
| PARAMETER | DESCRIPTION |
|---|---|
|
The team membership details to join.
TYPE:
|
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 |
|---|---|
|
The input data for the collaborator.
TYPE:
|
|
The parsed configuration.
TYPE:
|
|
The raw runnable configuration.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
CollaboratorOutput
|
The output of the collaborator.
TYPE:
|
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 |
|---|---|
|
The input data for the collaborator.
TYPE:
|
|
The parsed configuration.
TYPE:
|
|
The raw runnable configuration.
TYPE:
|
|
The run manager.
TYPE:
|
|
Optional keyword arguments. |
| YIELDS | DESCRIPTION |
|---|---|
dict
|
The chunks of the output. |
CollaboratorConfig
¤
CollaboratorInputClarification
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
public_messages |
TYPE:
|
private_messages |
TYPE:
|
type |
TYPE:
|
clarification_message |
TYPE:
|
CollaboratorInputFresh
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
public_messages |
TYPE:
|
private_messages |
TYPE:
|
type |
TYPE:
|
message |
TYPE:
|
CollaboratorOutputClarification
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
type |
TYPE:
|
clarification_context |
TYPE:
|
clarification_requested |
TYPE:
|
CollaboratorOutputContribution
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
type |
TYPE:
|
contribution |
TYPE:
|
CollaboratorOutputResponse
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
type |
TYPE:
|
message |
TYPE:
|
CollaboratorOutputResponseStructured
¤
CollaboratorState
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
public_messages |
TYPE:
|
private_messages |
TYPE:
|
fresh_message |
TYPE:
|
output |
TYPE:
|
computations_requested |
TYPE:
|
computations_results |
TYPE:
|
next_step |
TYPE:
|
computations_requested
class-attribute
instance-attribute
¤
computations_requested: List[ComputationRequested] = []
computations_results
class-attribute
instance-attribute
¤
computations_results: List[ComputationResult] = []
BrainSchemaBase
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
registry_id |
TYPE:
|
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:
|
brain_args |
|
computation_id |
TYPE:
|
lc_attributes |
TYPE:
|
ComputationResult
¤
| METHOD | DESCRIPTION |
|---|---|
is_lc_serializable |
|
get_lc_namespace |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
computation_id |
TYPE:
|
name |
TYPE:
|
skill_args |
TYPE:
|
result |
TYPE:
|
lc_attributes |
TYPE:
|
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:
|
description |
TYPE:
|
brain_schema |
TYPE:
|
type |
TYPE:
|
require_clarification |
TYPE:
|
result_schema |
TYPE:
|
sub_type |
TYPE:
|
invoke
¤
invoke(input: ComputationRequested, config: RunnableConfig | None = None) -> ComputationResult[BrainSchema, ResultSchema]
get_output_schema
¤
get_output_schema(config: Optional[RunnableConfig] = None) -> 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:
|
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:
|
description |
TYPE:
|
brain_schema |
TYPE:
|
type |
TYPE:
|
require_clarification |
TYPE:
|
result_schema |
TYPE:
|
sub_type |
TYPE:
|
clarification_schema |
TYPE:
|
skill_input_schema |
TYPE:
|
sub_type
class-attribute
instance-attribute
¤
sub_type: Literal['with-clarification'] = 'with-clarification'
invoke
¤
invoke(input: ComputationRequested, config: RunnableConfig | None = None) -> ComputationResult[BrainSchema, ResultSchema]
get_output_schema
¤
get_output_schema(config: Optional[RunnableConfig] = None) -> 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:
|
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:
|
name |
TYPE:
|
description |
TYPE:
|
brain_schema |
TYPE:
|
brain_schema
class-attribute
instance-attribute
¤
brain_schema: Type[SendContribution] = SendContribution
SkillInputSchemaBase
¤
SkillStructuredResponse
¤
| METHOD | DESCRIPTION |
|---|---|
as_tool |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
name |
TYPE:
|
description |
TYPE:
|
brain_schema |
TYPE:
|
type |
TYPE:
|
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:
|
| 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. |
astream
async
¤
astream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) -> AsyncIterator[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 data for the Crew.
TYPE:
|
|
Fully parsed configuration.
TYPE:
|
|
Raw configuration data.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
CrewOutput
|
Output from the Crew after execution.
TYPE:
|
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 for the Crew.
TYPE:
|
|
Parsed configuration object.
TYPE:
|
|
Raw configuration object.
TYPE:
|
|
Callback manager for streaming.
TYPE:
|
|
Additional parameters for the streaming executor.
TYPE:
|
| YIELDS | DESCRIPTION |
|---|---|
AsyncIterator[Dict[str, Any]]
|
AsyncIterator[dict]: Streamed chunks of execution state containing output. |
CrewConfig
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
llm_srv |
TYPE:
|
use_cases_srv |
TYPE:
|
user_name |
TYPE:
|
today |
TYPE:
|
checkpointer |
TYPE:
|
model_config |
|
model_config
class-attribute
instance-attribute
¤
model_config = ConfigDict(arbitrary_types_allowed=True)
CrewState
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
public_messages |
TYPE:
|
clarification |
TYPE:
|
input |
TYPE:
|
output |
TYPE:
|
clarification
class-attribute
instance-attribute
¤
clarification: Optional[ClarificationPending] = None
CrewInputFresh
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
type |
TYPE:
|
message |
TYPE:
|
CrewInputClarification
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
type |
TYPE:
|
clarification_message |
|
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 |
|---|---|
|
Variable length argument list.
DEFAULT:
|
|
The list of namespaces to validate.
TYPE:
|
|
Arbitrary keyword arguments.
DEFAULT:
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
reviver |
TYPE:
|
UserMessage
¤
CrewDependencies
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
checkpointer |
TYPE:
|
llm_srv |
TYPE:
|
user_logged |
TYPE:
|
user_name |
TYPE:
|
today |
TYPE:
|
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:
|
runnable |
Runnable que ejecuta el Crew
TYPE:
|
settings |
Settings para el Crew
TYPE:
|
tags |
Etiquetas para categorizar el crew |
auth_strategy |
Estrategia de autorización para la aplicación
TYPE:
|
dependencies_factory |
Proveedor para dependencias custom de la aplicación
TYPE:
|
checkpointer |
Factory para checkpointer que almacena estado del Crew
TYPE:
|
llm |
Factory para LLM con qué interactúa el Crew
TYPE:
|
model_config |
Configuración del modelo
|
fastapi_router |
TYPE:
|
path
class-attribute
instance-attribute
¤
path: str = 'crew_events'
Ruta en que se monta el endpoint
tags
class-attribute
instance-attribute
¤
Etiquetas para categorizar el crew
auth_strategy
class-attribute
instance-attribute
¤
auth_strategy: AuthStrategyInterface = PublicAccessStrategy()
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
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:
|
moments |
TYPE:
|
format |
TYPE:
|
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:
|
message |
TYPE:
|
HttpMetadata
¤
PublicAccessStrategy
¤
| METHOD | DESCRIPTION |
|---|---|
execute |
|
current_user |
|
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. |
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:
|
job_description |
TYPE:
|
agent_name_intro |
TYPE:
|
public_bio |
|
private_bio |
|
directives |
|
examples |
|
team_membership |
TYPE:
|
options |
|
options_built_in |
|
history_strategy |
TYPE:
|
situation_builder |
TYPE:
|
instructions_transformer |
|
config_specs |
Get the merged configuration specifications for the agent.
TYPE:
|
team_membership
class-attribute
instance-attribute
¤
team_membership: Optional[TeamMembership] = None
history_strategy
class-attribute
instance-attribute
¤
history_strategy: HistoryStrategyInterface = MaxMessagesStrategy()
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 |
|---|---|
|
The input data for the collaborator.
TYPE:
|
|
The parsed configuration.
TYPE:
|
|
The raw runnable configuration.
TYPE:
|
|
The run manager.
TYPE:
|
|
Optional keyword arguments. |
| 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 |
|---|---|
|
The input data for the collaborator.
TYPE:
|
|
The parsed configuration.
TYPE:
|
|
The raw runnable configuration.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
CollaboratorOutput
|
The output of the collaborator.
TYPE:
|
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)
Assign the agent to a team and update instructions.
| PARAMETER | DESCRIPTION |
|---|---|
|
The team membership object.
TYPE:
|
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
|
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:
|
job_description |
TYPE:
|
agent_name_intro |
TYPE:
|
public_bio |
|
private_bio |
|
directives |
|
examples |
|
team_membership |
TYPE:
|
options |
|
options_built_in |
|
history_strategy |
TYPE:
|
situation_builder |
TYPE:
|
instructions_transformer |
|
config_specs |
Get the merged configuration specifications for the agent.
TYPE:
|
team_membership
class-attribute
instance-attribute
¤
team_membership: Optional[TeamMembership] = None
history_strategy
class-attribute
instance-attribute
¤
history_strategy: HistoryStrategyInterface = MaxMessagesStrategy()
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
¤
join_team(team_membership: TeamMembership)
Assign the agent to a team and update instructions.
| PARAMETER | DESCRIPTION |
|---|---|
|
The team membership object.
TYPE:
|
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 |
|---|---|
|
The input data for the collaborator.
TYPE:
|
|
The parsed configuration.
TYPE:
|
|
The raw runnable configuration.
TYPE:
|
|
The run manager.
TYPE:
|
|
Optional keyword arguments. |
| 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 |
|---|---|
|
The input data for the collaborator.
TYPE:
|
|
The parsed configuration.
TYPE:
|
|
The raw runnable configuration.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
CollaboratorOutput
|
The output of the collaborator.
TYPE:
|
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 |
|---|---|
|
Current collaborator state, containing messages and other workflow data.
TYPE:
|
|
Configuration for the runnable execution.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
dict
|
Dictionary containing the key "next_step" with either
|
evaluate_input
¤
evaluate_input(state: CollaboratorState, config: RunnableConfig)
Evaluate the current input step from the state.
| PARAMETER | DESCRIPTION |
|---|---|
|
Current collaborator state.
TYPE:
|
|
Runnable configuration.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
The |
brain_node
¤
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 component responsible for reasoning.
TYPE:
|
| 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 |
|---|---|
|
Current state after brain execution.
TYPE:
|
|
Runnable configuration.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
The |
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 component responsible for performing actions or computations.
TYPE:
|
| 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 |
|---|---|
|
Current state after muscle execution.
TYPE:
|
|
Runnable configuration.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
The |
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 |
|---|---|
|
Final collaborator state.
TYPE:
|
|
Runnable configuration.
TYPE:
|
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:
|
skills_availables |
|
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
¤
skills_availables = [list_items_computation, SkillContribute(), SumSkill(), TransferSkill()]
SumInput
¤
SingleItemsInput
¤
ListItemsInput
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
items |
TYPE:
|
registry_id |
TYPE:
|
TransferBrainSchema
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
from_account |
TYPE:
|
to_account |
TYPE:
|
registry_id |
TYPE:
|
TransferClarification
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
confirmation |
TYPE:
|
TransferInput
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
from_account |
TYPE:
|
to_account |
TYPE:
|
confirmation |
TYPE:
|
registry_id |
TYPE:
|
TransferOutput
¤
SumSkill
¤
| METHOD | DESCRIPTION |
|---|---|
async_executor |
|
async_invoke_config_parsed |
|
ainvoke |
|
as_tool |
|
invoke |
|
get_output_schema |
|
get_input_schema |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
name |
TYPE:
|
description |
TYPE:
|
brain_schema |
|
result_schema |
|
config_specs |
TYPE:
|
type |
TYPE:
|
require_clarification |
TYPE:
|
sub_type |
TYPE:
|
description
class-attribute
instance-attribute
¤
description: str = 'given two numbers return the sum of both'
async_invoke_config_parsed
async
¤
async_invoke_config_parsed(input: ComputationRequested, config_parsed: BaseModel, config_raw: RunnableConfig) -> ComputationResult[BrainSchema, ResultSchema]
invoke
¤
invoke(input: ComputationRequested, config: RunnableConfig | None = None) -> ComputationResult[BrainSchema, ResultSchema]
get_output_schema
¤
get_output_schema(config: Optional[RunnableConfig] = None) -> Type[ResultSchema]
TransferSkillRepositoryPort
¤
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:
|
description |
TYPE:
|
brain_schema |
TYPE:
|
result_schema |
TYPE:
|
skill_input_schema |
TYPE:
|
clarification_schema |
TYPE:
|
config_specs |
List configurable fields for this runnable.
TYPE:
|
type |
TYPE:
|
require_clarification |
TYPE:
|
sub_type |
TYPE:
|
description
class-attribute
instance-attribute
¤
description: str = 'transfer money between accounts'
brain_schema
class-attribute
instance-attribute
¤
brain_schema: Type[TransferBrainSchema] = TransferBrainSchema
result_schema
class-attribute
instance-attribute
¤
result_schema: Type[TransferOutput] = TransferOutput
skill_input_schema
class-attribute
instance-attribute
¤
skill_input_schema: Type[TransferInput] = TransferInput
clarification_schema
class-attribute
instance-attribute
¤
clarification_schema: Type[TransferClarification] = TransferClarification
config_specs
property
¤
config_specs: List[ConfigurableFieldSpec]
List configurable fields for this runnable.
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]
invoke
¤
invoke(input: ComputationRequested, config: RunnableConfig | None = None) -> ComputationResult[BrainSchema, ResultSchema]
get_output_schema
¤
get_output_schema(config: Optional[RunnableConfig] = None) -> Type[ResultSchema]
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:
|
job_description |
TYPE:
|
options |
|
config_specs |
Get the merged configuration specifications for the agent.
TYPE:
|
agent_name_intro |
TYPE:
|
public_bio |
|
private_bio |
|
directives |
|
examples |
|
team_membership |
TYPE:
|
options_built_in |
|
history_strategy |
TYPE:
|
situation_builder |
TYPE:
|
instructions_transformer |
|
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. |
team_membership
class-attribute
instance-attribute
¤
team_membership: Optional[TeamMembership] = None
history_strategy
class-attribute
instance-attribute
¤
history_strategy: HistoryStrategyInterface = MaxMessagesStrategy()
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 |
|---|---|
|
The input data for the collaborator.
TYPE:
|
|
The parsed configuration.
TYPE:
|
|
The raw runnable configuration.
TYPE:
|
|
The run manager.
TYPE:
|
|
Optional keyword arguments. |
| 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 |
|---|---|
|
The input data for the collaborator.
TYPE:
|
|
The parsed configuration.
TYPE:
|
|
The raw runnable configuration.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
CollaboratorOutput
|
The output of the collaborator.
TYPE:
|
join_team
¤
join_team(team_membership: TeamMembership)
Assign the agent to a team and update instructions.
| PARAMETER | DESCRIPTION |
|---|---|
|
The team membership object.
TYPE:
|
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:
|
instructions_transformer |
|
job_description |
TYPE:
|
config_specs |
Get the merged configuration specifications for the agent.
TYPE:
|
name |
TYPE:
|
agent_name_intro |
TYPE:
|
public_bio |
|
private_bio |
|
directives |
|
examples |
|
team_membership |
TYPE:
|
options |
|
options_built_in |
|
history_strategy |
TYPE:
|
situation_builder
class-attribute
instance-attribute
¤
situation_builder: Optional[SituationBuilderFn] = situation_builder
instructions_transformer
class-attribute
instance-attribute
¤
instructions_transformer: Optional[InstructionsTransformerFn] = instructions_transformer
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. |
team_membership
class-attribute
instance-attribute
¤
team_membership: Optional[TeamMembership] = None
history_strategy
class-attribute
instance-attribute
¤
history_strategy: HistoryStrategyInterface = MaxMessagesStrategy()
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 |
|---|---|
|
The input data for the collaborator.
TYPE:
|
|
The parsed configuration.
TYPE:
|
|
The raw runnable configuration.
TYPE:
|
|
The run manager.
TYPE:
|
|
Optional keyword arguments. |
| 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 |
|---|---|
|
The input data for the collaborator.
TYPE:
|
|
The parsed configuration.
TYPE:
|
|
The raw runnable configuration.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
CollaboratorOutput
|
The output of the collaborator.
TYPE:
|
join_team
¤
join_team(team_membership: TeamMembership)
Assign the agent to a team and update instructions.
| PARAMETER | DESCRIPTION |
|---|---|
|
The team membership object.
TYPE:
|
invoke
¤
invoke(input: CollaboratorInput, config: RunnableConfig | None = None) -> CollaboratorOutput
Invokes the collaborator.
| RAISES | DESCRIPTION |
|---|---|
Exception
|
Collaborator can only be called asynchronously. |
repository_incomplete_srv
¤
repository_incomplete_srv()
Fixture para proveer el falso repository_srv
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
¤
BrainInput = Union[BrainInputFresh, BrainInputResults]
Union type representing all possible Brain input variants.
BrainOutput
module-attribute
¤
BrainOutput = Union[BrainOutputComputationsRequired, BrainOutputContribution, BrainOutputResponse, BrainOutputResponseStructured]
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 |
|---|---|
|
The base input to process.
TYPE:
|
|
Configuration for the runnable environment.
TYPE:
|
| 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 |
|---|---|
|
The raw instruction string to transform.
TYPE:
|
|
The base input to process.
TYPE:
|
|
Configuration for the runnable environment.
TYPE:
|
| 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:
|
instructions |
Base instructions for the LLM.
TYPE:
|
agent_name |
The agent's identifier name.
TYPE:
|
situation_builder |
Optional callable for building context situations.
TYPE:
|
skills |
A list of skills available to the brain. |
history_strategy |
Strategy for managing conversation history.
TYPE:
|
instructions_transformer |
Optional callable for modifying instructions before sending to LLM. |
| 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. |
situation_builder
class-attribute
instance-attribute
¤
situation_builder: Optional[SituationBuilderFn] = None
history_strategy
class-attribute
instance-attribute
¤
history_strategy: HistoryStrategyInterface = MaxMessagesStrategy()
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]
validate_templates
¤
invoke_config_parsed
¤
invoke_config_parsed(input: BrainInput, config_parsed: BaseModel, config_raw: RunnableConfig) -> BrainOutput
Synchronously invokes the brain with parsed configuration.
| PARAMETER | DESCRIPTION |
|---|---|
|
The brain input.
TYPE:
|
|
The parsed configuration model.
TYPE:
|
|
The raw configuration.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
BrainOutput
|
The brain's output.
TYPE:
|
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 |
|---|---|
|
The brain input.
TYPE:
|
|
The parsed configuration model.
TYPE:
|
|
The raw configuration.
TYPE:
|
|
The run manager for handling callbacks.
TYPE:
|
|
Additional keyword arguments. |
| YIELDS | DESCRIPTION |
|---|---|
BaseMessage
|
Each chunk of streamed LLM output.
TYPE::
|
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
|
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:
|
instructions |
Base instructions for the LLM.
TYPE:
|
agent_name |
The agent's identifier name.
TYPE:
|
situation_builder |
Optional callable for building context situations.
TYPE:
|
skills |
A list of skills available to the brain. |
history_strategy |
Strategy for managing conversation history.
TYPE:
|
instructions_transformer |
Optional callable for modifying instructions before sending to LLM. |
| 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 |
|
situation_builder
class-attribute
instance-attribute
¤
situation_builder: Optional[SituationBuilderFn] = None
history_strategy
class-attribute
instance-attribute
¤
history_strategy: HistoryStrategyInterface = MaxMessagesStrategy()
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
¤
invoke_config_parsed
¤
invoke_config_parsed(input: BrainInput, config_parsed: BaseModel, config_raw: RunnableConfig) -> BrainOutput
Synchronously invokes the brain with parsed configuration.
| PARAMETER | DESCRIPTION |
|---|---|
|
The brain input.
TYPE:
|
|
The parsed configuration model.
TYPE:
|
|
The raw configuration.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
BrainOutput
|
The brain's output.
TYPE:
|
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 |
|---|---|
|
The brain input.
TYPE:
|
|
The parsed configuration model.
TYPE:
|
|
The raw configuration.
TYPE:
|
|
The run manager for handling callbacks.
TYPE:
|
|
Additional keyword arguments. |
| YIELDS | DESCRIPTION |
|---|---|
BaseMessage
|
Each chunk of streamed LLM output.
TYPE::
|
get_skills_as_dict
¤
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 |
| ATTRIBUTE | DESCRIPTION |
|---|---|
log |
Loger para el módulo
|
sum_computation |
|
list_items_computation |
TYPE:
|
send_message_to_colleague |
|
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
¤
SumOutput
¤
SingleItemsInput
¤
ListItemsInput
¤
Esquema de salida para fake tool de Listar items
| ATTRIBUTE | DESCRIPTION |
|---|---|
items |
TYPE:
|
registry_id |
TYPE:
|
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:
|
description |
TYPE:
|
brain_schema |
|
result_schema |
|
type |
TYPE:
|
require_clarification |
TYPE:
|
sub_type |
TYPE:
|
description
class-attribute
instance-attribute
¤
description: str = 'given two numbers return the sum of both'
async_invoke_config_parsed
async
¤
async_invoke_config_parsed(input: ComputationRequested, config_parsed: BaseModel, config_raw: RunnableConfig) -> ComputationResult[BrainSchema, ResultSchema]
invoke
¤
invoke(input: ComputationRequested, config: RunnableConfig | None = None) -> ComputationResult[BrainSchema, ResultSchema]
get_output_schema
¤
get_output_schema(config: Optional[RunnableConfig] = None) -> Type[ResultSchema]
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:
|
instructions |
TYPE:
|
skills |
|
situation_builder |
TYPE:
|
name |
TYPE:
|
history_strategy |
TYPE:
|
instructions_transformer |
|
config_specs |
Returns the list of configurable fields for this runnable.
TYPE:
|
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
¤
skills: List[Skill] = [send_message_to_colleague, sum_computation, list_items_computation]
situation_builder
class-attribute
instance-attribute
¤
situation_builder: Optional[SituationBuilderFn] = situation_builder
history_strategy
class-attribute
instance-attribute
¤
history_strategy: HistoryStrategyInterface = MaxMessagesStrategy()
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 |
|---|---|
|
The brain input.
TYPE:
|
|
The parsed configuration model.
TYPE:
|
|
The raw configuration.
TYPE:
|
|
The run manager for handling callbacks.
TYPE:
|
|
Additional keyword arguments. |
| YIELDS | DESCRIPTION |
|---|---|
BaseMessage
|
Each chunk of streamed LLM output.
TYPE::
|
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 |
|---|---|
|
The brain input.
TYPE:
|
|
The parsed configuration model.
TYPE:
|
|
The raw configuration.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
BrainOutput
|
The brain's output.
TYPE:
|
validate_templates
¤
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:
|
BrainOutput |
Union type representing all possible Brain output variants.
|
BrainOutputAdapter |
Type adapter for serializing/deserializing BrainOutput instances.
TYPE:
|
SituationBuilderFn |
Callable type for functions that build a situation description.
|
InstructionsTransformerFn |
Callable type for functions that transform instructions.
|
BrainInput
module-attribute
¤
BrainInput = Union[BrainInputFresh, BrainInputResults]
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
¤
BrainOutput = Union[BrainOutputComputationsRequired, BrainOutputContribution, BrainOutputResponse, BrainOutputResponseStructured]
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 |
|---|---|
|
The base input to process.
TYPE:
|
|
Configuration for the runnable environment.
TYPE:
|
| 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 |
|---|---|
|
The raw instruction string to transform.
TYPE:
|
|
The base input to process.
TYPE:
|
|
Configuration for the runnable environment.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
The transformed instruction string. |
BrainInputBase
¤
BrainInputFresh
¤
BrainInputResults
¤
Represents Brain input containing computation results.
| ATTRIBUTE | DESCRIPTION |
|---|---|
type |
The fixed type discriminator for this input.
TYPE:
|
computations_requested |
List of computations that were requested.
TYPE:
|
computations_results |
List of results for completed computations.
TYPE:
|
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] = []
BrainOutputBase
¤
Base class for all Brain output types.
| ATTRIBUTE | DESCRIPTION |
|---|---|
token_usage |
Optional usage statistics for token consumption.
TYPE:
|
BrainOutputResponse
¤
Represents a Brain output containing a text-based response.
| ATTRIBUTE | DESCRIPTION |
|---|---|
type |
The fixed type discriminator for this output.
TYPE:
|
message |
The agent's message to the recipient.
TYPE:
|
BrainOutputResponseStructured
¤
Represents a Brain output with structured data payload.
| ATTRIBUTE | DESCRIPTION |
|---|---|
type |
The fixed type discriminator for this output.
TYPE:
|
message_id |
Identifier for the message.
TYPE:
|
payload |
Arbitrary structured data. |
structure |
The schema or structure name for the payload.
TYPE:
|
BrainOutputContribution
¤
Represents a Brain output containing a contribution message.
| ATTRIBUTE | DESCRIPTION |
|---|---|
type |
The fixed type discriminator for this output.
TYPE:
|
message |
The agent's contribution message.
TYPE:
|
BrainOutputComputationsRequired
¤
Represents a Brain output that requires computations to be performed.
| ATTRIBUTE | DESCRIPTION |
|---|---|
type |
The fixed type discriminator for this output.
TYPE:
|
computations_required |
List of computations that need to be performed.
TYPE:
|
helpers
¤
__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 |
|---|---|
|
The
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
ComputationRequested
|
A computation request built from the action.
TYPE:
|
convert_action_to_computation_test
¤
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 |
convert_to_tool_call
¤
convert_to_tool_call(value: ComputationResult) -> ToolCall
Converts a computation result to a ToolCall.
| PARAMETER | DESCRIPTION |
|---|---|
|
The computation result to convert.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
ToolCall
|
A tool call representing the computation request.
TYPE:
|
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)
DummyComputationResult
¤
DummyComputationResult(name, computation_id, skill_args)
| ATTRIBUTE | DESCRIPTION |
|---|---|
name |
|
computation_id |
|
skill_args |
|
convert_to_tool_message
¤
| FUNCTION | DESCRIPTION |
|---|---|
convert_to_tool_message |
Converts a computation result to a |
convert_to_tool_message
¤
convert_to_tool_message(value: ComputationResult) -> ToolMessage
Converts a computation result to a ToolMessage.
| PARAMETER | DESCRIPTION |
|---|---|
|
The computation result to convert.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
ToolMessage
|
A tool message containing the computation result.
TYPE:
|
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 |
|
ensure_dict
¤
| FUNCTION | DESCRIPTION |
|---|---|
ensure_dict |
Ensures that the given candidate is a dictionary. |
ensure_dict
¤
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 |
|---|---|
|
A string or dictionary to validate. |
|
The key to use if
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Dict[str, Any]
|
Dict[str, Any]: The resulting dictionary. |
ensure_dict_test
¤
is_response_structured
¤
| FUNCTION | DESCRIPTION |
|---|---|
is_response_structured |
Checks if a Skill with the given name is of type |
is_response_structured
¤
Checks if a Skill with the given name is of type SkillStructuredResponse.
| PARAMETER | DESCRIPTION |
|---|---|
|
The name of the skill to check.
TYPE:
|
|
A list of |
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if a skill with the given name exists and is of type
|
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 |
|
FakeBrainSchema
¤
FakeResultSchema
¤
FakeClarificationSchema
¤
DummyStructuredSkill
¤
| METHOD | DESCRIPTION |
|---|---|
as_tool |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
name |
TYPE:
|
description |
TYPE:
|
brain_schema |
TYPE:
|
type |
TYPE:
|
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_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 |
|
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 |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
CollaboratorInput |
|
CollaboratorOutput |
|
AnyMessage |
|
PublicMessage |
|
FreshMessage |
|
CollaboratorInput
module-attribute
¤
CollaboratorInput = Union[CollaboratorInputFresh, CollaboratorInputClarification]
CollaboratorOutput
module-attribute
¤
CollaboratorOutput = Union[CollaboratorOutputClarification[BrainSchema], CollaboratorOutputResponse, CollaboratorOutputResponseStructured, CollaboratorOutputContribution]
AnyMessage
module-attribute
¤
AnyMessage = Union[ClarificationMessage, UserMessage, AgentMessage, ToolMessage]
__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:
|
computations_results |
TYPE:
|
requested_by |
TYPE:
|
lc_attributes |
TYPE:
|
computations_requested
instance-attribute
¤
computations_requested: List[SerializeAsAny[ComputationRequested]]
ClarificationRequested
¤
| METHOD | DESCRIPTION |
|---|---|
is_lc_serializable |
|
get_lc_namespace |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
name |
TYPE:
|
clarification_id |
TYPE:
|
brain_args |
|
lc_attributes |
TYPE:
|
CollaboratorConfig
¤
Colleague
¤
TokenUsage
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
input_tokens |
TYPE:
|
output_tokens |
TYPE:
|
total_tokens |
TYPE:
|
CollaboratorInputClarification
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
public_messages |
TYPE:
|
private_messages |
TYPE:
|
type |
TYPE:
|
clarification_message |
TYPE:
|
CollaboratorInputFresh
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
public_messages |
TYPE:
|
private_messages |
TYPE:
|
type |
TYPE:
|
message |
TYPE:
|
CollaboratorOutputClarification
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
type |
TYPE:
|
clarification_context |
TYPE:
|
clarification_requested |
TYPE:
|
CollaboratorOutputContribution
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
type |
TYPE:
|
contribution |
TYPE:
|
CollaboratorOutputResponse
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
type |
TYPE:
|
message |
TYPE:
|
CollaboratorOutputResponseStructured
¤
MaxMessagesStrategy
¤
AgentMessage
¤
| METHOD | DESCRIPTION |
|---|---|
is_lc_serializable |
|
get_lc_namespace |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
author |
TYPE:
|
to |
TYPE:
|
id |
TYPE:
|
timestamp |
TYPE:
|
lc_attributes |
TYPE:
|
ClarificationMessage
¤
| METHOD | DESCRIPTION |
|---|---|
is_lc_serializable |
|
get_lc_namespace |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
to |
TYPE:
|
lc_attributes |
TYPE:
|
timestamp |
TYPE:
|
subtype |
TYPE:
|
content |
|
payload |
|
computation_id |
TYPE:
|
name |
TYPE:
|
clarification_context |
TYPE:
|
ClarificationSimpleMessage
¤
| METHOD | DESCRIPTION |
|---|---|
is_lc_serializable |
|
get_lc_namespace |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
timestamp |
TYPE:
|
lc_attributes |
TYPE:
|
subtype |
TYPE:
|
name |
TYPE:
|
content |
|
payload |
|
computation_id |
TYPE:
|
ToolTimedMessage
¤
| METHOD | DESCRIPTION |
|---|---|
is_lc_serializable |
|
get_lc_namespace |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
timestamp |
TYPE:
|
id |
TYPE:
|
lc_attributes |
TYPE:
|
UserMessage
¤
| METHOD | DESCRIPTION |
|---|---|
is_lc_serializable |
|
get_lc_namespace |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
timestamp |
TYPE:
|
subtype |
TYPE:
|
name |
TYPE:
|
lc_attributes |
TYPE:
|
TeamMembership
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
name |
TYPE:
|
members |
|
instructions |
TYPE:
|
collaboration_tools |
|
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:
|
| 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. |
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]
join_team
abstractmethod
¤
join_team(team_membership: TeamMembership)
Abstract method to make the collaborator join a team.
| PARAMETER | DESCRIPTION |
|---|---|
|
The team membership details to join.
TYPE:
|
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 |
|---|---|
|
The input data for the collaborator.
TYPE:
|
|
The parsed configuration.
TYPE:
|
|
The raw runnable configuration.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
CollaboratorOutput
|
The output of the collaborator.
TYPE:
|
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 |
|---|---|
|
The input data for the collaborator.
TYPE:
|
|
The parsed configuration.
TYPE:
|
|
The raw runnable configuration.
TYPE:
|
|
The run manager.
TYPE:
|
|
Optional keyword arguments. |
| YIELDS | DESCRIPTION |
|---|---|
dict
|
The chunks of the output. |
CollaboratorState
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
public_messages |
TYPE:
|
private_messages |
TYPE:
|
fresh_message |
TYPE:
|
output |
TYPE:
|
computations_requested |
TYPE:
|
computations_results |
TYPE:
|
next_step |
TYPE:
|
computations_requested
class-attribute
instance-attribute
¤
computations_requested: List[ComputationRequested] = []
computations_results
class-attribute
instance-attribute
¤
computations_results: List[ComputationResult] = []
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
|
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:
|
| 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 |
|
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
¤
join_team(team_membership: TeamMembership)
Abstract method to make the collaborator join a team.
| PARAMETER | DESCRIPTION |
|---|---|
|
The team membership details to join.
TYPE:
|
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 |
|---|---|
|
The input data for the collaborator.
TYPE:
|
|
The parsed configuration.
TYPE:
|
|
The raw runnable configuration.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
CollaboratorOutput
|
The output of the collaborator.
TYPE:
|
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 |
|---|---|
|
The input data for the collaborator.
TYPE:
|
|
The parsed configuration.
TYPE:
|
|
The raw runnable configuration.
TYPE:
|
|
The run manager.
TYPE:
|
|
Optional keyword arguments. |
| YIELDS | DESCRIPTION |
|---|---|
dict
|
The chunks of the 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
|
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:
|
job_description |
TYPE:
|
config_specs |
Required fields in the configuration for this runnable.
TYPE:
|
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. |
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 |
|---|---|
|
The input data for the collaborator.
TYPE:
|
|
The parsed configuration.
TYPE:
|
|
The raw runnable configuration.
TYPE:
|
|
The run manager.
TYPE:
|
|
Optional keyword arguments. |
| 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 |
|---|---|
|
The input data for the collaborator.
TYPE:
|
|
The parsed configuration.
TYPE:
|
|
The raw runnable configuration.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
CollaboratorOutput
|
The output of the collaborator.
TYPE:
|
invoke
¤
invoke(input: CollaboratorInput, config: RunnableConfig | None = None) -> CollaboratorOutput
Invokes the collaborator.
| RAISES | DESCRIPTION |
|---|---|
Exception
|
Collaborator can only be called asynchronously. |
collaborator_input
¤
| CLASS | DESCRIPTION |
|---|---|
CollaboratorInputBase |
|
CollaboratorInputFresh |
|
CollaboratorInputClarification |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
log |
Loger para el módulo
|
CollaboratorInput |
|
CollaboratorInputAdapter |
TYPE:
|
CollaboratorInput
module-attribute
¤
CollaboratorInput = Union[CollaboratorInputFresh, CollaboratorInputClarification]
CollaboratorInputAdapter
module-attribute
¤
CollaboratorInputAdapter: TypeAdapter[CollaboratorInput] = TypeAdapter(CollaboratorInput)
CollaboratorInputBase
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
public_messages |
TYPE:
|
private_messages |
TYPE:
|
CollaboratorInputFresh
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
type |
TYPE:
|
message |
TYPE:
|
public_messages |
TYPE:
|
private_messages |
TYPE:
|
CollaboratorInputClarification
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
type |
TYPE:
|
clarification_message |
TYPE:
|
public_messages |
TYPE:
|
private_messages |
TYPE:
|
collaborator_ouput
¤
| CLASS | DESCRIPTION |
|---|---|
CollaboratorOutputBase |
|
CollaboratorOutputClarification |
|
CollaboratorOutputResponse |
|
CollaboratorOutputResponseStructured |
|
CollaboratorOutputContribution |
|
CollaboratorConfig |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
log |
Loger para el módulo
|
CollaboratorOutput |
|
CollaboratorOutputAdapter |
TYPE:
|
CollaboratorOutput
module-attribute
¤
CollaboratorOutput = Union[CollaboratorOutputClarification[BrainSchema], CollaboratorOutputResponse, CollaboratorOutputResponseStructured, CollaboratorOutputContribution]
CollaboratorOutputAdapter
module-attribute
¤
CollaboratorOutputAdapter: TypeAdapter[CollaboratorOutput] = TypeAdapter(CollaboratorOutput)
CollaboratorOutputBase
¤
CollaboratorOutputClarification
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
type |
TYPE:
|
clarification_context |
TYPE:
|
clarification_requested |
TYPE:
|
CollaboratorOutputResponse
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
type |
TYPE:
|
message |
TYPE:
|
CollaboratorOutputResponseStructured
¤
CollaboratorOutputContribution
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
type |
TYPE:
|
contribution |
TYPE:
|
history_strategy
¤
| CLASS | DESCRIPTION |
|---|---|
HistoryStrategyInterface |
|
MaxMessagesStrategy |
|
injection_exception
¤
| CLASS | DESCRIPTION |
|---|---|
InjectionException |
|
message
¤
| CLASS | DESCRIPTION |
|---|---|
Timed |
|
WithRecipient |
|
WithAuthor |
|
UserMessage |
|
ClarificationSimpleMessage |
|
ClarificationMessage |
|
AgentMessage |
|
ToolTimedMessage |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
FreshMessage |
|
PublicMessage |
|
PrivateMessage |
|
AnyMessage |
|
AnyMessage
module-attribute
¤
AnyMessage = Union[ClarificationMessage, UserMessage, AgentMessage, ToolMessage]
Timed
¤
| METHOD | DESCRIPTION |
|---|---|
is_lc_serializable |
|
get_lc_namespace |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
timestamp |
TYPE:
|
lc_attributes |
TYPE:
|
WithRecipient
¤
| METHOD | DESCRIPTION |
|---|---|
is_lc_serializable |
|
get_lc_namespace |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
to |
TYPE:
|
lc_attributes |
TYPE:
|
WithAuthor
¤
| METHOD | DESCRIPTION |
|---|---|
is_lc_serializable |
|
get_lc_namespace |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
author |
TYPE:
|
lc_attributes |
TYPE:
|
UserMessage
¤
| METHOD | DESCRIPTION |
|---|---|
is_lc_serializable |
|
get_lc_namespace |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
subtype |
TYPE:
|
name |
TYPE:
|
lc_attributes |
TYPE:
|
timestamp |
TYPE:
|
ClarificationSimpleMessage
¤
| METHOD | DESCRIPTION |
|---|---|
is_lc_serializable |
|
get_lc_namespace |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
subtype |
TYPE:
|
name |
TYPE:
|
content |
|
payload |
|
computation_id |
TYPE:
|
timestamp |
TYPE:
|
lc_attributes |
TYPE:
|
ClarificationMessage
¤
| METHOD | DESCRIPTION |
|---|---|
is_lc_serializable |
|
get_lc_namespace |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
name |
TYPE:
|
clarification_context |
TYPE:
|
to |
TYPE:
|
lc_attributes |
TYPE:
|
timestamp |
TYPE:
|
subtype |
TYPE:
|
content |
|
payload |
|
computation_id |
TYPE:
|
AgentMessage
¤
| METHOD | DESCRIPTION |
|---|---|
is_lc_serializable |
|
get_lc_namespace |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
id |
TYPE:
|
timestamp |
TYPE:
|
lc_attributes |
TYPE:
|
author |
TYPE:
|
to |
TYPE:
|
ToolTimedMessage
¤
| METHOD | DESCRIPTION |
|---|---|
is_lc_serializable |
|
get_lc_namespace |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
timestamp |
TYPE:
|
id |
TYPE:
|
lc_attributes |
TYPE:
|
state
¤
| CLASS | DESCRIPTION |
|---|---|
CollaboratorState |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
log |
Loger para el módulo
|
CollaboratorState
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
public_messages |
TYPE:
|
private_messages |
TYPE:
|
fresh_message |
TYPE:
|
output |
TYPE:
|
computations_requested |
TYPE:
|
computations_results |
TYPE:
|
next_step |
TYPE:
|
computations_requested
class-attribute
instance-attribute
¤
computations_requested: List[ComputationRequested] = []
computations_results
class-attribute
instance-attribute
¤
computations_results: List[ComputationResult] = []
team_membership
¤
| CLASS | DESCRIPTION |
|---|---|
TeamMembership |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
log |
Loger para el módulo
|
TeamMembership
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
name |
TYPE:
|
members |
|
instructions |
TYPE:
|
collaboration_tools |
|
types
¤
| CLASS | DESCRIPTION |
|---|---|
ClarificationContext |
|
ClarificationRequested |
|
CollaboratorConfig |
|
Colleague |
|
TokenUsage |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
log |
Loger para el módulo
|
ClarificationContext
¤
| METHOD | DESCRIPTION |
|---|---|
is_lc_serializable |
|
get_lc_namespace |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
computations_requested |
TYPE:
|
computations_results |
TYPE:
|
requested_by |
TYPE:
|
lc_attributes |
TYPE:
|
computations_requested
instance-attribute
¤
computations_requested: List[SerializeAsAny[ComputationRequested]]
ClarificationRequested
¤
| METHOD | DESCRIPTION |
|---|---|
is_lc_serializable |
|
get_lc_namespace |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
name |
TYPE:
|
clarification_id |
TYPE:
|
brain_args |
|
lc_attributes |
TYPE:
|
CollaboratorConfig
¤
Colleague
¤
TokenUsage
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
input_tokens |
TYPE:
|
output_tokens |
TYPE:
|
total_tokens |
TYPE:
|
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:
|
CrewOutput |
|
CrewInputAdapter
module-attribute
¤
__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:
|
| 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. |
astream
async
¤
astream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) -> AsyncIterator[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 data for the Crew.
TYPE:
|
|
Fully parsed configuration.
TYPE:
|
|
Raw configuration data.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
CrewOutput
|
Output from the Crew after execution.
TYPE:
|
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 for the Crew.
TYPE:
|
|
Parsed configuration object.
TYPE:
|
|
Raw configuration object.
TYPE:
|
|
Callback manager for streaming.
TYPE:
|
|
Additional parameters for the streaming executor.
TYPE:
|
| YIELDS | DESCRIPTION |
|---|---|
AsyncIterator[Dict[str, Any]]
|
AsyncIterator[dict]: Streamed chunks of execution state containing output. |
CrewState
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
public_messages |
TYPE:
|
clarification |
TYPE:
|
input |
TYPE:
|
output |
TYPE:
|
clarification
class-attribute
instance-attribute
¤
clarification: Optional[ClarificationPending] = None
CrewConfig
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
llm_srv |
TYPE:
|
use_cases_srv |
TYPE:
|
user_name |
TYPE:
|
today |
TYPE:
|
checkpointer |
TYPE:
|
model_config |
|
model_config
class-attribute
instance-attribute
¤
model_config = ConfigDict(arbitrary_types_allowed=True)
CrewInputClarification
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
type |
TYPE:
|
clarification_message |
|
CrewInputFresh
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
type |
TYPE:
|
message |
TYPE:
|
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
|
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:
|
| 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 |
|
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 data for the Crew.
TYPE:
|
|
Fully parsed configuration.
TYPE:
|
|
Raw configuration data.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
CrewOutput
|
Output from the Crew after execution.
TYPE:
|
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 for the Crew.
TYPE:
|
|
Parsed configuration object.
TYPE:
|
|
Raw configuration object.
TYPE:
|
|
Callback manager for streaming.
TYPE:
|
|
Additional parameters for the streaming executor.
TYPE:
|
| YIELDS | DESCRIPTION |
|---|---|
AsyncIterator[Dict[str, Any]]
|
AsyncIterator[dict]: Streamed chunks of execution state containing output. |
team_node
¤
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 |
|---|---|
|
The team instance that will handle the input.
TYPE:
|
| 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
¤
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 |
|---|---|
|
The current state of the Crew execution.
TYPE:
|
|
The configuration used for this execution.
TYPE:
|
| 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
¤
| 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:
|
tools_availables |
|
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
¤
tools_availables = [sum_computation, list_items_computation, TransferSkill()]
SumInput
¤
SingleItemsInput
¤
ListItemsInput
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
items |
TYPE:
|
registry_id |
TYPE:
|
BalanceInput
¤
TransferBrainSchema
¤
| METHOD | DESCRIPTION |
|---|---|
is_lc_serializable |
|
get_lc_namespace |
|
lc_id |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
from_account |
TYPE:
|
to_account |
TYPE:
|
lc_attributes |
TYPE:
|
registry_id |
TYPE:
|
TransferClarification
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
confirmation |
TYPE:
|
TransferInput
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
from_account |
TYPE:
|
to_account |
TYPE:
|
confirmation |
TYPE:
|
TransferOutput
¤
| METHOD | DESCRIPTION |
|---|---|
is_lc_serializable |
|
get_lc_namespace |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
result |
TYPE:
|
new_balance |
TYPE:
|
lc_attributes |
TYPE:
|
SumSkill
¤
| METHOD | DESCRIPTION |
|---|---|
async_executor |
|
async_invoke_config_parsed |
|
ainvoke |
|
as_tool |
|
invoke |
|
get_output_schema |
|
get_input_schema |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
name |
TYPE:
|
description |
TYPE:
|
brain_schema |
|
result_schema |
|
config_specs |
TYPE:
|
type |
TYPE:
|
require_clarification |
TYPE:
|
sub_type |
TYPE:
|
description
class-attribute
instance-attribute
¤
description: str = 'given two numbers return the sum of both'
async_invoke_config_parsed
async
¤
async_invoke_config_parsed(input: ComputationRequested, config_parsed: BaseModel, config_raw: RunnableConfig) -> ComputationResult[BrainSchema, ResultSchema]
invoke
¤
invoke(input: ComputationRequested, config: RunnableConfig | None = None) -> ComputationResult[BrainSchema, ResultSchema]
get_output_schema
¤
get_output_schema(config: Optional[RunnableConfig] = None) -> Type[ResultSchema]
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:
|
description |
TYPE:
|
brain_schema |
TYPE:
|
result_schema |
TYPE:
|
skill_input_schema |
TYPE:
|
clarification_schema |
TYPE:
|
config_specs |
List configurable fields for this runnable.
TYPE:
|
type |
TYPE:
|
require_clarification |
TYPE:
|
sub_type |
TYPE:
|
description
class-attribute
instance-attribute
¤
description: str = 'transfer money between accounts'
brain_schema
class-attribute
instance-attribute
¤
brain_schema: Type[TransferBrainSchema] = TransferBrainSchema
result_schema
class-attribute
instance-attribute
¤
result_schema: Type[TransferOutput] = TransferOutput
skill_input_schema
class-attribute
instance-attribute
¤
skill_input_schema: Type[TransferInput] = TransferInput
clarification_schema
class-attribute
instance-attribute
¤
clarification_schema: Type[TransferClarification] = TransferClarification
config_specs
property
¤
config_specs: List[ConfigurableFieldSpec]
List configurable fields for this runnable.
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]
invoke
¤
invoke(input: ComputationRequested, config: RunnableConfig | None = None) -> ComputationResult[BrainSchema, ResultSchema]
get_output_schema
¤
get_output_schema(config: Optional[RunnableConfig] = None) -> Type[ResultSchema]
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:
|
job_description |
TYPE:
|
options |
|
config_specs |
Get the merged configuration specifications for the agent.
TYPE:
|
agent_name_intro |
TYPE:
|
public_bio |
|
private_bio |
|
directives |
|
examples |
|
team_membership |
TYPE:
|
options_built_in |
|
history_strategy |
TYPE:
|
situation_builder |
TYPE:
|
instructions_transformer |
|
job_description
class-attribute
instance-attribute
¤
job_description: str = 'Expert in Finance and Mathematics'
config_specs
property
¤
config_specs: List[ConfigurableFieldSpec]
Get the merged configuration specifications for the agent.
| RETURNS | DESCRIPTION |
|---|---|
List[ConfigurableFieldSpec]
|
List of configuration field specs. |
team_membership
class-attribute
instance-attribute
¤
team_membership: Optional[TeamMembership] = None
history_strategy
class-attribute
instance-attribute
¤
history_strategy: HistoryStrategyInterface = MaxMessagesStrategy()
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 |
|---|---|
|
The input data for the collaborator.
TYPE:
|
|
The parsed configuration.
TYPE:
|
|
The raw runnable configuration.
TYPE:
|
|
The run manager.
TYPE:
|
|
Optional keyword arguments. |
| 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 |
|---|---|
|
The input data for the collaborator.
TYPE:
|
|
The parsed configuration.
TYPE:
|
|
The raw runnable configuration.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
CollaboratorOutput
|
The output of the collaborator.
TYPE:
|
join_team
¤
join_team(team_membership: TeamMembership)
Assign the agent to a team and update instructions.
| PARAMETER | DESCRIPTION |
|---|---|
|
The team membership object.
TYPE:
|
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:
|
job_description |
TYPE:
|
options |
|
config_specs |
Get the merged configuration specifications for the agent.
TYPE:
|
agent_name_intro |
TYPE:
|
public_bio |
|
private_bio |
|
directives |
|
examples |
|
team_membership |
TYPE:
|
options_built_in |
|
history_strategy |
TYPE:
|
situation_builder |
TYPE:
|
instructions_transformer |
|
job_description
class-attribute
instance-attribute
¤
job_description: str = "Select the best team member to answer the user's question"
config_specs
property
¤
config_specs: List[ConfigurableFieldSpec]
Get the merged configuration specifications for the agent.
| RETURNS | DESCRIPTION |
|---|---|
List[ConfigurableFieldSpec]
|
List of configuration field specs. |
team_membership
class-attribute
instance-attribute
¤
team_membership: Optional[TeamMembership] = None
history_strategy
class-attribute
instance-attribute
¤
history_strategy: HistoryStrategyInterface = MaxMessagesStrategy()
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 |
|---|---|
|
The input data for the collaborator.
TYPE:
|
|
The parsed configuration.
TYPE:
|
|
The raw runnable configuration.
TYPE:
|
|
The run manager.
TYPE:
|
|
Optional keyword arguments. |
| 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 |
|---|---|
|
The input data for the collaborator.
TYPE:
|
|
The parsed configuration.
TYPE:
|
|
The raw runnable configuration.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
CollaboratorOutput
|
The output of the collaborator.
TYPE:
|
join_team
¤
join_team(team_membership: TeamMembership)
Assign the agent to a team and update instructions.
| PARAMETER | DESCRIPTION |
|---|---|
|
The team membership object.
TYPE:
|
invoke
¤
invoke(input: CollaboratorInput, config: RunnableConfig | None = None) -> CollaboratorOutput
Invokes the collaborator.
| RAISES | DESCRIPTION |
|---|---|
Exception
|
Collaborator can only be called asynchronously. |
crew_input
¤
| CLASS | DESCRIPTION |
|---|---|
CrewInputBase |
|
CrewInputFresh |
|
CrewInputClarification |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
log |
Loger para el módulo
|
CrewInput |
|
CrewInputAdapter |
TYPE:
|
CrewInputAdapter
module-attribute
¤
CrewInputBase
¤
CrewInputFresh
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
type |
TYPE:
|
message |
TYPE:
|
crew_output
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
CrewOutput |
|
state
¤
| CLASS | DESCRIPTION |
|---|---|
CrewState |
|
CrewState
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
public_messages |
TYPE:
|
clarification |
TYPE:
|
input |
TYPE:
|
output |
TYPE:
|
clarification
class-attribute
instance-attribute
¤
clarification: Optional[ClarificationPending] = None
types
¤
| CLASS | DESCRIPTION |
|---|---|
CrewConfig |
|
ClarificationPending |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
log |
Loger para el módulo
|
CrewConfig
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
checkpointer |
TYPE:
|
model_config |
|
llm_srv |
TYPE:
|
use_cases_srv |
TYPE:
|
user_name |
TYPE:
|
today |
TYPE:
|
model_config
class-attribute
instance-attribute
¤
model_config = ConfigDict(arbitrary_types_allowed=True)
ClarificationPending
¤
| METHOD | DESCRIPTION |
|---|---|
is_lc_serializable |
|
get_lc_namespace |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
requested |
TYPE:
|
context |
TYPE:
|
lc_attributes |
TYPE:
|
duty
¤
Duties that performs a collaborator
| MODULE | DESCRIPTION |
|---|---|
duty_base |
|
duty_base_test |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
__all__ |
|
duty_base
¤
| CLASS | DESCRIPTION |
|---|---|
DutyBase |
Abstract base class for the duties a collaborator can perform. |
| ATTRIBUTE | DESCRIPTION |
|---|---|
DutyInput |
|
DutyOutput |
|
DutyState |
|
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:
|
description |
TYPE:
|
state_schema |
|
config_specs |
Required fields in the configuration for this runnable.
TYPE:
|
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 |
|---|---|
|
The input data for the duty.
TYPE:
|
|
The parsed configuration.
TYPE:
|
|
The raw runnable configuration.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
DutyOutput
|
The output of the duty.
TYPE:
|
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 |
|---|---|
|
The input data for the collaborator.
TYPE:
|
|
The parsed configuration.
TYPE:
|
|
The raw runnable configuration.
TYPE:
|
|
The run manager.
TYPE:
|
|
Optional keyword arguments. |
| YIELDS | DESCRIPTION |
|---|---|
dict
|
The chunks of the 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
|
State
¤
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 |
|
multi_turn |
TYPE:
|
description |
TYPE:
|
config_specs |
Required fields in the configuration for this runnable.
TYPE:
|
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 |
|---|---|
|
The input data for the collaborator.
TYPE:
|
|
The parsed configuration.
TYPE:
|
|
The raw runnable configuration.
TYPE:
|
|
The run manager.
TYPE:
|
|
Optional keyword arguments. |
| 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 |
|---|---|
|
The input data for the duty.
TYPE:
|
|
The parsed configuration.
TYPE:
|
|
The raw runnable configuration.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
DutyOutput
|
The output of the duty.
TYPE:
|
invoke
¤
invoke(input: DutyInput, config: RunnableConfig | None = None) -> DutyOutput
Invokes the duty.
| RAISES | DESCRIPTION |
|---|---|
Exception
|
Collaborator can only be called asynchronously. |
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
¤
create_dynamic_protocol
¤
| FUNCTION | DESCRIPTION |
|---|---|
create_dynamic_protocol |
Dynamically create a Protocol that includes methods and attributes |
fake_llm
¤
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 |
|
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 |
|---|---|
|
Variable length argument list.
DEFAULT:
|
|
The list of namespaces to validate.
TYPE:
|
|
Arbitrary keyword arguments.
DEFAULT:
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
reviver |
TYPE:
|
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
|
read_jsonl_file
¤
| FUNCTION | DESCRIPTION |
|---|---|
read_jsonl_file |
Reads a JSON Lines (JSONL) file and returns its content |
read_jsonl_file
¤
snake_to_camel
¤
| FUNCTION | DESCRIPTION |
|---|---|
snake_to_camel |
|
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:
|
llm_srv |
TYPE:
|
user_logged |
TYPE:
|
user_name |
TYPE:
|
today |
TYPE:
|
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:
|
runnable |
Runnable que ejecuta el Crew
TYPE:
|
settings |
Settings para el Crew
TYPE:
|
tags |
Etiquetas para categorizar el crew |
auth_strategy |
Estrategia de autorización para la aplicación
TYPE:
|
dependencies_factory |
Proveedor para dependencias custom de la aplicación
TYPE:
|
checkpointer |
Factory para checkpointer que almacena estado del Crew
TYPE:
|
llm |
Factory para LLM con qué interactúa el Crew
TYPE:
|
model_config |
Configuración del modelo
|
fastapi_router |
TYPE:
|
path
class-attribute
instance-attribute
¤
path: str = 'crew_events'
Ruta en que se monta el endpoint
tags
class-attribute
instance-attribute
¤
Etiquetas para categorizar el crew
auth_strategy
class-attribute
instance-attribute
¤
auth_strategy: AuthStrategyInterface = PublicAccessStrategy()
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
PublicAccessStrategy
¤
| METHOD | DESCRIPTION |
|---|---|
execute |
|
current_user |
|
UserMessage
¤
HttpInputFresh
¤
New input originated by a user message.
Is the most used message in a normal conversation.
| ATTRIBUTE | DESCRIPTION |
|---|---|
type |
TYPE:
|
message |
TYPE:
|
HttpMetadata
¤
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:
|
moments |
TYPE:
|
format |
TYPE:
|
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 |
|
PublicAccessStrategy
¤
| METHOD | DESCRIPTION |
|---|---|
execute |
|
current_user |
|
GoogleAuthStrategy
¤
| METHOD | DESCRIPTION |
|---|---|
current_user |
|
execute |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
token_uri |
TYPE:
|
client_id |
TYPE:
|
client_secret |
TYPE:
|
auth_strategy_interface
¤
| CLASS | DESCRIPTION |
|---|---|
AuthStrategyInterface |
|
AuthStrategyInterface
¤
| METHOD | DESCRIPTION |
|---|---|
execute |
|
current_user |
|
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 |
|
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:
|
client_id |
TYPE:
|
client_secret |
TYPE:
|
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))
public_access_strategy
¤
| CLASS | DESCRIPTION |
|---|---|
PublicAccessStrategy |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
log |
Logger para la clase
|
user_logged
¤
| CLASS | DESCRIPTION |
|---|---|
UserLogged |
|
crew_dependencies
¤
| CLASS | DESCRIPTION |
|---|---|
CrewDependencies |
|
CrewDependencies
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
checkpointer |
TYPE:
|
llm_srv |
TYPE:
|
user_logged |
TYPE:
|
user_name |
TYPE:
|
today |
TYPE:
|
crew_router_base
¤
| CLASS | DESCRIPTION |
|---|---|
CrewRouterBase |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
text_stream_content_type |
|
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'}}}}
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:
|
runnable |
Runnable que ejecuta el Crew
TYPE:
|
settings |
Settings para el Crew
TYPE:
|
tags |
Etiquetas para categorizar el crew |
auth_strategy |
Estrategia de autorización para la aplicación
TYPE:
|
dependencies_factory |
Proveedor para dependencias custom de la aplicación
TYPE:
|
checkpointer |
Factory para checkpointer que almacena estado del Crew
TYPE:
|
llm |
Factory para LLM con qué interactúa el Crew
TYPE:
|
model_config |
Configuración del modelo
|
fastapi_router |
TYPE:
|
path
class-attribute
instance-attribute
¤
path: str = 'crew_events'
Ruta en que se monta el endpoint
tags
class-attribute
instance-attribute
¤
Etiquetas para categorizar el crew
auth_strategy
class-attribute
instance-attribute
¤
auth_strategy: AuthStrategyInterface = PublicAccessStrategy()
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
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
|
FakeLLM
¤
| METHOD | DESCRIPTION |
|---|---|
bind_tools |
|
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:
|
job_description |
TYPE:
|
config_specs |
Get the merged configuration specifications for the agent.
TYPE:
|
agent_name_intro |
TYPE:
|
public_bio |
|
private_bio |
|
directives |
|
examples |
|
team_membership |
TYPE:
|
options |
|
options_built_in |
|
history_strategy |
TYPE:
|
situation_builder |
TYPE:
|
instructions_transformer |
|
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. |
team_membership
class-attribute
instance-attribute
¤
team_membership: Optional[TeamMembership] = None
history_strategy
class-attribute
instance-attribute
¤
history_strategy: HistoryStrategyInterface = MaxMessagesStrategy()
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 |
|---|---|
|
The input data for the collaborator.
TYPE:
|
|
The parsed configuration.
TYPE:
|
|
The raw runnable configuration.
TYPE:
|
|
The run manager.
TYPE:
|
|
Optional keyword arguments. |
| 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 |
|---|---|
|
The input data for the collaborator.
TYPE:
|
|
The parsed configuration.
TYPE:
|
|
The raw runnable configuration.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
CollaboratorOutput
|
The output of the collaborator.
TYPE:
|
join_team
¤
join_team(team_membership: TeamMembership)
Assign the agent to a team and update instructions.
| PARAMETER | DESCRIPTION |
|---|---|
|
The team membership object.
TYPE:
|
invoke
¤
invoke(input: CollaboratorInput, config: RunnableConfig | None = None) -> CollaboratorOutput
Invokes the collaborator.
| RAISES | DESCRIPTION |
|---|---|
Exception
|
Collaborator can only be called asynchronously. |
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.
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:
|
llm_model_open_ai |
TYPE:
|
llm_temperature_open_ai |
TYPE:
|
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)
model_config
class-attribute
instance-attribute
¤
model_config = SettingsConfigDict(extra='allow', env_file='')
crew_settings_test
¤
factories
¤
| MODULE | DESCRIPTION |
|---|---|
chatopenai_factory |
|
memory_factory |
|
chatopenai_factory
¤
memory_factory
¤
| FUNCTION | DESCRIPTION |
|---|---|
memory_factory |
|
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 |
|
UserMessage
¤
ClarificationSimpleMessage
¤
HttpInputFresh
¤
New input originated by a user message.
Is the most used message in a normal conversation.
| ATTRIBUTE | DESCRIPTION |
|---|---|
type |
TYPE:
|
message |
TYPE:
|
HttpInputClarification
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
type |
TYPE:
|
clarification_message |
|
HttpMetadata
¤
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:
|
moments |
TYPE:
|
format |
TYPE:
|
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 |
|
ScopeAvailables
module-attribute
¤
ScopeAvailables = Literal['answer', 'deliberations', 'computations']
StreamFilter
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
include_names |
|
include_tags |
|
include_types |
|
exclude_names |
|
exclude_tags |
|
exclude_types |
|
prepare_error_for_client
¤
prepare_error_for_client(error: BaseException) -> str
Prepara un error para enviarlo como evento
| PARAMETER | DESCRIPTION |
|---|---|
|
Error generado en la aplicación
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
json con la serializacion del error
TYPE:
|
is_event_required
¤
is_event_required(event: StreamEvent, allowed_event_moments: Set[AllowedEventMoment]) -> bool
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 que se quiere convertir los eventos
TYPE:
|
|
Data de entrada al runnable
TYPE:
|
|
configuración para el runnable
TYPE:
|
| 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
¤
MuscleOutput = Union[MuscleOutputClarification, MuscleOutputResults]
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 |
|
agent_name |
TYPE:
|
skills |
TYPE:
|
config_specs |
List configurable fields for this runnable.
TYPE:
|
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
MuscleInputClarificationResponse
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
type |
TYPE:
|
clarification_message |
TYPE:
|
MuscleInputComputationRequested
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
type |
TYPE:
|
computations_required |
TYPE:
|
MuscleOutputClarification
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
type |
TYPE:
|
clarification_context |
TYPE:
|
clarification_requested |
TYPE:
|
type
class-attribute
instance-attribute
¤
type: Literal['muscle.output.clarification'] = 'muscle.output.clarification'
clarification_requested
instance-attribute
¤
clarification_requested: SerializeAsAny[ClarificationRequested]
MuscleOutputResults
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
type |
TYPE:
|
computations_requested |
TYPE:
|
computations_results |
TYPE:
|
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
__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
|
execute_computation
async
¤
execute_computation(option: SkillComputationDirect | SkillComputationWithClarification, request: ComputationRequested | ComputationRequestedWithClarification, config: RunnableConfig) -> ComputationResult
execute_computation_test
¤
| CLASS | DESCRIPTION |
|---|---|
FakeBrainSchema |
|
FakeResultSchema |
|
FakeClarificationSchema |
|
FakeSkillComputationDirect |
|
FakeSkillComputationWithClarification |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
log |
Loger para el módulo
|
FakeBrainSchema
¤
FakeResultSchema
¤
FakeClarificationSchema
¤
FakeSkillComputationDirect
¤
| METHOD | DESCRIPTION |
|---|---|
async_executor |
|
async_invoke_config_parsed |
|
ainvoke |
|
as_tool |
|
invoke |
|
get_output_schema |
|
get_input_schema |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
name |
TYPE:
|
brain_args |
|
clarification_args |
|
computation_id |
TYPE:
|
description |
TYPE:
|
brain_schema |
TYPE:
|
result_schema |
TYPE:
|
type |
TYPE:
|
require_clarification |
TYPE:
|
sub_type |
TYPE:
|
result_schema
class-attribute
instance-attribute
¤
result_schema: FakeResultSchema = FakeResultSchema()
async_invoke_config_parsed
async
¤
async_invoke_config_parsed(input: ComputationRequested, config_parsed: BaseModel, config_raw: RunnableConfig) -> ComputationResult[BrainSchema, ResultSchema]
invoke
¤
invoke(input: ComputationRequested, config: RunnableConfig | None = None) -> ComputationResult[BrainSchema, ResultSchema]
get_output_schema
¤
get_output_schema(config: Optional[RunnableConfig] = None) -> Type[ResultSchema]
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:
|
brain_args |
|
clarification_args |
|
computation_id |
TYPE:
|
description |
TYPE:
|
brain_schema |
TYPE:
|
result_schema |
TYPE:
|
clarification_schema |
TYPE:
|
skill_input_schema |
TYPE:
|
type |
TYPE:
|
require_clarification |
TYPE:
|
sub_type |
TYPE:
|
result_schema
class-attribute
instance-attribute
¤
result_schema: FakeResultSchema = FakeResultSchema()
clarification_schema
class-attribute
instance-attribute
¤
clarification_schema: FakeClarificationSchema = FakeClarificationSchema()
skill_input_schema
class-attribute
instance-attribute
¤
skill_input_schema: FakeClarificationSchema = FakeClarificationSchema()
sub_type
class-attribute
instance-attribute
¤
sub_type: Literal['with-clarification'] = 'with-clarification'
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]
invoke
¤
invoke(input: ComputationRequested, config: RunnableConfig | None = None) -> ComputationResult[BrainSchema, ResultSchema]
get_output_schema
¤
get_output_schema(config: Optional[RunnableConfig] = None) -> Type[ResultSchema]
get_clarification_schema
¤
get_clarification_schema(config: Optional[RunnableConfig] = None) -> Type[ClarificationSchema]
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()
execute_computations_pending
¤
| FUNCTION | DESCRIPTION |
|---|---|
execute_computations_pending |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
log |
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 |
|
FakeBrainSchema
¤
FakeResultSchema
¤
FakeClarificationSchema
¤
DummyDirect
¤
| METHOD | DESCRIPTION |
|---|---|
async_executor |
|
ainvoke |
|
async_invoke_config_parsed |
|
as_tool |
|
invoke |
|
get_output_schema |
|
get_input_schema |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
name |
TYPE:
|
brain_args |
|
clarification_args |
|
computation_id |
TYPE:
|
description |
TYPE:
|
brain_schema |
TYPE:
|
result_schema |
TYPE:
|
type |
TYPE:
|
require_clarification |
TYPE:
|
sub_type |
TYPE:
|
result_schema
class-attribute
instance-attribute
¤
result_schema: FakeResultSchema = FakeResultSchema()
async_invoke_config_parsed
async
¤
async_invoke_config_parsed(input: ComputationRequested, config_parsed: BaseModel, config_raw: RunnableConfig) -> ComputationResult[BrainSchema, ResultSchema]
invoke
¤
invoke(input: ComputationRequested, config: RunnableConfig | None = None) -> ComputationResult[BrainSchema, ResultSchema]
get_output_schema
¤
get_output_schema(config: Optional[RunnableConfig] = None) -> Type[ResultSchema]
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:
|
brain_args |
|
clarification_args |
|
computation_id |
TYPE:
|
description |
TYPE:
|
brain_schema |
TYPE:
|
result_schema |
TYPE:
|
clarification_schema |
TYPE:
|
skill_input_schema |
TYPE:
|
type |
TYPE:
|
require_clarification |
TYPE:
|
sub_type |
TYPE:
|
result_schema
class-attribute
instance-attribute
¤
result_schema: FakeResultSchema = FakeResultSchema()
clarification_schema
class-attribute
instance-attribute
¤
clarification_schema: FakeClarificationSchema = FakeClarificationSchema()
skill_input_schema
class-attribute
instance-attribute
¤
skill_input_schema: FakeClarificationSchema = FakeClarificationSchema()
sub_type
class-attribute
instance-attribute
¤
sub_type: Literal['with-clarification'] = 'with-clarification'
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]
invoke
¤
invoke(input: ComputationRequested, config: RunnableConfig | None = None) -> ComputationResult[BrainSchema, ResultSchema]
get_output_schema
¤
get_output_schema(config: Optional[RunnableConfig] = None) -> Type[ResultSchema]
get_clarification_schema
¤
get_clarification_schema(config: Optional[RunnableConfig] = None) -> Type[ClarificationSchema]
test_direct_computations_only_calls_execute_computation
async
¤
test_direct_computations_only_calls_execute_computation()
process_clarification_response
¤
| FUNCTION | DESCRIPTION |
|---|---|
process_clarification_response |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
log |
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:
|
brain_args |
TYPE:
|
clarification_args |
TYPE:
|
computation_id |
TYPE:
|
description |
TYPE:
|
brain_schema |
TYPE:
|
result_schema |
TYPE:
|
clarification_schema |
TYPE:
|
skill_input_schema |
TYPE:
|
type |
TYPE:
|
require_clarification |
TYPE:
|
sub_type |
TYPE:
|
sub_type
class-attribute
instance-attribute
¤
sub_type: Literal['with-clarification'] = 'with-clarification'
async_invoke_config_parsed
async
¤
async_invoke_config_parsed(input: ComputationRequestedWithClarification, config_parsed: BaseModel, config_raw: RunnableConfig) -> ComputationResult[SkillInputSchema, ResultSchema]
invoke
¤
invoke(input: ComputationRequested, config: RunnableConfig | None = None) -> ComputationResult[BrainSchema, ResultSchema]
get_output_schema
¤
get_output_schema(config: Optional[RunnableConfig] = None) -> Type[ResultSchema]
get_clarification_schema
¤
get_clarification_schema(config: Optional[RunnableConfig] = None) -> Type[ClarificationSchema]
process_computations_request
¤
| FUNCTION | DESCRIPTION |
|---|---|
process_computations_request |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
log |
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
¤
FakeResultSchema
¤
FakeClarificationSchema
¤
DummyDirect
¤
| METHOD | DESCRIPTION |
|---|---|
async_executor |
|
ainvoke |
|
async_invoke_config_parsed |
|
as_tool |
|
invoke |
|
get_output_schema |
|
get_input_schema |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
name |
TYPE:
|
brain_args |
|
clarification_args |
|
computation_id |
TYPE:
|
description |
TYPE:
|
brain_schema |
TYPE:
|
result_schema |
TYPE:
|
type |
TYPE:
|
require_clarification |
TYPE:
|
sub_type |
TYPE:
|
result_schema
class-attribute
instance-attribute
¤
result_schema: FakeResultSchema = FakeResultSchema()
async_invoke_config_parsed
async
¤
async_invoke_config_parsed(input: ComputationRequested, config_parsed: BaseModel, config_raw: RunnableConfig) -> ComputationResult[BrainSchema, ResultSchema]
invoke
¤
invoke(input: ComputationRequested, config: RunnableConfig | None = None) -> ComputationResult[BrainSchema, ResultSchema]
get_output_schema
¤
get_output_schema(config: Optional[RunnableConfig] = None) -> Type[ResultSchema]
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
|
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 |
|
agent_name |
TYPE:
|
skills |
TYPE:
|
config_specs |
List configurable fields for this runnable.
TYPE:
|
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
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 |
|
SumInput
¤
TransferBrainSchema
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
from_account |
TYPE:
|
to_account |
TYPE:
|
registry_id |
TYPE:
|
TransferClarification
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
confirmation |
TYPE:
|
TransferInput
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
from_account |
TYPE:
|
to_account |
TYPE:
|
confirmation |
TYPE:
|
TransferOutput
¤
SumSkill
¤
| METHOD | DESCRIPTION |
|---|---|
async_executor |
|
async_invoke_config_parsed |
|
ainvoke |
|
as_tool |
|
invoke |
|
get_output_schema |
|
get_input_schema |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
name |
TYPE:
|
description |
TYPE:
|
brain_schema |
|
result_schema |
|
config_specs |
TYPE:
|
type |
TYPE:
|
require_clarification |
TYPE:
|
sub_type |
TYPE:
|
description
class-attribute
instance-attribute
¤
description: str = 'given two numbers return the sum of both'
async_invoke_config_parsed
async
¤
async_invoke_config_parsed(input: ComputationRequested, config_parsed: BaseModel, config_raw: RunnableConfig) -> ComputationResult[BrainSchema, ResultSchema]
invoke
¤
invoke(input: ComputationRequested, config: RunnableConfig | None = None) -> ComputationResult[BrainSchema, ResultSchema]
get_output_schema
¤
get_output_schema(config: Optional[RunnableConfig] = None) -> Type[ResultSchema]
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:
|
description |
TYPE:
|
brain_schema |
TYPE:
|
result_schema |
TYPE:
|
skill_input_schema |
TYPE:
|
clarification_schema |
TYPE:
|
config_specs |
List configurable fields for this runnable.
TYPE:
|
type |
TYPE:
|
require_clarification |
TYPE:
|
sub_type |
TYPE:
|
description
class-attribute
instance-attribute
¤
description: str = 'transfer money between accounts'
brain_schema
class-attribute
instance-attribute
¤
brain_schema: Type[TransferBrainSchema] = TransferBrainSchema
result_schema
class-attribute
instance-attribute
¤
result_schema: Type[TransferOutput] = TransferOutput
skill_input_schema
class-attribute
instance-attribute
¤
skill_input_schema: Type[TransferInput] = TransferInput
clarification_schema
class-attribute
instance-attribute
¤
clarification_schema: Type[TransferClarification] = TransferClarification
config_specs
property
¤
config_specs: List[ConfigurableFieldSpec]
List configurable fields for this runnable.
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]
invoke
¤
invoke(input: ComputationRequested, config: RunnableConfig | None = None) -> ComputationResult[BrainSchema, ResultSchema]
get_output_schema
¤
get_output_schema(config: Optional[RunnableConfig] = None) -> Type[ResultSchema]
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:
|
skills |
|
name |
|
config_specs |
List configurable fields for this runnable.
TYPE:
|
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
base_use_case_srv
¤
base_use_case_srv()
Fixture para proveer un falso servicio de base para los use cases
test_one_computation_with_clarification
async
¤
test_one_computation_with_clarification(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)
muscle_types
¤
| CLASS | DESCRIPTION |
|---|---|
MuscleInputComputationRequested |
|
MuscleInputClarificationResponse |
|
MuscleOutputClarification |
|
MuscleOutputResults |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
log |
Loger para el módulo
|
MuscleInput |
Union discriminada para MuscleInput
|
MuscleInputAdapter |
TYPE:
|
MuscleOutput |
Union discriminada para MuscleOutput
|
MuscleOutputAdapter |
TYPE:
|
MuscleInput
module-attribute
¤
MuscleInput = Union[MuscleInputComputationRequested, MuscleInputClarificationResponse]
Union discriminada para MuscleInput
MuscleInputAdapter
module-attribute
¤
MuscleInputAdapter: TypeAdapter[MuscleInput] = TypeAdapter(MuscleInput)
MuscleOutput
module-attribute
¤
MuscleOutput = Union[MuscleOutputClarification, MuscleOutputResults]
Union discriminada para MuscleOutput
MuscleOutputAdapter
module-attribute
¤
MuscleOutputAdapter: TypeAdapter[MuscleOutput] = TypeAdapter(MuscleOutput)
MuscleInputComputationRequested
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
type |
TYPE:
|
computations_required |
TYPE:
|
MuscleInputClarificationResponse
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
type |
TYPE:
|
clarification_message |
TYPE:
|
MuscleOutputClarification
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
type |
TYPE:
|
clarification_context |
TYPE:
|
clarification_requested |
TYPE:
|
type
class-attribute
instance-attribute
¤
type: Literal['muscle.output.clarification'] = 'muscle.output.clarification'
clarification_requested
instance-attribute
¤
clarification_requested: SerializeAsAny[ClarificationRequested]
MuscleOutputResults
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
type |
TYPE:
|
computations_requested |
TYPE:
|
computations_results |
TYPE:
|
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
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
AptitudeAdapter |
TYPE:
|
Aptitude |
|
Aptitude
module-attribute
¤
Aptitude = Union[CollaborationAptitude, FreeResponseAptitude, SkillInterpretationAptitude, SkillSelectionAptitude, StructuredResponseAptitude]
__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:
|
type |
TYPE:
|
name |
TYPE:
|
challenges |
TYPE:
|
SkillSelectionAptitude
¤
| METHOD | DESCRIPTION |
|---|---|
execute |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
summary |
TYPE:
|
type |
TYPE:
|
name |
TYPE:
|
challenges |
TYPE:
|
SkillInterpretationAptitude
¤
| METHOD | DESCRIPTION |
|---|---|
execute |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
summary |
TYPE:
|
type |
TYPE:
|
name |
TYPE:
|
challenges |
TYPE:
|
FreeResponseAptitude
¤
| METHOD | DESCRIPTION |
|---|---|
execute |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
summary |
TYPE:
|
type |
TYPE:
|
name |
TYPE:
|
challenges |
TYPE:
|
StructuredResponseAptitude
¤
| METHOD | DESCRIPTION |
|---|---|
execute |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
summary |
TYPE:
|
type |
TYPE:
|
name |
TYPE:
|
challenges |
TYPE:
|
PerformanceReviewResult
¤
PerformanceReview
¤
| METHOD | DESCRIPTION |
|---|---|
execute |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
name |
TYPE:
|
agent_name |
TYPE:
|
team |
TYPE:
|
aptitudes |
|
reporter |
TYPE:
|
summary |
TYPE:
|
LoaderStrategyBase
¤
| METHOD | DESCRIPTION |
|---|---|
load_aptitudes |
|
LoaderObject
¤
| METHOD | DESCRIPTION |
|---|---|
load_aptitudes |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
collaboration |
TYPE:
|
skill_selection |
TYPE:
|
skill_interpretation |
TYPE:
|
free_response |
TYPE:
|
structured_response |
TYPE:
|
skill_interpretation
class-attribute
instance-attribute
¤
skill_interpretation: List[ChallengeRaw] = []
structured_response
class-attribute
instance-attribute
¤
structured_response: List[ChallengeRaw] = []
ReporterAdapterBase
¤
| METHOD | DESCRIPTION |
|---|---|
start_performance |
|
start_aptitude |
|
start_challenge |
|
end_challenge |
|
end_aptitude |
|
end_performance |
|
ReporterConsole
¤
| METHOD | DESCRIPTION |
|---|---|
start_performance |
|
start_aptitude |
|
start_challenge |
|
end_challenge |
|
end_aptitude |
|
end_performance |
|
Organizer
¤
| METHOD | DESCRIPTION |
|---|---|
organize |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
team |
TYPE:
|
loader |
TYPE:
|
reporter |
TYPE:
|
llm_judge |
TYPE:
|
aptitude
¤
| CLASS | DESCRIPTION |
|---|---|
CollaborationAptitude |
|
SkillSelectionAptitude |
|
SkillInterpretationAptitude |
|
FreeResponseAptitude |
|
StructuredResponseAptitude |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
log |
Loger para el módulo
|
Aptitude |
|
AptitudeAdapter |
TYPE:
|
Aptitude
module-attribute
¤
Aptitude = Union[CollaborationAptitude, FreeResponseAptitude, SkillInterpretationAptitude, SkillSelectionAptitude, StructuredResponseAptitude]
CollaborationAptitude
¤
| METHOD | DESCRIPTION |
|---|---|
execute |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
type |
TYPE:
|
name |
TYPE:
|
challenges |
TYPE:
|
summary |
TYPE:
|
SkillSelectionAptitude
¤
| METHOD | DESCRIPTION |
|---|---|
execute |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
type |
TYPE:
|
name |
TYPE:
|
challenges |
TYPE:
|
summary |
TYPE:
|
SkillInterpretationAptitude
¤
| METHOD | DESCRIPTION |
|---|---|
execute |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
type |
TYPE:
|
name |
TYPE:
|
challenges |
TYPE:
|
summary |
TYPE:
|
FreeResponseAptitude
¤
| METHOD | DESCRIPTION |
|---|---|
execute |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
type |
TYPE:
|
name |
TYPE:
|
challenges |
TYPE:
|
summary |
TYPE:
|
StructuredResponseAptitude
¤
| METHOD | DESCRIPTION |
|---|---|
execute |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
type |
TYPE:
|
name |
TYPE:
|
challenges |
TYPE:
|
summary |
TYPE:
|
aptitude_base
¤
| CLASS | DESCRIPTION |
|---|---|
AptitudeBase |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
log |
Loger para el módulo
|
ChallengeType |
|
AptitudeBase
¤
| METHOD | DESCRIPTION |
|---|---|
execute |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
challenges |
TYPE:
|
name |
TYPE:
|
summary |
TYPE:
|
aptitude_result
¤
| CLASS | DESCRIPTION |
|---|---|
AptitudeResult |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
log |
Loger para el módulo
|
aptitude_summary
¤
| CLASS | DESCRIPTION |
|---|---|
AptitudeSummary |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
log |
Loger para el módulo
|
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:
|
Challenge
module-attribute
¤
Challenge = Union[CollaborationChallenge, SkillInterpretationChallenge, SkillSelectionChallenge, FreeResponseChallenge, StructuredResponseChallenge]
ChallengeAdapter
module-attribute
¤
__all__
module-attribute
¤
__all__ = ['Challenge', 'ChallengeAdapter', 'ChallengeSummary', 'ChallengeResult', 'ChallengeBase', 'CollaborationChallenge', 'SkillInterpretationChallenge', 'SkillSelectionChallenge', 'FreeResponseChallenge', 'StructuredResponseChallenge']
ChallengeSummary
¤
ChallengeResult
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
score |
TYPE:
|
fixed_aspects |
|
dynamic_aspects |
|
ChallengeBase
¤
| METHOD | DESCRIPTION |
|---|---|
ensure_unique_evaluators |
|
execute |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
index |
TYPE:
|
data |
TYPE:
|
evaluators |
|
summary |
TYPE:
|
CollaborationChallenge
¤
| METHOD | DESCRIPTION |
|---|---|
ensure_unique_evaluators |
|
execute |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
index |
TYPE:
|
data |
TYPE:
|
evaluators |
|
type |
TYPE:
|
summary |
TYPE:
|
SkillInterpretationChallenge
¤
| METHOD | DESCRIPTION |
|---|---|
ensure_unique_evaluators |
|
execute |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
index |
TYPE:
|
data |
TYPE:
|
evaluators |
|
summary |
TYPE:
|
type |
TYPE:
|
SkillSelectionChallenge
¤
| METHOD | DESCRIPTION |
|---|---|
ensure_unique_evaluators |
|
execute |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
index |
TYPE:
|
data |
TYPE:
|
evaluators |
|
type |
TYPE:
|
summary |
TYPE:
|
FreeResponseChallenge
¤
| METHOD | DESCRIPTION |
|---|---|
ensure_unique_evaluators |
|
execute |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
index |
TYPE:
|
data |
TYPE:
|
evaluators |
|
summary |
TYPE:
|
type |
TYPE:
|
StructuredResponseChallenge
¤
| METHOD | DESCRIPTION |
|---|---|
ensure_unique_evaluators |
|
execute |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
index |
TYPE:
|
data |
TYPE:
|
evaluators |
|
summary |
TYPE:
|
type |
TYPE:
|
challenge
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
log |
Loger para el módulo
|
Challenge |
|
ChallengeAdapter |
TYPE:
|
Challenge
module-attribute
¤
Challenge = Union[CollaborationChallenge, SkillInterpretationChallenge, SkillSelectionChallenge, FreeResponseChallenge, StructuredResponseChallenge]
challenge_base
¤
| CLASS | DESCRIPTION |
|---|---|
ChallengePayloadBase |
|
ChallengeBase |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
log |
Loger para el módulo
|
ChallengePayload |
|
ChallengePayload
module-attribute
¤
ChallengePayload = TypeVar('ChallengePayload', bound=ChallengePayloadBase)
ChallengePayloadBase
¤
ChallengeBase
¤
| METHOD | DESCRIPTION |
|---|---|
ensure_unique_evaluators |
|
execute |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
index |
TYPE:
|
data |
TYPE:
|
evaluators |
|
summary |
TYPE:
|
challenge_result
¤
| CLASS | DESCRIPTION |
|---|---|
ChallengeResult |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
log |
Loger para el módulo
|
ChallengeResult
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
score |
TYPE:
|
fixed_aspects |
|
dynamic_aspects |
|
challenge_summary
¤
| CLASS | DESCRIPTION |
|---|---|
ChallengeSummary |
|
collaboration
¤
| CLASS | DESCRIPTION |
|---|---|
CollaborationChallengePayload |
|
CollaborationChallenge |
|
| FUNCTION | DESCRIPTION |
|---|---|
create_message |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
log |
Loger para el módulo
|
CollaborationChallengePayload
¤
CollaborationChallenge
¤
| METHOD | DESCRIPTION |
|---|---|
ensure_unique_evaluators |
|
execute |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
type |
TYPE:
|
summary |
TYPE:
|
index |
TYPE:
|
data |
TYPE:
|
evaluators |
|
free_response
¤
| CLASS | DESCRIPTION |
|---|---|
FreeResponseChallengePayload |
|
FreeResponseChallenge |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
log |
Loger para el módulo
|
FreeResponseChallengePayload
¤
FreeResponseChallenge
¤
| METHOD | DESCRIPTION |
|---|---|
execute |
|
ensure_unique_evaluators |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
type |
TYPE:
|
index |
TYPE:
|
data |
TYPE:
|
evaluators |
|
summary |
TYPE:
|
skill_interpretation
¤
| CLASS | DESCRIPTION |
|---|---|
SkillInterpretationChallengePayload |
|
SkillInterpretationChallenge |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
log |
Loger para el módulo
|
SkillInterpretationChallengePayload
¤
SkillInterpretationChallenge
¤
| METHOD | DESCRIPTION |
|---|---|
execute |
|
ensure_unique_evaluators |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
type |
TYPE:
|
index |
TYPE:
|
data |
TYPE:
|
evaluators |
|
summary |
TYPE:
|
skill_selection
¤
| CLASS | DESCRIPTION |
|---|---|
ExpectedSkill |
|
SkillSelectionChallengePayload |
|
SkillSelectionChallenge |
|
| FUNCTION | DESCRIPTION |
|---|---|
create_message |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
log |
Loger para el módulo
|
ExpectedSkill
¤
SkillSelectionChallengePayload
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
expected_skills |
TYPE:
|
message_content |
TYPE:
|
user_name |
TYPE:
|
SkillSelectionChallenge
¤
| METHOD | DESCRIPTION |
|---|---|
ensure_unique_evaluators |
|
execute |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
type |
TYPE:
|
summary |
TYPE:
|
index |
TYPE:
|
data |
TYPE:
|
evaluators |
|
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
|
MathInput
¤
SumSkill
¤
| METHOD | DESCRIPTION |
|---|---|
async_executor |
|
async_invoke_config_parsed |
|
ainvoke |
|
as_tool |
|
invoke |
|
get_output_schema |
|
get_input_schema |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
name |
TYPE:
|
description |
TYPE:
|
brain_schema |
|
result_schema |
TYPE:
|
config_specs |
TYPE:
|
type |
TYPE:
|
require_clarification |
TYPE:
|
sub_type |
TYPE:
|
description
class-attribute
instance-attribute
¤
description: str = 'given two numbers return the sum of both'
async_invoke_config_parsed
async
¤
async_invoke_config_parsed(input: ComputationRequested, config_parsed: BaseModel, config_raw: RunnableConfig) -> ComputationResult[BrainSchema, ResultSchema]
invoke
¤
invoke(input: ComputationRequested, config: RunnableConfig | None = None) -> ComputationResult[BrainSchema, ResultSchema]
get_output_schema
¤
get_output_schema(config: Optional[RunnableConfig] = None) -> Type[ResultSchema]
MultiplySkill
¤
| METHOD | DESCRIPTION |
|---|---|
async_executor |
|
async_invoke_config_parsed |
|
ainvoke |
|
as_tool |
|
invoke |
|
get_output_schema |
|
get_input_schema |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
name |
TYPE:
|
description |
TYPE:
|
brain_schema |
|
result_schema |
TYPE:
|
config_specs |
TYPE:
|
type |
TYPE:
|
require_clarification |
TYPE:
|
sub_type |
TYPE:
|
description
class-attribute
instance-attribute
¤
description: str = 'given two numbers return the multiply of both'
async_invoke_config_parsed
async
¤
async_invoke_config_parsed(input: ComputationRequested, config_parsed: BaseModel, config_raw: RunnableConfig) -> ComputationResult[BrainSchema, ResultSchema]
invoke
¤
invoke(input: ComputationRequested, config: RunnableConfig | None = None) -> ComputationResult[BrainSchema, ResultSchema]
get_output_schema
¤
get_output_schema(config: Optional[RunnableConfig] = None) -> Type[ResultSchema]
structured_response
¤
| CLASS | DESCRIPTION |
|---|---|
StructuredResponseChallengePayload |
|
StructuredResponseChallenge |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
log |
Loger para el módulo
|
StructuredResponseChallengePayload
¤
StructuredResponseChallenge
¤
| METHOD | DESCRIPTION |
|---|---|
execute |
|
ensure_unique_evaluators |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
type |
TYPE:
|
index |
TYPE:
|
data |
TYPE:
|
evaluators |
|
summary |
TYPE:
|
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:
|
Evaluator
module-attribute
¤
Evaluator = Union[MatchEvaluator, ContainEvaluator, CorrectnessEvaluator, ToxicityEvaluator, CoherenceEvaluator]
EvaluatorAdapter
module-attribute
¤
__all__
module-attribute
¤
__all__ = ['ContainEvaluator', 'CorrectnessEvaluator', 'Evaluator', 'EvaluatorAdapter', 'EvaluatorBase', 'IsInstanceEvaluator', 'MatchEvaluator', 'PydanticModelChecker', 'PydanticModelEquality', 'SubSetEvaluator']
EvaluatorBase
¤
ContainEvaluator
¤
IsInstanceEvaluator
¤
MatchEvaluator
¤
PydanticModelChecker
¤
PydanticModelEquality
¤
SubSetEvaluator
¤
CorrectnessEvaluator
¤
evaluator
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
log |
Loger para el módulo
|
Evaluator |
|
EvaluatorAdapter |
TYPE:
|
Evaluator
module-attribute
¤
Evaluator = Union[MatchEvaluator, ContainEvaluator, CorrectnessEvaluator, ToxicityEvaluator, CoherenceEvaluator]
evaluator_base
¤
model_based
¤
| MODULE | DESCRIPTION |
|---|---|
coherence |
|
correctness |
|
model_evaluator_base |
|
toxicity |
|
| CLASS | DESCRIPTION |
|---|---|
CorrectnessEvaluator |
|
ToxicityEvaluator |
|
CoherenceEvaluator |
|
__all__
module-attribute
¤
__all__ = ['CorrectnessEvaluator', 'ToxicityEvaluator', 'CoherenceEvaluator']
CorrectnessEvaluator
¤
ToxicityEvaluator
¤
CoherenceEvaluator
¤
coherence
¤
| CLASS | DESCRIPTION |
|---|---|
OpenAIWrapper |
|
CoherenceEvaluator |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
log |
Loger para el módulo
|
OpenAIWrapper
¤
OpenAIWrapper(llm_judge: BaseLanguageModel)
| METHOD | DESCRIPTION |
|---|---|
load_model |
|
generate |
|
a_generate |
|
get_model_name |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
llm_judge |
|
CoherenceEvaluator
¤
correctness
¤
| CLASS | DESCRIPTION |
|---|---|
CorrectnessEvaluator |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
log |
Loger para el módulo
|
CorrectnessEvaluator
¤
model_evaluator_base
¤
toxicity
¤
| CLASS | DESCRIPTION |
|---|---|
OpenAIWrapper |
|
ToxicityEvaluator |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
log |
Loger para el módulo
|
OpenAIWrapper
¤
OpenAIWrapper(llm_judge: BaseLanguageModel)
| METHOD | DESCRIPTION |
|---|---|
load_model |
|
generate |
|
a_generate |
|
get_model_name |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
llm_judge |
|
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
¤
MatchEvaluator
¤
IsInstanceEvaluator
¤
SubSetEvaluator
¤
PydanticModelChecker
¤
PydanticModelEquality
¤
contain
¤
is_instance
¤
match
¤
pydantic_model_checker
¤
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
|
MyModel
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
from_account |
TYPE:
|
to_account |
TYPE:
|
pydantic_model_equality
¤
| CLASS | DESCRIPTION |
|---|---|
PydanticModelEquality |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
log |
Loger para el módulo
|
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
|
MyModel
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
from_account |
TYPE:
|
to_account |
TYPE:
|
rule_evaluator_base
¤
execution_context
¤
| CLASS | DESCRIPTION |
|---|---|
ExecutionContext |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
log |
Loger para el módulo
|
ExecutionContext
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
brain |
TYPE:
|
configuration |
TYPE:
|
reporter |
TYPE:
|
loader_object
¤
| CLASS | DESCRIPTION |
|---|---|
LoaderObject |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
log |
Loger para el módulo
|
ChallengeRaw |
|
LoaderObject
¤
| METHOD | DESCRIPTION |
|---|---|
load_aptitudes |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
collaboration |
TYPE:
|
skill_selection |
TYPE:
|
skill_interpretation |
TYPE:
|
free_response |
TYPE:
|
structured_response |
TYPE:
|
skill_interpretation
class-attribute
instance-attribute
¤
skill_interpretation: List[ChallengeRaw] = []
structured_response
class-attribute
instance-attribute
¤
structured_response: List[ChallengeRaw] = []
loader_strategy_base
¤
| CLASS | DESCRIPTION |
|---|---|
LoaderStrategyBase |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
log |
Loger para el módulo
|
organizer
¤
organizer_base
¤
| CLASS | DESCRIPTION |
|---|---|
OrganizerBase |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
log |
Loger para el módulo
|
OrganizerBase
¤
| METHOD | DESCRIPTION |
|---|---|
organize |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
team |
TYPE:
|
loader |
TYPE:
|
reporter |
TYPE:
|
llm_judge |
TYPE:
|
organize
abstractmethod
¤
organize(name: str, subject: str, config_runtime: RunnableConfig) -> PerformanceReviewBase
performance_review
¤
| CLASS | DESCRIPTION |
|---|---|
PerformanceReview |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
log |
Loger para el módulo
|
PerformanceReview
¤
| METHOD | DESCRIPTION |
|---|---|
execute |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
name |
TYPE:
|
agent_name |
TYPE:
|
team |
TYPE:
|
aptitudes |
|
reporter |
TYPE:
|
summary |
TYPE:
|
performance_review_base
¤
| CLASS | DESCRIPTION |
|---|---|
PerformanceReviewBase |
|
PerformanceReviewBase
¤
| METHOD | DESCRIPTION |
|---|---|
execute |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
name |
TYPE:
|
agent_name |
TYPE:
|
team |
TYPE:
|
aptitudes |
|
reporter |
TYPE:
|
summary |
TYPE:
|
execute
abstractmethod
async
¤
execute(runnable_configuration: RunnableConfig) -> PerformanceReviewResult
performance_review_summary
¤
| CLASS | DESCRIPTION |
|---|---|
PerformanceReviewSummary |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
log |
Loger para el módulo
|
perforrmance_review_result
¤
reporter_adapter_base
¤
| CLASS | DESCRIPTION |
|---|---|
ReporterAdapterBase |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
log |
Loger para el módulo
|
ReporterAdapterBase
¤
| METHOD | DESCRIPTION |
|---|---|
start_performance |
|
start_aptitude |
|
start_challenge |
|
end_challenge |
|
end_aptitude |
|
end_performance |
|
reporter_console
¤
| CLASS | DESCRIPTION |
|---|---|
ReporterConsole |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
log |
Loger para el módulo
|
ReporterConsole
¤
| METHOD | DESCRIPTION |
|---|---|
start_performance |
|
start_aptitude |
|
start_challenge |
|
end_challenge |
|
end_aptitude |
|
end_performance |
|
reporter_null
¤
| CLASS | DESCRIPTION |
|---|---|
ReporterNull |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
log |
Loger para el módulo
|
ReporterNull
¤
| METHOD | DESCRIPTION |
|---|---|
start_performance |
|
start_aptitude |
|
start_challenge |
|
end_challenge |
|
end_aptitude |
|
end_performance |
|
score
¤
| MODULE | DESCRIPTION |
|---|---|
score |
|
score_base |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
Score |
|
ScoreAdapter |
TYPE:
|
__all__
module-attribute
¤
__all__ = ['Score', 'ScoreAdapter', 'ScoreBase', 'ScoreBoolean', 'ScoreCategoricalBinary', 'ScoreBooleanDirect', 'ScoreBooleanInverse', 'ScoreCategorialInverse', 'ScoreCategorical', 'ScoreCategoricalDirect', 'ScoreError', 'ScorePercent', 'ScorePercentDirect', 'ScorePercentInverse']
ScoreBase
¤
ScoreBoolean
¤
ScoreBooleanDirect
¤
ScoreBooleanInverse
¤
ScoreCategorialInverse
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
name |
TYPE:
|
explanation |
|
type |
TYPE:
|
value |
TYPE:
|
max_categories_allowed |
TYPE:
|
points |
TYPE:
|
ScoreCategorical
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
name |
TYPE:
|
explanation |
|
points |
TYPE:
|
type |
TYPE:
|
value |
TYPE:
|
max_categories_allowed |
TYPE:
|
ScoreCategoricalBinary
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
name |
TYPE:
|
explanation |
|
type |
TYPE:
|
value |
TYPE:
|
max_categories_allowed |
TYPE:
|
correct_categories |
TYPE:
|
points |
TYPE:
|
ScoreCategoricalDirect
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
name |
TYPE:
|
explanation |
|
type |
TYPE:
|
value |
TYPE:
|
max_categories_allowed |
TYPE:
|
points |
TYPE:
|
ScoreError
¤
ScorePercent
¤
ScorePercentDirect
¤
ScorePercentInverse
¤
score
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
log |
Loger para el módulo
|
CategoryName |
|
Score |
|
ScoreAdapter |
TYPE:
|
ScorePercent
¤
ScorePercentDirect
¤
ScorePercentInverse
¤
ScoreBoolean
¤
ScoreBooleanDirect
¤
ScoreBooleanInverse
¤
ScoreCategorical
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
type |
TYPE:
|
value |
TYPE:
|
max_categories_allowed |
TYPE:
|
name |
TYPE:
|
explanation |
|
points |
TYPE:
|
ScoreCategoricalDirect
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
points |
TYPE:
|
name |
TYPE:
|
explanation |
|
type |
TYPE:
|
value |
TYPE:
|
max_categories_allowed |
TYPE:
|
ScoreCategorialInverse
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
points |
TYPE:
|
name |
TYPE:
|
explanation |
|
type |
TYPE:
|
value |
TYPE:
|
max_categories_allowed |
TYPE:
|
ScoreCategoricalBinary
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
max_categories_allowed |
TYPE:
|
correct_categories |
TYPE:
|
points |
TYPE:
|
name |
TYPE:
|
explanation |
|
type |
TYPE:
|
value |
TYPE:
|
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']
WithAsyncInvokeConfigVerified
¤
| METHOD | DESCRIPTION |
|---|---|
async_invoke_config_parsed |
|
ainvoke |
|
WithInvokeConfigVerified
¤
| METHOD | DESCRIPTION |
|---|---|
invoke_config_parsed |
|
invoke |
|
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]
RunnableStreameable
¤
injection_exception
¤
| CLASS | DESCRIPTION |
|---|---|
InjectionException |
|
runnable_streameable
¤
| CLASS | DESCRIPTION |
|---|---|
RunnableStreameable |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
log |
Loger para el módulo
|
Input |
|
Output |
Tipos genéricos para la clase RunnableStremeable
|
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
|
FakeAsyncInvokable
¤
| METHOD | DESCRIPTION |
|---|---|
invoke |
|
async_invoke_config_parsed |
|
ainvoke |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
config_specs |
TYPE:
|
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
|
FakeStreamable
¤
| METHOD | DESCRIPTION |
|---|---|
invoke |
|
astream_config_parsed |
|
astream |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
config_specs |
TYPE:
|
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]]
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
|
Output
module-attribute
¤
Output = TypeVar('Output', bound=BaseModel)
Tipos genéricos para la mixins de configuracion verificada
WithInvokeConfigVerified
¤
| METHOD | DESCRIPTION |
|---|---|
invoke_config_parsed |
|
invoke |
|
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]
WithAsyncInvokeConfigVerified
¤
| METHOD | DESCRIPTION |
|---|---|
async_invoke_config_parsed |
|
ainvoke |
|
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
|
FakeInvokable
¤
| METHOD | DESCRIPTION |
|---|---|
invoke_config_parsed |
|
invoke |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
config_specs |
TYPE:
|
skill
¤
| MODULE | DESCRIPTION |
|---|---|
skill |
|
skill_base |
|
skill_computation |
|
skill_contribute |
|
skill_structured_response |
|
types |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
SkillComputation |
|
Skill |
Union discriminada para Skill
|
BrainSchema |
|
ClarificationSchema |
|
SkillInputSchema |
|
ResultSchema |
Tipos genéricos para la clase Computation
|
SkillComputation
module-attribute
¤
SkillComputation = Union[SkillComputationDirect[BrainSchema, ResultSchema], SkillComputationWithClarification[BrainSchema, ClarificationSchema, SkillInputSchema, ResultSchema]]
Skill
module-attribute
¤
Union discriminada para Skill
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:
|
description |
TYPE:
|
brain_schema |
TYPE:
|
type |
TYPE:
|
require_clarification |
TYPE:
|
result_schema |
TYPE:
|
sub_type |
TYPE:
|
invoke
¤
invoke(input: ComputationRequested, config: RunnableConfig | None = None) -> ComputationResult[BrainSchema, ResultSchema]
get_output_schema
¤
get_output_schema(config: Optional[RunnableConfig] = None) -> 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:
|
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:
|
description |
TYPE:
|
brain_schema |
TYPE:
|
type |
TYPE:
|
require_clarification |
TYPE:
|
result_schema |
TYPE:
|
sub_type |
TYPE:
|
clarification_schema |
TYPE:
|
skill_input_schema |
TYPE:
|
sub_type
class-attribute
instance-attribute
¤
sub_type: Literal['with-clarification'] = 'with-clarification'
invoke
¤
invoke(input: ComputationRequested, config: RunnableConfig | None = None) -> ComputationResult[BrainSchema, ResultSchema]
get_output_schema
¤
get_output_schema(config: Optional[RunnableConfig] = None) -> 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:
|
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:
|
name |
TYPE:
|
description |
TYPE:
|
brain_schema |
TYPE:
|
brain_schema
class-attribute
instance-attribute
¤
brain_schema: Type[SendContribution] = SendContribution
SkillStructuredResponse
¤
| METHOD | DESCRIPTION |
|---|---|
as_tool |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
name |
TYPE:
|
description |
TYPE:
|
brain_schema |
TYPE:
|
type |
TYPE:
|
ComputationRequested
¤
| METHOD | DESCRIPTION |
|---|---|
is_lc_serializable |
|
get_lc_namespace |
|
lc_id |
A unique identifier for this class for serialization purposes. |
| ATTRIBUTE | DESCRIPTION |
|---|---|
name |
TYPE:
|
brain_args |
|
computation_id |
TYPE:
|
lc_attributes |
TYPE:
|
ComputationRequestedWithClarification
¤
| METHOD | DESCRIPTION |
|---|---|
is_lc_serializable |
|
get_lc_namespace |
|
lc_id |
A unique identifier for this class for serialization purposes. |
| ATTRIBUTE | DESCRIPTION |
|---|---|
name |
TYPE:
|
brain_args |
|
clarification_args |
|
computation_id |
TYPE:
|
lc_attributes |
TYPE:
|
ComputationResult
¤
| METHOD | DESCRIPTION |
|---|---|
is_lc_serializable |
|
get_lc_namespace |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
computation_id |
TYPE:
|
name |
TYPE:
|
skill_args |
TYPE:
|
result |
TYPE:
|
lc_attributes |
TYPE:
|
BrainSchemaBase
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
registry_id |
TYPE:
|
ClarificationSchemaBase
¤
SkillInputSchemaBase
¤
ResultSchemaBase
¤
skill
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
log |
Loger para el módulo
|
Skill |
Union discriminada para Skill
|
SkillAdapter |
TYPE:
|
Skill
module-attribute
¤
Union discriminada para Skill
skill_base
¤
| CLASS | DESCRIPTION |
|---|---|
ToolModel |
|
SkillBase |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
log |
Loger para el módulo
|
ToolModel
¤
SkillBase
¤
| METHOD | DESCRIPTION |
|---|---|
as_tool |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
name |
TYPE:
|
description |
TYPE:
|
brain_schema |
TYPE:
|
skill_computation
¤
| CLASS | DESCRIPTION |
|---|---|
SkillComputationBase |
|
SkillComputationDirect |
|
SkillComputationWithClarification |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
log |
Loger para el módulo
|
SkillComputation |
|
SkillComputationAdapter |
TYPE:
|
SkillComputation
module-attribute
¤
SkillComputation = Union[SkillComputationDirect[BrainSchema, ResultSchema], SkillComputationWithClarification[BrainSchema, ClarificationSchema, SkillInputSchema, ResultSchema]]
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:
|
require_clarification |
TYPE:
|
brain_schema |
TYPE:
|
result_schema |
TYPE:
|
name |
TYPE:
|
description |
TYPE:
|
invoke
¤
invoke(input: ComputationRequested, config: RunnableConfig | None = None) -> ComputationResult[BrainSchema, ResultSchema]
get_output_schema
¤
get_output_schema(config: Optional[RunnableConfig] = None) -> Type[ResultSchema]
async_invoke_config_parsed
abstractmethod
async
¤
async_invoke_config_parsed(input: Union[ComputationRequested, ComputationRequestedWithClarification], config_parsed: BaseModel, config_raw: RunnableConfig) -> ComputationResult
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:
|
name |
TYPE:
|
description |
TYPE:
|
brain_schema |
TYPE:
|
type |
TYPE:
|
require_clarification |
TYPE:
|
result_schema |
TYPE:
|
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:
|
async_invoke_config_parsed
async
¤
async_invoke_config_parsed(input: ComputationRequested, config_parsed: BaseModel, config_raw: RunnableConfig) -> ComputationResult[BrainSchema, ResultSchema]
invoke
¤
invoke(input: ComputationRequested, config: RunnableConfig | None = None) -> ComputationResult[BrainSchema, ResultSchema]
get_output_schema
¤
get_output_schema(config: Optional[RunnableConfig] = None) -> Type[ResultSchema]
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:
|
clarification_schema |
TYPE:
|
skill_input_schema |
TYPE:
|
name |
TYPE:
|
description |
TYPE:
|
brain_schema |
TYPE:
|
type |
TYPE:
|
require_clarification |
TYPE:
|
result_schema |
TYPE:
|
sub_type
class-attribute
instance-attribute
¤
sub_type: Literal['with-clarification'] = 'with-clarification'
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:
|
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]
invoke
¤
invoke(input: ComputationRequested, config: RunnableConfig | None = None) -> ComputationResult[BrainSchema, ResultSchema]
get_output_schema
¤
get_output_schema(config: Optional[RunnableConfig] = None) -> Type[ResultSchema]
skill_contribute
¤
| CLASS | DESCRIPTION |
|---|---|
SendContribution |
|
SkillContribute |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
log |
Loger para el módulo
|
SendContribution
¤
SkillContribute
¤
| METHOD | DESCRIPTION |
|---|---|
as_tool |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
type |
TYPE:
|
name |
TYPE:
|
description |
TYPE:
|
brain_schema |
TYPE:
|
brain_schema
class-attribute
instance-attribute
¤
brain_schema: Type[SendContribution] = SendContribution
skill_structured_response
¤
| CLASS | DESCRIPTION |
|---|---|
SkillStructuredResponse |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
log |
Loger para el módulo
|
SkillStructuredResponse
¤
| METHOD | DESCRIPTION |
|---|---|
as_tool |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
type |
TYPE:
|
name |
TYPE:
|
description |
TYPE:
|
brain_schema |
TYPE:
|
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
|
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:
|
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:
|
brain_args |
|
computation_id |
TYPE:
|
lc_attributes |
TYPE:
|
ComputationRequestedWithClarification
¤
| METHOD | DESCRIPTION |
|---|---|
is_lc_serializable |
|
get_lc_namespace |
|
lc_id |
A unique identifier for this class for serialization purposes. |
| ATTRIBUTE | DESCRIPTION |
|---|---|
name |
TYPE:
|
brain_args |
|
clarification_args |
|
computation_id |
TYPE:
|
lc_attributes |
TYPE:
|
ComputationResult
¤
| METHOD | DESCRIPTION |
|---|---|
is_lc_serializable |
|
get_lc_namespace |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
computation_id |
TYPE:
|
name |
TYPE:
|
skill_args |
TYPE:
|
result |
TYPE:
|
lc_attributes |
TYPE:
|
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 |
|
ScopeAvailables
module-attribute
¤
ScopeAvailables = Literal['answer', 'deliberations', 'computations']
StreamFilter
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
include_names |
|
include_tags |
|
include_types |
|
exclude_names |
|
exclude_tags |
|
exclude_types |
|
prepare_error_for_client
¤
prepare_error_for_client(error: BaseException) -> str
Prepara un error para enviarlo como evento
| PARAMETER | DESCRIPTION |
|---|---|
|
Error generado en la aplicación
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
json con la serializacion del error
TYPE:
|
is_event_required
¤
is_event_required(event: StreamEvent, allowed_event_moments: Set[AllowedEventMoment]) -> bool
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 que se quiere convertir los eventos
TYPE:
|
|
Data de entrada al runnable
TYPE:
|
|
configuración para el runnable
TYPE:
|
| 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:
|
job_description |
TYPE:
|
team_instructions |
TYPE:
|
distribution_strategy |
|
members |
|
options_built_in |
|
config_specs |
TYPE:
|
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'
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 |
|---|---|
|
The input data for the collaborator.
TYPE:
|
|
The parsed configuration.
TYPE:
|
|
The raw runnable configuration.
TYPE:
|
|
The run manager.
TYPE:
|
|
Optional keyword arguments. |
| 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 |
|---|---|
|
The input data for the collaborator.
TYPE:
|
|
The parsed configuration.
TYPE:
|
|
The raw runnable configuration.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
CollaboratorOutput
|
The output of the collaborator.
TYPE:
|
invoke
¤
invoke(input: CollaboratorInput, config: RunnableConfig | None = None) -> CollaboratorOutput
Invokes the collaborator.
| RAISES | DESCRIPTION |
|---|---|
Exception
|
Collaborator can only be called asynchronously. |
DistributionStrategyInterface
¤
RandomStrategy
¤
SupervisionStrategy
¤
distribution_strategy
¤
| CLASS | DESCRIPTION |
|---|---|
DistributionStrategyInterface |
|
RandomStrategy |
|
SupervisionStrategy |
|
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
|
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:
|
job_description |
TYPE:
|
team_instructions |
TYPE:
|
distribution_strategy |
|
members |
|
options_built_in |
|
config_specs |
TYPE:
|
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'
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 |
|---|---|
|
The input data for the collaborator.
TYPE:
|
|
The parsed configuration.
TYPE:
|
|
The raw runnable configuration.
TYPE:
|
|
The run manager.
TYPE:
|
|
Optional keyword arguments. |
| 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 |
|---|---|
|
The input data for the collaborator.
TYPE:
|
|
The parsed configuration.
TYPE:
|
|
The raw runnable configuration.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
CollaboratorOutput
|
The output of the collaborator.
TYPE:
|
invoke
¤
invoke(input: CollaboratorInput, config: RunnableConfig | None = None) -> CollaboratorOutput
Invokes the collaborator.
| RAISES | DESCRIPTION |
|---|---|
Exception
|
Collaborator can only be called asynchronously. |
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:
|
tools_availables |
|
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
¤
tools_availables = [sum_computation, list_items_computation, TransferSKill()]
SumInput
¤
SingleItemsInput
¤
ListItemsInput
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
items |
TYPE:
|
registry_id |
TYPE:
|
TransferBrainSchema
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
from_account |
TYPE:
|
to_account |
TYPE:
|
registry_id |
TYPE:
|
TransferClarification
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
confirmation |
TYPE:
|
TransferInput
¤
| ATTRIBUTE | DESCRIPTION |
|---|---|
from_account |
TYPE:
|
to_account |
TYPE:
|
confirmation |
TYPE:
|
TransferOutput
¤
SumSkill
¤
| METHOD | DESCRIPTION |
|---|---|
async_executor |
|
async_invoke_config_parsed |
|
ainvoke |
|
as_tool |
|
invoke |
|
get_output_schema |
|
get_input_schema |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
name |
TYPE:
|
description |
TYPE:
|
brain_schema |
|
result_schema |
|
config_specs |
TYPE:
|
type |
TYPE:
|
require_clarification |
TYPE:
|
sub_type |
TYPE:
|
description
class-attribute
instance-attribute
¤
description: str = 'given two numbers return the sum of both'
async_invoke_config_parsed
async
¤
async_invoke_config_parsed(input: ComputationRequested, config_parsed: BaseModel, config_raw: RunnableConfig) -> ComputationResult[BrainSchema, ResultSchema]
invoke
¤
invoke(input: ComputationRequested, config: RunnableConfig | None = None) -> ComputationResult[BrainSchema, ResultSchema]
get_output_schema
¤
get_output_schema(config: Optional[RunnableConfig] = None) -> Type[ResultSchema]
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:
|
description |
TYPE:
|
brain_schema |
TYPE:
|
result_schema |
TYPE:
|
skill_input_schema |
TYPE:
|
clarification_schema |
TYPE:
|
type |
TYPE:
|
require_clarification |
TYPE:
|
sub_type |
TYPE:
|
description
class-attribute
instance-attribute
¤
description: str = 'transfer money between accounts'
brain_schema
class-attribute
instance-attribute
¤
brain_schema: Type[TransferBrainSchema] = TransferBrainSchema
result_schema
class-attribute
instance-attribute
¤
result_schema: Type[TransferOutput] = TransferOutput
skill_input_schema
class-attribute
instance-attribute
¤
skill_input_schema: Type[TransferInput] = TransferInput
clarification_schema
class-attribute
instance-attribute
¤
clarification_schema: Type[TransferClarification] = TransferClarification
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]
invoke
¤
invoke(input: ComputationRequested, config: RunnableConfig | None = None) -> ComputationResult[BrainSchema, ResultSchema]
get_output_schema
¤
get_output_schema(config: Optional[RunnableConfig] = None) -> Type[ResultSchema]
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:
|
job_description |
TYPE:
|
public_bio |
TYPE:
|
options |
|
situation_builder |
TYPE:
|
config_specs |
Get the merged configuration specifications for the agent.
TYPE:
|
agent_name_intro |
TYPE:
|
private_bio |
|
directives |
|
examples |
|
team_membership |
TYPE:
|
options_built_in |
|
history_strategy |
TYPE:
|
instructions_transformer |
|
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 '
situation_builder
class-attribute
instance-attribute
¤
situation_builder: Optional[SituationBuilderFn] = situation_builder
config_specs
property
¤
config_specs: List[ConfigurableFieldSpec]
Get the merged configuration specifications for the agent.
| RETURNS | DESCRIPTION |
|---|---|
List[ConfigurableFieldSpec]
|
List of configuration field specs. |
team_membership
class-attribute
instance-attribute
¤
team_membership: Optional[TeamMembership] = None
history_strategy
class-attribute
instance-attribute
¤
history_strategy: HistoryStrategyInterface = MaxMessagesStrategy()
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 |
|---|---|
|
The input data for the collaborator.
TYPE:
|
|
The parsed configuration.
TYPE:
|
|
The raw runnable configuration.
TYPE:
|
|
The run manager.
TYPE:
|
|
Optional keyword arguments. |
| 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 |
|---|---|
|
The input data for the collaborator.
TYPE:
|
|
The parsed configuration.
TYPE:
|
|
The raw runnable configuration.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
CollaboratorOutput
|
The output of the collaborator.
TYPE:
|
join_team
¤
join_team(team_membership: TeamMembership)
Assign the agent to a team and update instructions.
| PARAMETER | DESCRIPTION |
|---|---|
|
The team membership object.
TYPE:
|
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:
|
job_description |
TYPE:
|
public_bio |
TYPE:
|
options |
|
config_specs |
Get the merged configuration specifications for the agent.
TYPE:
|
agent_name_intro |
TYPE:
|
private_bio |
|
directives |
|
examples |
|
team_membership |
TYPE:
|
options_built_in |
|
history_strategy |
TYPE:
|
situation_builder |
TYPE:
|
instructions_transformer |
|
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 '
config_specs
property
¤
config_specs: List[ConfigurableFieldSpec]
Get the merged configuration specifications for the agent.
| RETURNS | DESCRIPTION |
|---|---|
List[ConfigurableFieldSpec]
|
List of configuration field specs. |
team_membership
class-attribute
instance-attribute
¤
team_membership: Optional[TeamMembership] = None
history_strategy
class-attribute
instance-attribute
¤
history_strategy: HistoryStrategyInterface = MaxMessagesStrategy()
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 |
|---|---|
|
The input data for the collaborator.
TYPE:
|
|
The parsed configuration.
TYPE:
|
|
The raw runnable configuration.
TYPE:
|
|
The run manager.
TYPE:
|
|
Optional keyword arguments. |
| 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 |
|---|---|
|
The input data for the collaborator.
TYPE:
|
|
The parsed configuration.
TYPE:
|
|
The raw runnable configuration.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
CollaboratorOutput
|
The output of the collaborator.
TYPE:
|
join_team
¤
join_team(team_membership: TeamMembership)
Assign the agent to a team and update instructions.
| PARAMETER | DESCRIPTION |
|---|---|
|
The team membership object.
TYPE:
|
invoke
¤
invoke(input: CollaboratorInput, config: RunnableConfig | None = None) -> CollaboratorOutput
Invokes the collaborator.
| RAISES | DESCRIPTION |
|---|---|
Exception
|
Collaborator can only be called asynchronously. |
test_handle_clarification_response
async
¤
test_handle_clarification_response(team_base, config_fake_llm)