Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

agent-protocol

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

agent-protocol

API for interacting with Agent

  • 0.1.0
  • unpublished
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
69
increased by2.99%
Maintainers
1
Weekly downloads
 
Created
Source

e2b e2b SDK

Developer-first platform for deploying, testing, and monitoring AI agents

Website | Discord | Twitter
Discord community server e2b Twitter

Development

This was developed with the following dependencies:

  • node v18.16.0
  • ts-node v10.9.1
  • prettier 3.0.0
  • pnpm 8.6.9

During development, you should be able to simply import the Agent from src/index.ts and run using ts-node.

Example

The minimal example is below. This creates a simple agent which performs no tasks itself, but does create the agent API.

import Agent from "@e2b/agent-sdk";
import { StepResult, StepHandler } from "@e2b/agent-sdk";

const taskHandler = async (taskInput: any | null): Promise<StepHandler> => {
  console.log(`task: ${taskInput}`);

  const stepHandler = async (stepInput: any | null): Promise<StepResult> => {
    console.log(`step: ${stepInput}`);
    return {
      output: stepInput,
    };
  };

  return stepHandler;
};

const agent = new Agent(taskHandler).start();

Run ts-node on the example above and you should see the following:

Agent listening at http://localhost:8000

You can then experiment with the SDK via CURL, as the examples below:

$ curl -X POST -H "Content-Type: application/json" -d '{ "input": "This is a test of the emergency broadcast system." }' http://localhost:8000/agent/tasks # Create a new Task for the agent
$ curl -X GET -H "Content-Type: application/json" http://localhost:8000/agent/tasks # Get tasks

Feel free to ask questions on our Discord, or sign up for the newsletter for updates!

FAQs

Package last updated on 21 Jul 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