Teleon Library
API reference for the Teleon Python library
Overview
Teleon is a production-ready platform for building, deploying, and managing AI agents.
Role
The Teleon Python library is the primary integration surface for your application code. It provides:
- Authentication and agent registration via
TeleonClient - The
@client.agent(...)decorator for defining agents (async functions) - The
@tool(...)decorator for defining reusable tools - Optional integration points for Cortex (memory), Sentinel (safety), and Helix (runtime)
When to use
- You want the exact API surface (classes, decorators, methods) and configuration defaults.
- You need patterns like scope checks (
has_scope/require_scope) or working with remote/deployed agents.
Use this API reference when you need:
- The exact Python API surface (classes, decorators, methods)
- Configuration options and defaults
- Exception types and error-handling patterns
Installation
Imports
Authentication
API key formats
API keys must follow one of these formats:
tlk_live_xxx(production)tlk_test_xxx(test)teleon_xxx(legacy)
Environment variables
| Variable | Description |
|---|---|
TELEON_API_KEY | Your Teleon API key |
TELEON_API_URL | Custom API URL |
TELEON_PLATFORM_URL | Platform URL for metrics |
TELEON_QUIET | Suppress initialization messages |
TELEON_METRICS_ENABLED | Enable/disable metrics reporting |
TeleonClient
Core class for authenticating and registering agents.
Initialization
Methods
| Method | Description |
|---|---|
agent() | Decorator to register an agent |
has_scope(*scopes) | Check if API key has required scopes |
require_scope(*scopes) | Raise error if key lacks scopes |
get_remote_agent(name) | Get reference to a deployed agent |
list_deployed_agents() | List all deployed agents |
close() | Close HTTP client connections |
Class methods
Agent decorator: @client.agent(...)
Registers an agent with the Teleon platform.
Requirements
- Agent functions must be
async def - Agent functions must return a value
Basic usage
Full configuration
Configuration options
| Option | Type | Default | Description |
|---|---|---|---|
name | str | required | Agent name |
description | str | function docstring | Agent description |
model | str | "gpt-4" | LLM model to use |
temperature | float | 0.7 | Temperature setting |
max_tokens | int | 500 | Maximum tokens |
helix | dict | None | Helix runtime config |
cortex | bool/dict | None | Cortex memory config |
sentinel | dict | None | Sentinel safety config |
tools | list | [] | Tools available to agent |
timeout | int | None | Execution timeout |
Tool decorator: @tool(...)
Defines a reusable tool that agents can execute.
Basic usage
Full configuration
Configuration options
| Option | Type | Default | Description |
|---|---|---|---|
name | str | function name | Tool name |
description | str | docstring | Tool description |
category | str | "general" | Tool category |
cache_ttl | int | None | Cache TTL in seconds |
timeout | float | None | Execution timeout |
Tool registry
Remote agents
Interact with deployed agents from your applications.
Getting a remote agent
Executing a remote agent
Remote agent management
Remote Cortex access
LLM Gateway
Unified interface for multiple LLM providers.
Quick start
Streaming
Supported providers
| Provider | Models |
|---|---|
| OpenAI | gpt-4, gpt-4-turbo, gpt-4o, gpt-3.5-turbo |
| Anthropic | claude-3-opus, claude-3-sonnet, claude-3-haiku |
| gemini-pro, gemini-1.5-pro | |
| Azure OpenAI | All Azure-deployed models |
Statistics
Integrations
Pre-built integrations for popular services.
Slack
GitHub
Testing framework
Base test classes
Mocks
Assertions
Errors
Teleon provides an exception hierarchy to support robust error handling.