From Template • AI Agent SDK

from_template: Create an Agent from a template.

from_template

Method

</div>

This is a method of the Agent class in the agent module.

Create an Agent from a template.

Signature

python
def from_template(uri: str, config: Optional[Dict[str, Any]], offline: bool) -> 'Agent'

Parameters

ParamField str

Template URI (local path, package ref, or github ref)

ParamField Optional

No description available.

ParamField bool

No description available.

Returns

ResponseField 'Agent'

Configured Agent instance

Usage

Example 1
- "./my-template" (local path)
        - "transcript-generator" (default recipes repo)
        - "github:owner/repo/template@v1.0.0" (GitHub with version)
        - "package:agent_recipes/transcript-generator" (installed package)
    config: Optional configuration overrides
    offline: If True, only use cached templates (no network)
    **kwargs: Additional Agent constructor arguments
Example 2
from praisonaiagents import Agent

    # From default recipes repo
    agent = Agent.from_template("transcript-generator")
    result = agent.chat("Transcribe ./audio.mp3")

    # With config overrides
    agent = Agent.from_template(
        "data-transformer",
        config={"output_format": "json"},
        verbose=True
    )

Uses

  • create_agent_from_template
  • ImportError

Source

View on GitHub

praisonaiagents/agent/agent.py at line 508