You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@agentlabs/node-sdk

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@agentlabs/node-sdk

An SDK to build AgentLabs AI agents

0.0.75
latest
npm
Version published
Weekly downloads
5
-93.06%
Maintainers
1
Weekly downloads
 
Created
Source

agentlabs node-sdk

A NodeJS SDK that can be used to control an AgentLabs managed AI agent.

Prerequisites

  • NodeJS >= v.18.0.0

Getting started

Here is a minimal example in which an agent is connected to AgentLabs and prepared to handle user messages.

import { Project } from "@agentlabs/node-sdk";

const project = new Project({
	projectId: "fff9fcad-07e0-418b-8037-a2dcc920220e",
	secret: '<PROJECT_SECRET>',
	agentlabsUrl: 'https://app.agentlabs.dev',
});

const agent = project.agent("4b55e242-a614-4c51-9193-12869e6070b3");

agent.onChatMessage((message) => {
    if (message.text === 'ping') {
        message.reply('pong')
    } else {
        message.reply("Sorry, I didn't get that.")
    }
});

agent.connect()

Connecting to a self hosted instance

Connecting to a self hosted instance is done the exact same way as connecting to the cloud version. All you need to do is to use the right agentlabsUrl while initializing the project.

const project = new Project({
	projectId: "fff9fcad-07e0-418b-8037-a2dcc920220e",
	secret: '<PROJECT_SECRET>',
	agentlabsUrl: '<SELF_HOSTED_INSTANCE_DOMAIN>',
});

FAQs

Package last updated on 01 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts