SDK for interacting with Machine AI platform
Project description
📦 Installation
Install directly from the GitHub repository:
pip install "machine-sdk @ git+https://github.com/rossman22590/machine-sdk.git@main#subdirectory=sdk"
Or using uv:
uv add "machine-sdk @ git+https://github.com/rossman22590/machine-sdk.git@main#subdirectory=sdk"
🔧 Quick Start
import asyncio
from Machine import Machine
async def main():
mcp_tools = Machine.MCPTools(
"http://localhost:4000/mcp/", # Point to any HTTP MCP server
"Machine",
)
await mcp_tools.initialize()
# Initialize the client
client = Machine.Machine(api_key="your-api-key")
# Create an agent
agent = await client.Agent.create(
name="My Assistant",
system_prompt="You are a helpful AI assistant.",
mcp_tools=[mcp_tools],
allowed_tools=["get_wind_direction"],
)
# Create a conversation thread
thread = await client.Thread.create()
# Run the agent
run = await agent.run("Hello, how are you?", thread)
# Stream the response
stream = await run.get_stream()
async for chunk in stream:
print(chunk, end="")
if __name__ == "__main__":
asyncio.run(main())
🔑 Environment Setup
Get your API key from https://machine.myapps.ai/settings/api-keys
🧪 Running Examples
# Install dependencies
uv sync
# Run the main example
PYTHONPATH=$(pwd) uv run example/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
machine_sdk-0.1.3.tar.gz
(2.8 kB
view details)
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 machine_sdk-0.1.3.tar.gz.
File metadata
- Download URL: machine_sdk-0.1.3.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
439b7ae4da2d51abc6848e42cce5789cf41938a3c07abc584f9ba46275bad655
|
|
| MD5 |
f9ca0417c512e12e880fd907a6865633
|
|
| BLAKE2b-256 |
7a261868e1572f511b95c5bdf1c5af4be2391f4ed45ac819245f8befebf2630b
|
File details
Details for the file machine_sdk-0.1.3-py3-none-any.whl.
File metadata
- Download URL: machine_sdk-0.1.3-py3-none-any.whl
- Upload date:
- Size: 2.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9db9193505464df2c253fa3ed4ab3b4bf92d35b2d969befc6cc0a5af1aee4f2b
|
|
| MD5 |
9137b6d9bac2672d950da4d2b2877514
|
|
| BLAKE2b-256 |
754e37f2a025a8cd96940ce0218544a3ff94130751213a694586d247a9b92cc0
|