New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@loopstack/create-chat-message-tool

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@loopstack/create-chat-message-tool

A tool to create chat messages from in a workflow

latest
npmnpm
Version
0.21.1
Version published
Maintainers
1
Created
Source

@loopstack/create-chat-message-tool

A module for the Loopstack AI automation framework.

This module provides a tool for creating chat messages within workflows, enabling conversational interfaces and message-based interactions.

Overview

The Create Chat Message Tool enables workflows to generate chat messages programmatically. It supports creating single or multiple messages in one operation, making it ideal for building conversational workflows, chatbots, and interactive assistants.

By using this tool, you'll be able to:

  • Create single or multiple chat messages in one operation
  • Define message roles (user, assistant, system, etc.)
  • Build conversational workflows with proper message formatting
  • Display workflow responses in a chat-like interface
  • Integrate seamlessly with AI-powered chat workflows

This tool is essential for workflows that need to communicate with users through a conversational interface or build AI-powered assistants.

Installation

See SETUP.md for installation and setup instructions.

Usage

Inject the tool in your workflow class using the @InjectTool() decorator:

import { BaseWorkflow, Final, Initial, InjectTool, Transition, Workflow } from '@loopstack/common';
import { CreateChatMessage } from '@loopstack/create-chat-message-tool';

@Workflow({
  uiConfig: __dirname + '/my.ui.yaml',
})
export class MyWorkflow extends BaseWorkflow {
  @InjectTool() createChatMessage: CreateChatMessage;

  @Initial({ to: 'ready' })
  async sendWelcome() {
    // Create a single message
    await this.createChatMessage.call({
      role: 'assistant',
      content: "Hello! I'm your assistant. How can I help you today?",
    });
  }

  @Transition({ from: 'ready', to: 'waiting', wait: true })
  async userInput() {
    // Wait for user input
  }

  @Final({ from: 'waiting' })
  async sendResponse() {
    // Create multiple messages at once
    await this.createChatMessage.call([
      { role: 'assistant', content: 'Thanks for your message!' },
      { role: 'assistant', content: 'Here is your response.' },
    ]);
  }
}

About

Author: Jakob Klippel

License: Apache-2.0

Additional Resources:

Keywords

chat

FAQs

Package last updated on 09 Apr 2026

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