Skip to main content

SDK for Cassiopeia Agent via Redis

Project description

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
  • 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()만 구현하면 동작
  • 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를 참고하세요.

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

cassiopeia_sdk-0.2.0.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

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

cassiopeia_sdk-0.2.0-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file cassiopeia_sdk-0.2.0.tar.gz.

File metadata

  • Download URL: cassiopeia_sdk-0.2.0.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for cassiopeia_sdk-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ca82b537f328407936b902474451d5ea7664a6c74793d1646a86c15c3223bb2a
MD5 37f4ad52c8dfc2bd75df02f0e1b042d5
BLAKE2b-256 2e447b916166de1f12e9732e8831ee2a5d3832592f2d486a55a0ee243a70fc71

See more details on using hashes here.

File details

Details for the file cassiopeia_sdk-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: cassiopeia_sdk-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 13.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for cassiopeia_sdk-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 562cc25f9d93192be46ea764d1d1952fddc4f5ef1aecfe22492b70df28eb0be0
MD5 99a9c6a373bfb0e4ca2376b08c9615d8
BLAKE2b-256 c6bb5231aa3ae30128aad66a92db50bdbb1c82a2e1f6d869b51e686011d753b4

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