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.11.tar.gz (223.6 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.11-py3-none-any.whl (229.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sypho_sdk-0.3.11.tar.gz
  • Upload date:
  • Size: 223.6 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.11.tar.gz
Algorithm Hash digest
SHA256 dfb8516f5ea3f050cb643e05bb85bdebdd6fb3dbfb40f569676161bb261a57e3
MD5 c36aababbbede613cd1ffa936a19f074
BLAKE2b-256 6cb57445c7fd844ab7ba2cf69376a9b9d6384fc99ffd59a56fe318c0c01d625e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sypho_sdk-0.3.11-py3-none-any.whl
  • Upload date:
  • Size: 229.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.11-py3-none-any.whl
Algorithm Hash digest
SHA256 844260b2733cecc84271d66c51f9eac2b8e89b9ff44ec44b0368dcac799e391b
MD5 f5a537fc9a1f29351be8e571e8af1642
BLAKE2b-256 4f5443c71ae19014c1649be47fc5945ca55a59676cedbcb87b9bf89edeef63bd

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