Python SDK for WyseOS
Project description
WyseOS SDK for Python
Official Python SDK for WyseOS session protocol and real-time task execution.
Highlights
- HTTP + WebSocket workflow aligned with
docs/wyse-session-protocol.md CreateSessionRequest(task, mode, platform, extra)- API Key and JWT dual authentication
TaskRunnerfor automated and interactive execution- Marketing rich-stream support (
marketing_tweet_reply,marketing_tweet_interact,writer_twitter) - Marketing data APIs and dashboard APIs
Installation
pip install wyseos-sdk
See full install guide: installation.md.
Quick Start
from wyseos.mate import Client, create_task_runner
from wyseos.mate.config import load_config
from wyseos.mate.models import CreateSessionRequest
from wyseos.mate.task_runner import TaskExecutionOptions, TaskMode
from wyseos.mate.websocket import WebSocketClient
# 1) Initialize client
client = Client(load_config("mate.yaml"))
# 2) Create session (latest protocol fields)
req = CreateSessionRequest(
task="Draft a Twitter launch campaign for my product",
mode="marketing",
platform="api",
extra={"marketing_product": {"product_id": "prod_123"}},
)
session = client.session.create(req)
session_info = client.session.get_info(session.session_id)
# 3) Connect websocket + task runner
ws_client = WebSocketClient(
base_url=client.base_url,
api_key=client.api_key or "",
jwt_token=client.jwt_token or "",
session_id=session_info.session_id,
)
task_runner = create_task_runner(ws_client, client, session_info)
# 4) Execute interactive session (recommended for marketing input loops)
task_runner.run_interactive_session(
initial_task="Generate 3 tweet drafts and 5 candidate replies",
task_mode=TaskMode.Marketing,
extra=req.extra,
options=TaskExecutionOptions(
auto_accept_plan=False,
verbose=True,
stop_on_x_confirm=True,
completion_timeout=600,
),
)
More examples: examples/quickstart.md and examples/getting_started/example.py.
Authentication
Use one of the following in ClientOptions / mate.yaml:
api_keyjwt_token
Behavior:
- HTTP:
api_key->x-api-keyjwt_token->Authorization
- WebSocket URL query:
?api_key=...?authorization=...
Session Protocol Flow
Typical flow:
client.session.create(...)to getsession_id- Connect
WebSocketClient - Send
start - Receive
plan / input / progress / rich / text - Receive
task_result - Optionally receive
follow_up_suggestion
For full message schema and rich types, see docs/wyse-session-protocol.md.
Task Runner API
TaskRunner is created via:
task_runner = create_task_runner(ws_client, client, session_info)
Main methods:
run_task(task, attachments=None, task_mode=TaskMode.Default, extra=None, options=None) -> TaskResultrun_interactive_session(initial_task, attachments=None, task_mode=TaskMode.Default, extra=None, options=None)
TaskExecutionOptions includes:
verbose(default:False) — print status/progress to stdoutauto_accept_plan— auto-approve plan without user inputcapture_screenshotsstop_on_x_confirm— stop session when browser confirmation is requested (useful in CLI)completion_timeout
Marketing APIs
Session-scoped generated content:
client.session.get_marketing_data(session_id, type="reply")
client.session.get_marketing_data(session_id, type="like")
client.session.get_marketing_data(session_id, type="retweet")
client.session.get_marketing_data(session_id, type="tweet")
Dashboard APIs:
client.marketing.get_product_info(product_id)
client.marketing.get_report_detail(report_id)
client.marketing.update_report(report_id, data)
client.marketing.get_research_tweets(query_id)
Services Overview
client.user- API keysclient.team- team list/infoclient.agent- agent list/infoclient.session- create/info/messages/marketing dataclient.browser- browser APIsclient.file_upload- upload and validationclient.marketing- dashboard marketing APIs
Error Types
APIErrorNetworkErrorWebSocketErrorConfigErrorSessionExecutionError
Documentation
- Protocol:
docs/wyse-session-protocol.md - Upgrade notes:
docs/session_protocol_upgrade.md - Quick Start:
examples/quickstart.md - Installation:
installation.md - Full Example:
examples/getting_started/example.py
Project details
Release history Release notifications | RSS feed
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 wyseos_sdk-0.3.0.tar.gz.
File metadata
- Download URL: wyseos_sdk-0.3.0.tar.gz
- Upload date:
- Size: 32.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c967039fd47c8814b609ea38c33150e0924ce54b275a64c8899c7c416c8812f
|
|
| MD5 |
d9ce4e373b6a876d22663d3c9c9e782b
|
|
| BLAKE2b-256 |
1a271981161941e7328eb6ffec5f9e64be6f69fa9914c5e0e3809c09a8ad4619
|
File details
Details for the file wyseos_sdk-0.3.0-py3-none-any.whl.
File metadata
- Download URL: wyseos_sdk-0.3.0-py3-none-any.whl
- Upload date:
- Size: 38.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e252311a092d8187764866924a1a71332347c51056b98d2a0a4ba92307fa65b1
|
|
| MD5 |
73fbaf11ef4b6b27f2ba0215234104fa
|
|
| BLAKE2b-256 |
3e916adfe359a36fd9b5571546e2b318a3d5eaadde48903143cecbef7310db7e
|