Python & JavaScript / TypeScript SDKs
Wire TESI into LangGraph, CrewAI, or Vercel AI SDK in 10 lines.
Building an orchestrator in Python or TypeScript without stdio MCP? Drop in our single-file, zero-dependency tesi_sdk.py or tesi-sdk.mjs client. Both enforce TESI-Topup-Mode: manual, verify replySha256, and recover interrupted turns automatically.
1. Python: LangGraph / CrewAI / OpenAI Agents SDK
curl -fsS https://toolsenabled.ai/agents/tesi-sdk.py.txt -o tesi_sdk.py
python3 -I tesi_sdk.py --self-check
# Inside your LangGraph node, CrewAI @tool, or FastAPI worker:
from tesi_sdk import TesiAgentClient
tesi = TesiAgentClient() # reads TESI_API_KEY from environment
quote = tesi.quote("Build a SQLite webhook service with tests")
result = tesi.work(
"Build a Python 3 stdlib + SQLite event counter service and run tests.",
acceptance_checks=[
"Duplicate event IDs return HTTP 200 without double-counting.",
"Conflicting payloads under the same ID return HTTP 409.",
],
effort="medium",
)
print(result["reply"], result["balance"]["availableUsd"])
2. TypeScript / Node.js 18+: Vercel AI SDK / Mastra / Edge
curl -fsS https://toolsenabled.ai/agents/tesi-sdk.mjs -o tesi-sdk.mjs
// ESM import in Node 18+, Deno, Bun, or Cloudflare Workers:
import { TesiAgentClient, tesiToolDefinitions } from './tesi-sdk.mjs';
const tesi = new TesiAgentClient({ apiKey: process.env.TESI_API_KEY });
const quote = await tesi.quote('Reconcile orders.csv against settlements.csv');
const turn = await tesi.work('Reconcile orders.csv against settlements.csv and return JSON.', {
acceptanceChecks: ['Report netDeltaCents, missingIds, unexpectedIds, and amountDifferences.'],
});
console.log(turn.replySha256, turn.balance.availableUsd);
Questions
Python & TypeScript SDK FAQ.
Do tesi_sdk.py and tesi-sdk.mjs require any third-party packages?
No. tesi-sdk.py.txt uses only the Python 3.10+ standard library, and tesi-sdk.mjs uses standard fetch and WebCrypto available natively in Node.js 18+, Deno, Bun, Cloudflare Workers, and modern browsers.
What happens if our LangGraph or Vercel worker times out mid-execution?
Both SDKs generate an idempotent mw_... requestId, send TESI-Checked-Request and TESI-Topup-Mode: manual, and automatically poll GET /api/v1/agents/turns/{requestId} on HTTP 409 or network drops—recovering the SHA-256 verified reply without double-charging credits.
Does the JavaScript SDK include tool definitions for OpenAI, Anthropic, and Vercel AI SDK?
Yes. tesi-sdk.mjs exports tesiToolDefinitions with ready-to-pass JSON Schema function specifications for tesi_quote and tesi_work.
Next steps