Docs /Templates/ sinapsis-sub-agents

SubAgentTemplate

sinapsis-sub-agentsSubAgents

Python template · sinapsis_sub_agents.templates.sub_agent_base

Overview

This template enables the creation of complex agent workflows by treating agents as templates.

Allows building nested agent executions for robust and scalable applications.

Capabilities

Capabilities: not set

Installation

Install the published package using pip or uv.

Terminalbash
pip install sinapsis-sub-agents==1.0.0
uv pip install sinapsis-sub-agents==1.0.0
uv add sinapsis-sub-agents==1.0.0

Configuration

Effective fields from the inspector schema, including nested Pydantic model fields.

metadata
sinapsis_core.template_base.base_models.TemplateMetadata | None
Optional
Default: null
lazy_agent

Initializes sub_agent instance in lazy mode.

bool
Optional
Default: false
agent_definitionRequired

Dictate the agent structure. It can be loaded from file or specified using a valid Agent schema.

dict | sinapsis_core.agent.base_models.ProfilerAgentSchema | sinapsis_core.agent.base_models.AgentSchema | sinapsis_core.agent.base_models.MPIAgentSchema | str | pathlib._local.PosixPath
Required
Default: null

Configuration example

Generated from documented defaults. Replace any placeholders and complete required nested settings before running.

yaml
templates:
  - template_name: "SubAgentTemplate"
    class_name: "SubAgentTemplate"
    attributes:
      lazy_agent: false
      agent_definition: "<required>"
View original docstring example

The source example references HelloWorld, not SubAgentTemplate.

yaml
agent:
  name: my_test_agent
templates:
  - template_name: InputTemplate
    class_name: InputTemplate
    attributes: {}
  - template_name: SubAgentTemplate
    class_name: SubAgentTemplate
    template_input: InputTemplate
    attributes:
      lazy_agent: false
      agent_definition:
        agent:
          name: my_test_sub_agent
        templates:
          - template_name: InputTemplate
            class_name: InputTemplate
            attributes: {}
          - template_name: HelloWorld
            class_name: HelloWorld
            template_input: InputTemplate
            attributes:
              display_text: "Hello Sinapsis"

Inheritance

Immediate parent: sinapsis_core.template_base.template.Template

Environment variables

Environment definitions belong to their canonical Python modules.

No directly related environment variables listed.