Skip to main content

Python SDK for building and deploying Sypho agents

Project description

Sypho SDK

Python SDK for building and deploying AI agents on the Sypho platform.

Installation

pip install sypho-sdk

Quick Start

1. Define an Agent with Entrypoints

from sypho_sdk import entrypoint, tool, AgentContext

@entrypoint(name="search", description="Search for information")
async def search_handler(input: dict, context: AgentContext):
    query = input["query"]

    # Call tools
    results = await context.call_tool("web_search", {"query": query})

    return {"results": results}

@tool(name="web_search", description="Search the web")
def web_search(query: str) -> dict:
    # Your search implementation
    return {"results": [...]}

2. Auto-Discovery

The SDK automatically discovers all @entrypoint and @tool decorated functions when packaging your agent:

python -m sypho_sdk.auto_package my_agent.main my-agent 0.1.0

This generates a complete manifest with all entrypoints and tools automatically discovered.

3. Local Development

from sypho_sdk import Agent

# Traditional agent definition (also supported)
agent = Agent("my-agent")

@agent.task
async def run(input: dict, context):
    # Agent logic
    return {"output": "result"}

Features

  • @entrypoint decorator: Mark functions as agent entry points
  • @tool decorator: Define reusable tools with automatic schema generation
  • Auto-discovery: Automatically generate manifests from decorated functions
  • Agent Context: Built-in context for tool calls, LLM interactions, and state management
  • Local tools: Mark tools as local with @tool(local=True)
  • Type hints: Automatic parameter schema generation from Python type hints

API Reference

Decorators

@entrypoint(name=None, description=None)

Marks a function as an agent entrypoint. Entrypoints are the main execution paths for your agent.

@entrypoint(name="main", description="Main entry point")
async def main_handler(input: dict, context: AgentContext):
    return {"result": "success"}

@tool(name=None, description=None, parameters=None, local=False)

Defines a tool that can be called by the agent.

@tool(name="calculate", description="Perform calculations")
def calculate(a: int, b: int, operation: str = "add") -> int:
    if operation == "add":
        return a + b
    elif operation == "multiply":
        return a * b

Classes

AgentContext

Provides methods for interacting with the platform during agent execution:

  • await context.call_tool(name, args): Call a tool
  • await context.chat(messages, tools): Interact with LLM
  • context.run_loop(): Start agentic execution loop

Agent

Traditional agent definition class (backwards compatible):

agent = Agent("agent-name")

@agent.task
async def run(input, context):
    return {"output": "result"}

Examples

Multi-Entrypoint Agent

from sypho_sdk import entrypoint, tool, AgentContext

@entrypoint(name="analyze", description="Analyze data")
async def analyze(input: dict, context: AgentContext):
    data = input["data"]
    analysis = await context.call_tool("process_data", {"data": data})
    return {"analysis": analysis}

@entrypoint(name="report", description="Generate report")
async def report(input: dict, context: AgentContext):
    analysis_result = input["analysis_result"]
    report = await context.call_tool("format_report", analysis_result)
    return {"report": report}

@tool(name="process_data")
def process_data(data: list) -> dict:
    return {"processed": len(data)}

@tool(name="format_report")
def format_report(data: dict) -> str:
    return f"Analysis Report: {data}"

Development

Building the Package

python -m build

Installing Locally

pip install -e .

License

MIT

Support

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sypho_sdk-0.3.15.tar.gz (227.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sypho_sdk-0.3.15-py3-none-any.whl (233.3 kB view details)

Uploaded Python 3

File details

Details for the file sypho_sdk-0.3.15.tar.gz.

File metadata

  • Download URL: sypho_sdk-0.3.15.tar.gz
  • Upload date:
  • Size: 227.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for sypho_sdk-0.3.15.tar.gz
Algorithm Hash digest
SHA256 e860b8de074bc1689220d8c8349ed47a47661aa875281b3869cb0a98d6362972
MD5 0cbd2051a648c077606fb1f664cb25bb
BLAKE2b-256 c5670fac642ad127f9c9244cd97ea2371e6132437958ff03091c546c4795154e

See more details on using hashes here.

File details

Details for the file sypho_sdk-0.3.15-py3-none-any.whl.

File metadata

  • Download URL: sypho_sdk-0.3.15-py3-none-any.whl
  • Upload date:
  • Size: 233.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for sypho_sdk-0.3.15-py3-none-any.whl
Algorithm Hash digest
SHA256 b400d332c9b8ec1aad29d40d3df084e2cfeae75bcf2f499dbee74a0bdd3789b1
MD5 53eeaed341a2436019668526ad1da195
BLAKE2b-256 17cfd7fcb55fe9e2f17f3771ed15c0ad968fa397dae36f97d56f20a8c7ef9b44

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page