Skip to content

999-Dev-Official/agentchat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

agentchat

A simple chat agent library for Node.js applications.

Installation

npm install agentchat

Usage

const AgentChat = require('agentchat');

// Create a new agent
const agent = new AgentChat({ name: 'MyAgent' });

// Send messages
agent.send('Hello, world!');
agent.send('How can I help you today?');

// Get all messages
const messages = agent.getMessages();
console.log(messages);

// Get message count
console.log(`Total messages: ${agent.getMessageCount()}`);

// Clear messages
agent.clear();

API

new AgentChat(options)

Creates a new AgentChat instance.

  • options.name (String): The name of the agent (default: 'Agent')

send(message)

Sends a message and returns the message object with timestamp.

getMessages()

Returns an array of all messages.

getMessageCount()

Returns the total number of messages.

clear()

Clears all messages.

License

ISC

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors