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

πŸ”Œ References

This page documents the current Python SDK API surface for v0.3.1.

Client

Client is the main entry point.

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

client = Client(load_config("mate.yaml"))
# or
client = Client(ClientOptions(api_key="YOUR_API_KEY"))

ClientOptions

FieldTypeRequiredDefault
api_keyOptional[str]NoNone
jwt_tokenOptional[str]NoNone
base_urlstrNohttps://api.wyseos.com
timeoutintNo30

Notes:

  • base_url must start with http:// or https://.
  • timeout range is 1-300.
  • Configure one of api_key or jwt_token.

Services on Client

  • client.user
  • client.team
  • client.agent
  • client.session
  • client.browser
  • client.file_upload
  • client.marketing
  • client.product

Session APIs

Access via client.session.

Methods

  • create(request: CreateSessionRequest) -> CreateSessionResponse
  • get_info(session_id: str) -> SessionInfo
  • get_messages(session_id: str, page_num: int = 1, page_size: int = 20, filter: Optional[MessageFilter] = None) -> GetMessagesResponse
  • get_between_messages(session_id: str, from_message_id: str, to_message_id: str) -> GetMessagesResponse
  • get_marketing_data(session_id: str, type: Optional[str] = None) -> Dict[str, Any]
  • update_session_name(request: UpdateSessionNameRequest) -> None

CreateSessionRequest

from wyseos.mate.models import CreateSessionRequest

req = CreateSessionRequest(
    task="Draft a Twitter launch campaign for my product",
    mode="marketing",      # optional
    platform="api",        # optional
    extra={                 # optional
        "marketing_product": {"product_id": "prod_123"}
    },
)

Fields:

  • task: str (required)
  • intent_id: Optional[str]
  • mode: Optional[str]
  • platform: Optional[str]
  • extra: Optional[Dict[str, Any]]

TaskRunner APIs

Create TaskRunner with the package-level factory:

from wyseos.mate import create_task_runner
from wyseos.mate.websocket import WebSocketClient

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)

TaskMode

  • TaskMode.Default
  • TaskMode.DeepSearch
  • TaskMode.Marketing

TaskExecutionOptions

FieldTypeDefault
verboseboolFalse
auto_accept_planboolTrue
capture_screenshotsboolFalse
enable_browser_loggingboolTrue
enable_event_loggingOptional[bool]None
completion_timeoutint300
max_user_input_timeoutint0
stop_on_x_confirmboolFalse

TaskRunner Methods

run_task(
    task: str,
    attachments: List[Dict] = None,
    task_mode: TaskMode = TaskMode.Default,
    extra: Optional[Dict[str, Any]] = None,
    options: TaskExecutionOptions = None,
) -> TaskResult
run_interactive_session(
    initial_task: str,
    attachments: List[Dict] = None,
    task_mode: TaskMode = TaskMode.Default,
    extra: Optional[Dict[str, Any]] = None,
    options: TaskExecutionOptions = None,
) -> None

TaskResult

  • success: bool
  • final_answer: str
  • error: Optional[str]
  • screenshots: List[Dict[str, Any]]
  • execution_logs: List[Dict[str, Any]]
  • plan_history: List[Dict[str, Any]]
  • session_duration: float
  • message_count: int

Product APIs

Access via client.product.

Methods

  • create(req: CreateProductRequest) -> CreateProductResponse
  • get_info(product_id: str) -> ProductInfo
  • get_report(report_id: str) -> ProductReport
  • get_categories() -> List[Industry]
  • create_and_wait(product: str, attachments: Optional[List[Dict[str, str]]] = None, poll_interval: int = 20, max_attempts: int = 30, on_poll: Optional[Callable[[int, str], None]] = None) -> ProductReport

CreateProductRequest

  • product: str
  • attachments: List[ProductAttachment]

ProductAttachment:

  • file_name: str
  • file_url: str

Marketing APIs

Access via client.marketing.

  • update_report(report_id: str, data: Dict[str, Any]) -> Dict[str, Any]
  • get_research_tweets(query_id: str) -> Any

Session-level marketing content API:

  • client.session.get_marketing_data(session_id, type="reply"|"like"|"retweet"|"tweet")

File Upload API

Access via client.file_upload.

  • upload_file(file_path: str, session_id: Optional[str] = None) -> Dict[str, Any]

Supported extensions include:

  • .txt, .pdf, .png, .jpg, .jpeg, .md, .csv, .html, .htm, .rss, .xml, .gif, .py, .json

Max file size: 10MB.

Pagination Models

  • ListOptions(page_num: int = 1, page_size: int = 20)
  • PaginatedResponse[T] with fields: page_num, page_size, total, total_page, data

βš™οΈ Release Notes

Previous Page

πŸ”§ Troubleshooting

Next Page

Table of Contents

Client
ClientOptions
Services on Client
Session APIs
Methods
CreateSessionRequest
TaskRunner APIs
TaskMode
TaskExecutionOptions
TaskRunner Methods
TaskResult
Product APIs
Methods
CreateProductRequest
Marketing APIs
File Upload API
Pagination Models