Skip to main content

Python SDK for WyseOS

Project description

๐Ÿค– WyseOS SDK for Python

Python Version PyPI Package License Downloads Documentation

The official Python SDK for WyseOS - Build intelligent AI-powered applications with seamless API integration, real-time WebSocket support, and simplified task execution.

๐Ÿš€ New in v0.2.1: Simplified task execution interface with TaskRunner - execute complex AI tasks with just a few lines of code!

โœจ What is WyseOS?

WyseOS is an advanced AI platform that enables developers to build sophisticated AI agents and workflows. The Python SDK provides:

  • ๐ŸŽฏ Intelligent Task Execution - Run complex AI tasks with automatic plan acceptance
  • ๐Ÿ”„ Real-time Communication - WebSocket integration for live AI interactions
  • ๐Ÿ“‚ File Processing - Upload and analyze documents, images, and data files
  • ๐ŸŒ Browser Automation - AI-powered web browsing and data extraction
  • ๐Ÿ‘ฅ Team Management - Organize AI agents and workflows by teams
  • ๐Ÿ›ก๏ธ Enterprise Ready - Type-safe, robust error handling, and comprehensive logging

๐Ÿš€ Quick Start

Installation

pip install wyseos-sdk

30-Second Example

from wyseos.mate import Client
from wyseos.mate.config import load_config
from wyseos.mate.models import CreateSessionRequest
from wyseos.mate.websocket import WebSocketClient, TaskExecutionOptions

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

# Create session
session = client.session.create(
    CreateSessionRequest(team_id="wyse_mate", task="Analyze market trends")
)
session_info = client.session.get_info(session.session_id)

# Execute AI task
ws_client = WebSocketClient(
    base_url=client.base_url,
    api_key=client.api_key,
    session_id=session_info.session_id
)
task_runner = ws_client.create_task_runner(client, session_info)

result = task_runner.run_task(
    task="Analyze Q4 2024 market trends in tech sector",
    team_id="wyse_mate",
    options=TaskExecutionOptions(auto_accept_plan=True)
)

if result.success:
    print(f"โœ… Analysis complete: {result.final_answer}")
    print(f"โฑ๏ธ Completed in {result.session_duration:.1f} seconds")
else:
    print(f"โŒ Task failed: {result.error}")

๐ŸŽฏ Complete Quick Start Guide โ†’

๐ŸŽฎ Key Features

๐Ÿค– Simplified Task Execution

Execute complex AI workflows with minimal code:

# Automated execution - fire and forget
result = task_runner.run_task(
    task="Create a comprehensive market analysis report",
    team_id="wyse_mate",
    options=TaskExecutionOptions(auto_accept_plan=True)
)

# Interactive execution - with user input
task_runner.run_interactive_session(
    initial_task="Help me research competitors",
    team_id="wyse_mate"
)

๐Ÿ“‚ File Upload & Processing

# Upload files for AI analysis
uploaded_files = []
upload_result = client.file_upload.upload_file("data.csv")
if upload_result.get("file_url"):
    uploaded_files.append({
        "file_name": "data.csv",
        "file_url": upload_result["file_url"]
    })

# Use files in task execution
result = task_runner.run_task(
    task="Analyze this dataset and create visualizations",
    attachments=uploaded_files,
    team_id="wyse_mate"
)

โšก Real-time WebSocket Integration

from wyseos.mate.websocket import WebSocketClient, MessageType

ws = WebSocketClient(
    base_url=client.base_url,
    api_key=client.api_key,
    session_id=session_id
)

ws.set_message_handler(lambda msg: print(f"AI Agent: {msg.get('content')}"))
ws.connect(session_id)

๐Ÿ”ง Flexible Configuration

# mate.yaml
mate:
  api_key: "your-api-key"
  base_url: "https://api.wyseos.com"
  timeout: 30
# Configuration options
options = TaskExecutionOptions(
    auto_accept_plan=True,           # โœ… Auto-approve AI plans
    capture_screenshots=False,        # ๐Ÿ“ธ Browser screenshots
    enable_browser_logging=True,      # ๐ŸŒ Browser activity logs
    completion_timeout=300,           # โฑ๏ธ Task timeout
)

๐Ÿ“š Documentation & Examples

Resource Description
๐Ÿš€ Quick Start Guide Get up and running in 5 minutes
๐Ÿ“– Installation Guide Detailed installation instructions
๐ŸŽฏ Complete Example Full-featured example application
๐Ÿ“‹ Release Notes Latest updates and changes

๐ŸŽช Example Applications

The examples/ directory contains real-world usage patterns:

  • ๐Ÿ“Š Data Analysis: Upload CSV files and get AI-powered insights
  • ๐ŸŒ Web Research: Automated web browsing and data extraction
  • ๐Ÿ“ Document Processing: Analyze PDFs, images, and text files
  • ๐Ÿ’ฌ Interactive Sessions: Build chatbot-like experiences
  • ๐Ÿ”„ Workflow Automation: Chain multiple AI tasks together

๐Ÿ› ๏ธ Development & Contributing

Development Setup

# Clone repository
git clone https://github.com/WyseOS/wyseos-sdk-python
cd wyseos-sdk-python

# Create virtual environment
python -m venv venv
source venv/bin/activate  # or `venv\Scripts\activate` on Windows

# Install in development mode
pip install -e .

# Install development tools (optional)
pip install pytest pytest-cov black isort flake8 mypy

Testing

# Run tests
pytest

# With coverage
pytest --cov=wyseos

Contributing

We welcome contributions! Please:

  1. ๐Ÿด Fork the repository
  2. ๐ŸŒฟ Create a feature branch (git checkout -b feature/amazing-feature)
  3. ๐Ÿ’พ Commit your changes (git commit -m 'Add amazing feature')
  4. ๐Ÿ“ค Push to the branch (git push origin feature/amazing-feature)
  5. ๐Ÿ”„ Open a Pull Request

๐Ÿ“Š Project Status

Component Status
๐Ÿ”ง Core SDK โœ… Complete
๐ŸŒ WebSocket Support โœ… Complete
๐Ÿ“ File Upload โœ… Complete
๐Ÿค– Task Execution โœ… Complete
๐Ÿ“š Documentation โœ… Complete
๐Ÿงช Test Coverage ๐Ÿšง In Progress
๐Ÿ“ฑ Mobile Examples ๐Ÿ“‹ Planned

๐Ÿ—๏ธ Architecture

wyseos/
โ”œโ”€โ”€ mate/                    # Core SDK module
โ”‚   โ”œโ”€โ”€ client.py           # Main API client
โ”‚   โ”œโ”€โ”€ websocket.py        # WebSocket + TaskRunner
โ”‚   โ”œโ”€โ”€ models.py           # Pydantic data models
โ”‚   โ”œโ”€โ”€ config.py           # Configuration management
โ”‚   โ”œโ”€โ”€ errors.py           # Exception classes
โ”‚   โ””โ”€โ”€ services/           # API service modules
โ”‚       โ”œโ”€โ”€ user.py         # User management
โ”‚       โ”œโ”€โ”€ team.py         # Team operations
โ”‚       โ”œโ”€โ”€ agent.py        # AI agent management
โ”‚       โ”œโ”€โ”€ session.py      # Session handling
โ”‚       โ”œโ”€โ”€ browser.py      # Browser automation
โ”‚       โ””โ”€โ”€ file_upload.py  # File operations

๐Ÿ”— API Reference

Core Classes

Class Purpose
Client Main API client for HTTP requests
WebSocketClient Real-time WebSocket communication
TaskRunner Simplified task execution interface
TaskExecutionOptions Configuration for task execution
TaskResult Comprehensive task execution results

Key Methods

# Client operations
client.user.list_api_keys()
client.team.get_list()
client.agent.get_list()
client.session.create()

# File operations
client.file_upload.validate_file()
client.file_upload.upload_file()

# Task execution
task_runner.run_task()              # Automated execution
task_runner.run_interactive_session()  # Interactive mode

๐Ÿšจ Error Handling

The SDK provides structured error handling:

from wyseos.mate.errors import APIError, ValidationError, NetworkError

try:
    result = task_runner.run_task("Your task")
except ValidationError as e:
    print(f"Validation error: {e}")
except APIError as e:
    print(f"API error: {e.message}")
except NetworkError as e:
    print(f"Network error: {e}")

๐ŸŒŸ What's New in v0.2.0

  • ๐ŸŽฏ New TaskRunner Interface: Execute AI tasks with 90% less code
  • โšก Performance Optimizations: Screenshots disabled by default for faster execution
  • ๐Ÿ”ง Simplified Configuration: Cleaner options with intelligent defaults
  • ๐Ÿ“š Enhanced Documentation: Complete rewrite with practical examples
  • ๐Ÿ—๏ธ Improved Architecture: Better separation of concerns and modularity

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ†˜ Support & Community

๐Ÿ”— Related Projects


๐Ÿš€ Ready to build the future with AI?

Get Started โ€ข View Examples โ€ข API Docs

Built with โค๏ธ by the WyseOS team

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

wyseos_sdk-0.2.1.tar.gz (30.4 kB view details)

Uploaded Source

Built Distribution

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

wyseos_sdk-0.2.1-py3-none-any.whl (32.2 kB view details)

Uploaded Python 3

File details

Details for the file wyseos_sdk-0.2.1.tar.gz.

File metadata

  • Download URL: wyseos_sdk-0.2.1.tar.gz
  • Upload date:
  • Size: 30.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.4

File hashes

Hashes for wyseos_sdk-0.2.1.tar.gz
Algorithm Hash digest
SHA256 f7140ce46b98458478688a69f0d80da66729ae2fe34afb95dfec5194fd4ba1e9
MD5 2f12c9c64614d42366d67e651e6f013a
BLAKE2b-256 0a4455b4de63a5e7ce76a9731ec4bf92fc85bd524bdbf5e120c7fed914a7cfbf

See more details on using hashes here.

File details

Details for the file wyseos_sdk-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: wyseos_sdk-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 32.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.4

File hashes

Hashes for wyseos_sdk-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8e2f825957012ff2dcbfed5e1b72551cef0423e4fc1d544d4b058b0402bad183
MD5 89153e0af3636047a9078d71b4f108e0
BLAKE2b-256 f453d24a694316ddf8cb772ec5bc10f377da835ddf69e888555fde5374b75b94

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