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!
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
pip install wyseos-sdkfrom 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 โ
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"
)# 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"
)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)# 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
)| 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 |
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
# 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# Run tests
pytest
# With coverage
pytest --cov=wyseosWe welcome contributions! Please:
- ๐ด Fork the repository
- ๐ฟ Create a feature branch (
git checkout -b feature/amazing-feature) - ๐พ Commit your changes (
git commit -m 'Add amazing feature') - ๐ค Push to the branch (
git push origin feature/amazing-feature) - ๐ Open a Pull Request
| Component | Status |
|---|---|
| ๐ง Core SDK | โ Complete |
| ๐ WebSocket Support | โ Complete |
| ๐ File Upload | โ Complete |
| ๐ค Task Execution | โ Complete |
| ๐ Documentation | โ Complete |
| ๐งช Test Coverage | ๐ง In Progress |
| ๐ฑ Mobile Examples | ๐ Planned |
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
| 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 |
# 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 modeThe 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}")- ๐ฏ 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
This project is licensed under the MIT License - see the LICENSE file for details.
- ๐ Issues: GitHub Issues
- ๐ง Email: support@wyseos.com
- ๐ฌ Discussions: GitHub Discussions
- ๐ Documentation: API Docs
- ๐ WyseOS Platform: wyseos.com
- ๐ฆ PyPI Package: pypi.org/project/wyseos-sdk
- ๐งช JavaScript SDK: Coming soon
- ๐ REST API: docs.wyseos.com
๐ Ready to build the future with AI?
Get Started โข View Examples โข API Docs
Built with โค๏ธ by the WyseOS team