Skip to content
999-Dev-OfficialPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

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

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages