Skip to main content

Interfaces

Expose Upsonic agents through various communication protocols and platforms
Interfaces enable exposing Upsonic agents through various communication protocols and platforms. Each interface provides a standardized way to connect Upsonic agents to external systems, messaging platforms, and frontend applications.

Available Interfaces

How Interfaces Work

Interfaces are FastAPI routers that mount protocol-specific endpoints on an InterfaceManager instance. Each interface:
  • Wraps Upsonic agents into protocol-compatible endpoints
  • Handles authentication and request validation for the target platform
  • Manages session tracking and context preservation
  • Streams responses back to clients in the appropriate format

Using Interfaces

Interfaces are added to an InterfaceManager instance through the interfaces parameter:
from upsonic import Agent
from upsonic.interfaces import InterfaceManager, SlackInterface

agent = Agent(model="openai/gpt-4o-mini")

manager = InterfaceManager(
    interfaces=[SlackInterface(agent=agent)],
)

manager.serve(port=8000)
Multiple interfaces can be added to a single InterfaceManager instance, allowing the same agents to be exposed through different protocols simultaneously.