WyseOS
HomepagePython SDKUser Manual
WyseOS

Introduction

πŸ“– DocumentationπŸ“œ Concepts

Users

πŸ“‹ User Manual

Developers

πŸš€ Python SDK
πŸ“‹ Installation✨ Getting StartedπŸ”‘ Authentication🐍 Examplesβš™οΈ Release NotesπŸ”Œ ReferencesπŸ”§ Troubleshooting

Changelogs

Others

Contact Us
πŸš€ Python SDK

✨ Getting Started

This SDK has two independent workflows:

  • Marketing Session (WebSocket + Session APIs)
  • Product Analysis (HTTP polling + Product APIs)

Use one workflow at a time.

1. Setup

python -m venv .venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate
pip install wyseos-sdk

2. Configure Client

Create mate.yaml:

mate:
  api_key: "your-api-key"
  # or jwt_token: "your-jwt-token"
  base_url: "https://api.wyseos.com"
  timeout: 30

Initialize client:

from wyseos.mate import Client
from wyseos.mate.config import load_config

client = Client(load_config("mate.yaml"))

3. Choose One Workflow

WorkflowEntry PointTransportMain Output
Marketing Sessioncreate_task_runner(...).run_interactive_session(...)WebSocketStreamed session messages + marketing data
Product Analysisclient.product.create_and_wait(...)HTTP pollingProductReport

A) Marketing Session

from wyseos.mate import create_task_runner
from wyseos.mate.models import CreateSessionRequest
from wyseos.mate.task_runner import TaskExecutionOptions, TaskMode
from wyseos.mate.websocket import WebSocketClient

req = CreateSessionRequest(
    task="Create a marketing tweet thread for my product",
    mode="marketing",
    platform="api",
    extra={
        "marketing_product": {"product_id": "prod_123"},
        "skills": [{"skill_id": "xxx", "skill_name": "persona"}],
    },
)

session = client.session.create(req)
session_info = client.session.get_info(session.session_id)

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)

task_runner.run_interactive_session(
    initial_task="Generate 3 tweet drafts and recommended replies",
    attachments=[],
    task_mode=TaskMode.Marketing,
    extra=req.extra,
    options=TaskExecutionOptions(
        auto_accept_plan=False,
        capture_screenshots=False,
        verbose=True,
        stop_on_x_confirm=True,
        completion_timeout=600,
    ),
)

Read marketing data:

reply_data = client.session.get_marketing_data(session.session_id, type="reply")
like_data = client.session.get_marketing_data(session.session_id, type="like")
retweet_data = client.session.get_marketing_data(session.session_id, type="retweet")
tweet_data = client.session.get_marketing_data(session.session_id, type="tweet")

B) Product Analysis

Optional attachment upload:

upload = client.file_upload.upload_file("brief.pdf")
attachments = [{"file_name": upload["file_name"], "file_url": upload["file_url"]}]

One-shot API:

report = client.product.create_and_wait(
    product="Notion",
    attachments=attachments,
    poll_interval=20,
    max_attempts=30,
)

print(report.report_id)
print(report.status)
print(report.product_name)

Next

  • Authentication
  • Examples
  • References

πŸ“‹ Installation

Previous Page

πŸ”‘ Authentication

Next Page

Table of Contents

1. Setup
2. Configure Client
3. Choose One Workflow
A) Marketing Session
B) Product Analysis
Next