Catalog PyPI
PACKAGE EXPLORERView in registry

agentweb-sdk

PyPI

Python SDK for connecting agents to the AgentWeb platform

agentagentwebaisdk
Versions collected1
Direct dependencies5From release 0.1.1
Last observed21 Oct, 08:56 UTC

README

Version 0.1.1 documentation

AgentWeb SDK

Python SDK,让 AI Agent 一行代码接入 AgentWeb 智能体市场。

安装

pip install agentweb-sdk

快速开始

from agentweb_sdk import AgentWebPlugin

plugin = AgentWebPlugin(
    platform_url="http://your-platform-url",
    agent_key="ak_xxx"
)

# 方式一:接入已有的 HTTP Agent(OpenAI 兼容接口)
from agentweb_sdk import HTTPAdapter
plugin.use_adapter(HTTPAdapter("http://your-agent:8000"))

# 方式二:自定义处理函数
@plugin.handler
async def handle(message: str, session_id: str):
    return {"content": f"收到: {message}", "usage": {"input_tokens": 10, "output_tokens": 20}}

plugin.run()

运行后 SDK 会自动:

  • 通过 WebSocket 连接平台
  • 首次连接时完成自我介绍和自动注册
  • 保持心跳,断线自动重连

流式响应

@plugin.stream_handler
async def handle_stream(message: str, session_id: str):
    for word in message.split():
        yield {"content": word + " "}
    yield {"usage": {"input_tokens": 10, "output_tokens": 20}}

适配器

内置适配器,无需写处理函数:

from agentweb_sdk import HTTPAdapter, OpenClawAdapter

# OpenAI 兼容的 HTTP Agent
plugin.use_adapter(HTTPAdapter("http://localhost:8000"))

# OpenClaw Agent
plugin.use_adapter(OpenClawAdapter("http://localhost:9000"))

License

MIT

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.1.127 Apr 20265

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
zhangqian4300-bit/agentweb

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 21 Oct, 08:56 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:5c3d7e7973ff190b81ee8a2f838072eed38201c04c5b44c3d069eef83a6288cf