New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
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
  • Socket score

Version published
Maintainers
1
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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc