
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
@loopstack/ai-module
Advanced tools
A collection of useful tools for performing AI actions using model provider APIs such as OpenAI and Anthropic
A module for the Loopstack AI automation framework.
This module provides tools for integrating Large Language Models (LLMs) into your workflows, with support for OpenAI and Anthropic providers.
The AI Module enables workflows to leverage LLM capabilities for text generation, structured object generation, and agentic tool calling patterns. It abstracts provider-specific implementations behind a unified interface.
By using this module, you'll be able to:
This module is essential for workflows that need natural language processing, content generation, or AI-driven decision making.
See SETUP.md for installation and setup instructions.
Inject the tools and documents in your workflow class:
import {
AiGenerateDocument,
AiGenerateObject,
AiGenerateText,
AiMessageDocument,
DelegateToolCall,
} from '@loopstack/ai-module';
import { BlockConfig, DefineHelper, InjectDocument, InjectTool, Workflow } from '@loopstack/common';
@Workflow({
configFile: __dirname + '/my.workflow.yaml',
})
export class MyWorkflow {
// Tools
@InjectTool() aiGenerateText: AiGenerateText;
@InjectTool() aiGenerateObject: AiGenerateObject;
@InjectTool() aiGenerateDocument: AiGenerateDocument;
@InjectTool() delegateToolCall: DelegateToolCall;
// Documents
@InjectDocument() aiMessageDocument: AiMessageDocument;
}
Generates text using an LLM with optional tool calling support.
| Argument | Type | Required | Description |
|---|---|---|---|
llm.provider | string | No | Provider name (openai or anthropic) |
llm.model | string | No | Model identifier (e.g., gpt-4o, claude-3-sonnet) |
llm.envApiKey | string | No | Environment variable name for API key |
prompt | string | No | Simple text prompt |
messages | array | No | Array of message objects with role and content |
messagesSearchTag | string | No | Tag to search for messages in workflow documents |
tools | string[] | No | Array of tool names to make available to the LLM |
- tool: aiGenerateText
args:
llm:
provider: openai
model: gpt-4o
messagesSearchTag: message
tools:
- getWeather
assign:
llmResponse: ${ result.data }
Generates a structured object using an LLM that conforms to a document schema.
| Argument | Type | Required | Description |
|---|---|---|---|
llm.provider | string | No | Provider name |
llm.model | string | No | Model identifier |
prompt | string | No | Simple text prompt |
messages | array | No | Array of message objects |
messagesSearchTag | string | No | Tag to search for messages |
response.document | string | Yes | Document name whose schema defines the output structure |
response.id | string | No | Custom ID for the generated object |
- tool: aiGenerateObject
args:
llm:
provider: anthropic
model: claude-3-sonnet
prompt: 'Extract the key information from this text: {{ inputText }}'
response:
document: infoDocument
assign:
entities: ${ result.data }
Combines AiGenerateObject and CreateDocument into a single operation. Generates a structured object and immediately creates it as a document.
Same as AiGenerateObject. The generated object is automatically created as a document using the specified document type.
- tool: aiGenerateDocument
args:
llm:
provider: openai
model: gpt-4o
messagesSearchTag: message
response:
document: summaryDocument
Executes tool calls requested by the LLM and returns the results in the expected format.
| Argument | Type | Required | Description |
|---|---|---|---|
message | object | Yes | The LLM response message containing tool call parts |
message.id | string | Yes | Message identifier |
message.parts | array | Yes | Array of tool call parts with type, input, and toolCallId |
document | string | No | Document name to auto-create with tool results (e.g. aiMessageDocument) |
skipResponseMessage | boolean | No | When true, skip automatic document creation even if document is set |
- tool: delegateToolCall
args:
message: ${ llmResponse }
document: aiMessageDocument
assign:
toolCallResult: ${ result.data }
Represents an AI conversation message with support for multi-part content (text, tool calls, tool results).
Schema:
{
id?: string; // Message identifier
role: 'system' | 'user' | 'assistant'; // Message role
metadata?: any; // Optional metadata
parts: any[]; // Message content parts
}
Example:
- tool: createDocument
args:
document: aiMessageDocument
update:
content:
role: user
parts:
- type: text
text: How is the weather in Berlin?
Author: Jakob Klippel
License: Apache-2.0
@loopstack/ai-module in the Loopstack RegistryFAQs
A collection of useful tools for performing AI actions using model provider APIs such as OpenAI and Anthropic
We found that @loopstack/ai-module demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.