Skip to main content

The official Python SDK for the crossnode platform.

Project description

Crossnode Python SDK

The official Python SDK for interacting with the Crossnode AI platform.

Installation

pip install crossnode

Authentication

Authenticate the client using an API Key from your crossnode dashboard. By default, the SDK looks for the CROSSNODE_API_KEY environment variable.

import os
from crossnode import CrossnodeClient

os.environ["CROSSNODE_API_KEY"] = "sk-crossnode-..."
client = CrossnodeClient()

Core Resources

The SDK provides programmatic access to your Agents, Runs, and Tools.

1. Agents

Manage and run your AI agents.

# List agents
agents = client.agents.list(limit=10)

# Get specific agent
agent = client.agents.retrieve(agent_id="agt_123")

# Trigger an agent run
run = client.agents.run(agent_id="agt_123", input_data="Analyze the market trends.")

# Export an agent configuration
config = client.agents.export(agent_id="agt_123")

# View run history for an agent
history = client.agents.list_runs(agent_id="agt_123")

2. Runs

Access and control agent execution logs, chat workflows, and files.

# Check run status
status = client.runs.retrieve(run_id=run["id"])

# Stream agent logs in real-time (Server-Sent Events)
for event in client.runs.stream_logs(run_id=run["id"]):
    print(event)

# Upload a file to the sandbox for the agent to use
file_info = client.runs.upload_file(run_id=run["id"], file_path="dataset.csv")

# Continue a conversational agent session
response = client.runs.chat_continue(run_id=run["id"], input_text="What about Q3?")

# Pause and resume execution
client.runs.pause(run_id=run["id"])
client.runs.resume(run_id=run["id"])

# Human-In-The-Loop: List and approve pending runs
pending = client.runs.list_pending_approvals()
client.runs.approve(run_id=pending[0]["run_id"], decision="approved")

3. Tools

Register, list, and delete custom tools used by your agents.

from crossnode import tool

@tool
def get_customer_details(customer_id: int) -> dict:
    """
    Retrieves the details for a specific customer.

    :param customer_id: The unique identifier for the customer.
    """
    if customer_id == 123:
        return {"name": "Jane Doe", "plan": "premium"}
    return {"error": "Customer not found"}

# Register the Python function as a tool on Crossnode
registered_tool = client.tools.register(get_customer_details)

# List available tools
tools = client.tools.list()

# Retrieve or delete a tool
client.tools.retrieve(tool_id=registered_tool["id"])
client.tools.delete(tool_id=registered_tool["id"])

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

crossnode-0.2.0.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

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

crossnode-0.2.0-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file crossnode-0.2.0.tar.gz.

File metadata

  • Download URL: crossnode-0.2.0.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for crossnode-0.2.0.tar.gz
Algorithm Hash digest
SHA256 83ab139c716beba5dfc5ffa70041acb5023c958b01b9d80d13339322137ac86a
MD5 776bd6b8256c6e7b8b9c43976c3d502f
BLAKE2b-256 bb95e07ea41af10f010aa1ed375bac6cb6ac3fb8d5456c4baeb157da4d399dc4

See more details on using hashes here.

Provenance

The following attestation bundles were made for crossnode-0.2.0.tar.gz:

Publisher: publish-sdk.yml on crossnode-ai/crossnode-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file crossnode-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: crossnode-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for crossnode-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c0f78efc8dd477fc6464d2a4e71ac1934dd13014eb7b20db839d246f55d2b442
MD5 6c2c22fe0f5af19b50a83669c0ca8469
BLAKE2b-256 2498c29e7c11d7e9fe58e0d5be5dd8550513ed2b0e2f78cf142623c95fd725a5

See more details on using hashes here.

Provenance

The following attestation bundles were made for crossnode-0.2.0-py3-none-any.whl:

Publisher: publish-sdk.yml on crossnode-ai/crossnode-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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