Using USDK programmatically
Use the Upstreet Agents SDK as a library in your code.
While the Upstreet Agents SDK (USDK) is designed as a command-line interface (CLI) for building, managing, and deploying Upstreet AI Agents, you can also import USDK as a module in your code to access its powerful functionalities programmatically.
Using USDK programmatically gives you more control over the deployment and management of your agents. You can integrate it into your own workflows, automate tasks, or build more complex applications on top of Upstreet's platform. It also eliminates the need for shell execution, providing a clean and efficient way to interact with USDK features directly from your code.
Installation
To use it as a module in your Node.js application, install USDK locally in your project:
Import
You can then import USDK into your Node.js scripts:
Usage
Once imported, you can interact with USDK's commands as JavaScript functions. Here's a basic example of how you can use USDK programmatically:
Example: Log In
Example: Create an Agent
Example: Deploy an Agent
Key Functions Available
Here's a quick overview of the core functions you can use programmatically with USDK:
usdk.login()
: Logs in to the USDK.usdk.logout()
: Logs out from USDK.usdk.create(options)
: Creates a new agent.usdk.edit(directory, options)
: Edits an existing agent.usdk.deploy(agentIds)
: Deploys an agent to the network.usdk.rm(agentIds)
: Removes a deployed agent.usdk.pull(agentId, options)
: Pulls the source code of a deployed agent.usdk.status()
: Retrieves the current login status and account details.usdk.chat(agentIds, options)
: Starts a multi-agent chat session.