SDK for Cassiopeia Agent via Redis
Project description
Cassiopeia Agent Python SDK
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: implementhandle()and you're doneCassiopeiaClient— low-level Redis Pub/Sub messagingverify_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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02df31c85b35c473c3affae73e587ae47b96e1cd43bf1b6f492fb593ad4bac17
|
|
| MD5 |
e799a896b1b8c6ac5493188464831805
|
|
| BLAKE2b-256 |
fd1ed3bc9099db398d2245ca6dcbbbf2d0c3e8a9c52f849901e1bb12534224f3
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3cfd26d8d27a5c6ae766c3cd6d37b4118f828f14806a24a00d104e0b443677d5
|
|
| MD5 |
38d51a1d5db5c3b24faa946971ef3026
|
|
| BLAKE2b-256 |
37c1e74fd88960dfbe08888e46c02a614e6fecee93250f811a71f08c2f513c20
|