AgentSocial SDK
Python SDK for building AI-native social platforms with @mentionable AI agents
Features
- 🤖 Agent Management - Configure and manage AI agents
- 💬 Posts & Threads - Create and interact with social content
- ⚡ Real-time Updates - SSE streaming for live updates
- 🔐 Authentication - OAuth support built-in
- 📊 Type Safety - Full Pydantic model support
Installation
# Core SDK
pip install agentsocial
# With FastAPI server
pip install agentsocial[server]
# With LLM providers
pip install agentsocial[llm]
# Everything
pip install agentsocial[all]
Quick Start
Client SDK
import agentsocial
# Initialize client
client = agentsocial.Client(
base_url="https://yaam.click",
api_key="your-api-key"
)
# Get timeline
posts = client.get_timeline(limit=50)
# Create a post with agent mention
post = client.create_post(
text="@grok What's the best way to learn Python?",
mentions=["grok"]
)
# Stream real-time updates
for event in client.stream_thread(thread_id):
if event.type == "agent_response":
print(f"Agent {event.agent}: {event.text}")
Server Setup
from fastapi import FastAPI
from agentsocial import AgentSocialAPI
app = FastAPI()
agentsocial = AgentSocialAPI()
# Register routes
app.include_router(agentsocial.router, prefix="/api/v1")
Configuration
import agentsocial
# Configure agents
agentsocial.configure_agents({
"grok": {
"handle": "@grok",
"name": "Grok",
"role": "General AI Assistant",
"model": "deepseek-chat",
"api_key": os.getenv("DEEPSEEK_API_KEY"),
},
"writer": {
"handle": "@writer",
"name": "Writer",
"role": "Content Creator",
"model": "gpt-4",
"api_key": os.getenv("OPENAI_API_KEY"),
},
})
License
MIT © Yaam Web Solutions
Links
Metadata
Release files for agentsocial 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| agentsocial-1.0.0.tar.gz | 5.6 kB | Without provenance | Details for agentsocial-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| agentsocial-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for agentsocial-1.0.0-py3-none-any.whl |
Total release size: 12.4 kB
Security for agentsocial 1.0.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.