Skip to content

tenro

Main module exports for the Tenro SDK.

This module re-exports the most commonly used functions and classes for convenience.

Quick import guide

# Decorators (most common)
from tenro import link_agent, link_llm, link_tool

# Testing harness
from tenro import Construct

# Exceptions
from tenro import TenroError, TenroVerificationError

Core types

Construct

The test harness for simulating and verifying agent behaviour:

from tenro import Provider
from tenro.simulate import llm, tool
from tenro.testing import tenro

@tenro
def test_agent() -> None:
    llm.simulate(Provider.OPENAI, response="Hello")
    my_agent.run("Hi")
    llm.verify()

Bases: Construct

Test harness for simulating and verifying LLM, tool, and agent calls.

Use as a pytest fixture or context manager:

def test_example(construct):
    construct.simulate_llm(Provider.OPENAI, response="Hello")
    # ... run agent code ...
    construct.verify_llm(Provider.OPENAI)

For manual context management (non-pytest):

async with Construct() as construct:
    construct.simulate_llm(Provider.ANTHROPIC, response="Hi")
    await my_agent.run()
    construct.verify_llm()
Source code in tenro/construct.py
class Construct(_ConstructImpl):
    """Test harness for simulating and verifying LLM, tool, and agent calls.

    Use as a pytest fixture or context manager:

        def test_example(construct):
            construct.simulate_llm(Provider.OPENAI, response="Hello")
            # ... run agent code ...
            construct.verify_llm(Provider.OPENAI)

    For manual context management (non-pytest):

        async with Construct() as construct:
            construct.simulate_llm(Provider.ANTHROPIC, response="Hi")
            await my_agent.run()
            construct.verify_llm()
    """

    pass

See also