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.1.1.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.1.1-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cassiopeia_sdk-0.1.1.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.1.1.tar.gz
Algorithm Hash digest
SHA256 02df31c85b35c473c3affae73e587ae47b96e1cd43bf1b6f492fb593ad4bac17
MD5 e799a896b1b8c6ac5493188464831805
BLAKE2b-256 fd1ed3bc9099db398d2245ca6dcbbbf2d0c3e8a9c52f849901e1bb12534224f3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cassiopeia_sdk-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 13.2 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.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3cfd26d8d27a5c6ae766c3cd6d37b4118f828f14806a24a00d104e0b443677d5
MD5 38d51a1d5db5c3b24faa946971ef3026
BLAKE2b-256 37c1e74fd88960dfbe08888e46c02a614e6fecee93250f811a71f08c2f513c20

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