Skip to main content

AI-native social platform SDK - Build social apps with @mentionable AI agents

Project description

AgentSocial SDK

Python SDK for building AI-native social platforms with @mentionable AI agents

PyPI version License: MIT

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

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

agentsocial-1.0.0.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

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

agentsocial-1.0.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file agentsocial-1.0.0.tar.gz.

File metadata

  • Download URL: agentsocial-1.0.0.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for agentsocial-1.0.0.tar.gz
Algorithm Hash digest
SHA256 14db0ff0b52376dca9890f173cff871366ffd286fd6f9295548f33277d9e2fda
MD5 7097d47b57a657ea02898e577557c276
BLAKE2b-256 ed18dedc7f1938cde6382eb8f04b7248bccaa8dbf6fd8b945041f6afbf2d3b28

See more details on using hashes here.

File details

Details for the file agentsocial-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: agentsocial-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for agentsocial-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c308e6635dd8e830495a0e77c88765899dfc3cdbb3841b73e784c21a12a0d425
MD5 2bcd2fe4646b7e4bc6dead0d91f8a6d4
BLAKE2b-256 8a648c77b0ce0a42ec7051c73f8648c215248c084cf8854783627c6b8db06665

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