Thin adapter layer for live/realtime AI model APIs (Gemini Live, OpenAI Realtime)
Project description
LiveLink
The supervised runtime for voice AI agents.
5 lines to a working voice agent. Add tools in +3. Add guardrails in +5. Grow to multi-agent without rewriting.
Install
pip install livelink[gemini,serve] # Gemini Live
pip install livelink[openai,serve] # OpenAI Realtime
pip install livelink[all] # All providers + serve
Requires Python 3.10+.
Quickstart
Get a Google AI API key, then:
export GOOGLE_API_KEY=your-key-here
from livelink import LiveAgent
agent = LiveAgent(
model="gemini/gemini-2.5-flash-native-audio",
instructions="You are a helpful voice assistant.",
)
agent.serve()
Open http://localhost:8000. Talk to your agent.
Add a Tool (+3 lines)
from livelink import LiveAgent
agent = LiveAgent(
model="gemini/gemini-2.5-flash-native-audio",
instructions="You help with weather questions.",
)
@agent.tool
async def get_weather(city: str) -> str:
"""Get current weather for a city."""
return f"72°F and sunny in {city}"
agent.serve()
Tool schemas are inferred automatically from type hints and docstrings.
Add Guardrails (+5 lines)
from livelink import LiveAgent, input_guardrail, GuardrailResult
@input_guardrail
async def block_pii(content: str) -> GuardrailResult:
if "@" in content or "SSN" in content:
return GuardrailResult(action="block", message="PII detected")
return GuardrailResult(action="pass")
agent = LiveAgent(
model="gemini/gemini-2.5-flash-native-audio",
instructions="You are a helpful voice assistant.",
input_guardrails=[block_pii],
)
agent.serve()
Guardrails run at every input/output boundary. Chain multiple, modify content, or block outright.
Multi-Agent Handoffs (+8 lines)
from livelink import LiveAgent, Handoff
billing = LiveAgent(
model="gemini/gemini-2.5-flash-native-audio",
instructions="You are a billing specialist.",
)
agent = LiveAgent(
model="gemini/gemini-2.5-flash-native-audio",
instructions="You are a support router. Transfer billing questions.",
handoffs=[Handoff(target=billing, tool_name="transfer_to_billing")],
)
agent.serve()
The transport stays open. Conversation history accumulates across swaps.
What's Included
Providers
- Gemini Live (Google GenAI SDK)
- OpenAI Realtime API
- One interface for both — swap
model=to switch
Runtime
agent.serve()— zero-config WebSocket server + browser UIRunner.run(agent, transport)— structured lifecycle with callbacksagent.session().run(transport)— full manual control- All three use the same underlying session — no rewrite cliffs
Supervision
- Observable tool calls, audio events, and reasoning steps via EventBus
- Human-in-the-loop (HITL) input requests with priority, timeout, cancellation
- Background task management with cancellation support
- Conversation state machine (idle → active → interrupted → complete)
Agent patterns
@agent.tool— automatic JSON schema from type hints + docstrings@input_guardrail/@output_guardrail— content validation at boundariesHandoff— control transfer between agents (transport stays open)agent.as_tool()— delegation pattern (sub-agent runs as a tool call)
LangGraph integration
pip install livelink[langchain]
Run any LangGraph graph as a voice agent with full interrupt/resume support.
Docker
export GOOGLE_API_KEY=your-key
docker-compose up
# Open http://localhost:8000
Architecture
One runtime path, progressively revealed:
agent.serve() # 5 lines — zero config
Runner.run(agent, transport, on_*=…) # 15 lines — callbacks + lifecycle
agent.session(config=…).run(transport)# 30+ lines — full control
LiveAgent is pure config. RealtimeSession is the runtime. Runner manages the lifecycle between them. Adapters translate provider-specific protocols — your code never sees the difference.
Examples
See examples/ for runnable demos:
minimal_voice/— simplest possible agentpizza_order/— tool use with structured statesupervised_agent/— HITL approvals and supervisor injectionescalation_handler/— multi-step investigation with graduated autonomymulti_agent/— handoffs and delegationguardrails/— input/output content filteringincident_response/— LangGraph ReAct agent with voice interface
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file livelink-0.1.0.tar.gz.
File metadata
- Download URL: livelink-0.1.0.tar.gz
- Upload date:
- Size: 86.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b0e91aa9f863a9b315c0f2450a369d8365fc8414312e4d8ef2db35ab64345fc
|
|
| MD5 |
144d2b3424fc23d79af1cad2d663ac30
|
|
| BLAKE2b-256 |
0287281931976c6a49fdfae34d438f3668e005a610605c2ea674253e43a0fda3
|
Provenance
The following attestation bundles were made for livelink-0.1.0.tar.gz:
Publisher:
release.yml on banu-teja/livelink
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
livelink-0.1.0.tar.gz -
Subject digest:
1b0e91aa9f863a9b315c0f2450a369d8365fc8414312e4d8ef2db35ab64345fc - Sigstore transparency entry: 1894424848
- Sigstore integration time:
-
Permalink:
banu-teja/livelink@6a08be25016ba1ff8548447127d782995ede8965 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/banu-teja
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6a08be25016ba1ff8548447127d782995ede8965 -
Trigger Event:
push
-
Statement type:
File details
Details for the file livelink-0.1.0-py3-none-any.whl.
File metadata
- Download URL: livelink-0.1.0-py3-none-any.whl
- Upload date:
- Size: 74.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7faeffb444c5b6222e05268077eb95faf02b829771aa10c8fe3065e7a311fa2f
|
|
| MD5 |
9ffc46cfe6a5ce4048d76030d9879a2b
|
|
| BLAKE2b-256 |
c3eca583dbe7293627386f6824e18f965be378add09e1c3ae63c6581b7f30ee8
|
Provenance
The following attestation bundles were made for livelink-0.1.0-py3-none-any.whl:
Publisher:
release.yml on banu-teja/livelink
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
livelink-0.1.0-py3-none-any.whl -
Subject digest:
7faeffb444c5b6222e05268077eb95faf02b829771aa10c8fe3065e7a311fa2f - Sigstore transparency entry: 1894425095
- Sigstore integration time:
-
Permalink:
banu-teja/livelink@6a08be25016ba1ff8548447127d782995ede8965 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/banu-teja
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6a08be25016ba1ff8548447127d782995ede8965 -
Trigger Event:
push
-
Statement type: