Skip to main content

Cassiopeia Agent Python SDK

한국어 | English

English

Overview

Official Python SDK for the Cassiopeia Agent framework. Install this single library to connect your agent to the orchestra network — no Redis wiring, no message schema boilerplate.

What you get:

  • AgentBase — base class: implement handle() and you're done
  • AgentBrain — NLU router: natural-language → BrainDecision (tool + params) with injection guard, retry, rate limit
  • Tool — typed tool definition with JSON Schema validation
  • CassiopeiaClient — low-level Redis Pub/Sub messaging
  • verify_message — HMAC signature verification for incoming tasks
  • Protocol types: AgentResult, OrchestraTask, LLMRequest, LLMResponse

Requirements

  • Python 3.10+
  • Access to the orchestra's Redis server

Installation

pip install cassiopeia-sdk

Quickstart

import asyncio, os
from cassiopeia_sdk import AgentBase, AgentMessage

class MyAgent(AgentBase):
    async def handle(self, msg: AgentMessage) -> None:
        # Call LLM through the orchestra gateway (no API key needed)
        response = await self.request_llm([
            {"role": "user", "content": msg.payload["content"]}
        ])
        await self.send_result(msg.payload["task_id"], {"answer": response["content"]})

async def main():
    agent = MyAgent(os.getenv("AGENT_ID"), os.getenv("REDIS_URL"))
    await agent.register(os.getenv("ORCHESTRA_URL"), capabilities=["my_action"],
                         allow_llm_access=True, api_key=os.getenv("ORCHESTRA_API_KEY"))
    await agent.start()

asyncio.run(main())

See GUIDE.md for the full reference.


한국어

개요

Cassiopeia 에이전트 프레임워크의 공식 Python SDK입니다. 이 라이브러리 하나만 설치하면 오케스트라 네트워크에 에이전트를 연결할 수 있습니다. Redis 연결이나 메시지 스키마를 직접 다룰 필요가 없습니다.

제공 기능:

  • AgentBase — 기본 클래스: handle()만 구현하면 동작
  • AgentBrain — NLU 라우터: 자연어 → BrainDecision(Tool + 파라미터), 인젝션 방어·재시도·속도 제한 내장
  • Tool — JSON Schema 기반 타입 안전 도구 정의
  • CassiopeiaClient — 저수준 Redis Pub/Sub 메시징
  • verify_message — 수신 메시지 HMAC 서명 검증
  • 프로토콜 타입: AgentResult, OrchestraTask, LLMRequest, LLMResponse

요구사항

  • Python 3.10 이상
  • 오케스트라의 Redis 서버 접근 가능

설치

pip install cassiopeia-sdk

빠른 시작

import asyncio, os
from cassiopeia_sdk import AgentBase, AgentMessage

class MyAgent(AgentBase):
    async def handle(self, msg: AgentMessage) -> None:
        # 오케스트라 LLM 게이트웨이 호출 (별도 API 키 불필요)
        response = await self.request_llm([
            {"role": "user", "content": msg.payload["content"]}
        ])
        await self.send_result(msg.payload["task_id"], {"answer": response["content"]})

async def main():
    agent = MyAgent(os.getenv("AGENT_ID"), os.getenv("REDIS_URL"))
    await agent.register(os.getenv("ORCHESTRA_URL"), capabilities=["my_action"],
                         allow_llm_access=True, api_key=os.getenv("ORCHESTRA_API_KEY"))
    await agent.start()

asyncio.run(main())

전체 레퍼런스는 GUIDE.md를 참고하세요.

Metadata

Release files for cassiopeia-sdk 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cassiopeia-sdk 0.3.0
File Size Uploaded Provenance Actions
cassiopeia_sdk-0.3.0.tar.gz 31.9 kB Without provenance Details for cassiopeia_sdk-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cassiopeia-sdk 0.3.0
File Interpreter ABI Platform Actions
cassiopeia_sdk-0.3.0-py3-none-any.whl Python 3 none any Details for cassiopeia_sdk-0.3.0-py3-none-any.whl

Total release size: 65.4 kB

Release files / cassiopeia_sdk-0.3.0.tar.gz

Download URL cassiopeia_sdk-0.3.0.tar.gz
Size 31.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b43ae5105d2cd263f6735965673c1956ab54106ea58024c23ae4a08414a55bf4
BLAKE2b-256 checksum
How to use checksums
daabad77561bf34a19010c7015dc60c00520e1a259227eef191fd6559708404e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.20

Release files / cassiopeia_sdk-0.3.0-py3-none-any.whl

Download URL cassiopeia_sdk-0.3.0-py3-none-any.whl
Size 33.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5e02a044bade4928c8ff29f47fe4db3e9ad473b6b82155315fdba4ee09d15957
BLAKE2b-256 checksum
How to use checksums
278d768ff97fbc9b08d17ee961315def49a4da09a60878d8900cc116b14da447
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.20

Security for cassiopeia-sdk 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page