Introduction
Welcome to the SwarmNode Python SDK! The SDK provides a simple interface to interact with the SwarmNode REST API.
Usage
You can install the SDK via pip
:
pip install swarmnode
Once installed, you can use it to make requests:
import swarmnode
swarmnode.api_key = "YOUR_API_KEY"
agent = swarmnode.Agent.retrieve(id="15d19ca3-26f1-4adb-9cea-3955b73d9b4e")
execution = agent.execute()
Resources
The sections below provide a basic overview of the SDK's resources and their relationships.
AgentBuilderJob
A AgentBuilderJob
is automatically created every time an Agent
is created or if an Agent
's python_version
or requirements
attribute is updated. AgentBuilderJob
produces a Build
.
AgentBuilderJob
and Build
can't be created manually. They are created automatically by SwarmNode. You can simply list and retrieve them for information purposes.
AgentExecutorJob
You can create a AgentExecutorJob
to execute an Agent
once. AgentExecutorJob
produces an Execution
. AgentExecutorJob
is created every time you execute an Agent
from the UI on https://app.swarmnode.ai or when you invoke the execute
method on an Agent
object.
Agent
Agent
can be executed via AgentExecutorJob
.
Build
Created by AgentBuilderJob
. Signifies a single build of an Agent
. An agent can be rebuilt unlimited times.
Execution
Created by AgentExecutorJob
. Signifies a single execution of an Agent
.