@minded-ai/mindedjs 3.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -242,10 +242,10 @@ const addPromptNode = async ({ graph, node, llm, tools, emit, agent }) => {
|
|
|
242
242
|
content: finalAIMessage.content,
|
|
243
243
|
sessionId: state.sessionId,
|
|
244
244
|
node: node.displayName,
|
|
245
|
-
|
|
245
|
+
sendAiMessage: node.sendAiMessage !== false,
|
|
246
246
|
});
|
|
247
|
-
// Only emit AI_MESSAGE if
|
|
248
|
-
if (node.
|
|
247
|
+
// Only emit AI_MESSAGE if sendAiMessage is not explicitly false
|
|
248
|
+
if (node.sendAiMessage !== false) {
|
|
249
249
|
await emit(AgentEvents_1.AgentEvents.AI_MESSAGE, {
|
|
250
250
|
message: finalAIMessage.content,
|
|
251
251
|
state: state,
|
|
@@ -123,7 +123,7 @@ export interface PromptNode extends BaseNode {
|
|
|
123
123
|
* When false, the AI response is processed internally without sending to the user.
|
|
124
124
|
* Default: true (AI message is sent to the user)
|
|
125
125
|
*/
|
|
126
|
-
|
|
126
|
+
sendAiMessage?: boolean;
|
|
127
127
|
}
|
|
128
128
|
export interface JumpToNode extends BaseNode {
|
|
129
129
|
type: NodeType.JUMP_TO_NODE;
|
|
@@ -77,12 +77,12 @@ Prompt nodes process input through LLM to generate intelligent responses or invo
|
|
|
77
77
|
- `humanInTheLoop?: boolean` - When `true`, pauses execution after this node for human input before continuing. Use this property only if you need to gather an input from the user. Usually combined with a `promptCondition` edge to allow for iterative processing over human input.
|
|
78
78
|
- `canStayOnNode?: boolean` - When `true`, allows the node to route back to itself for iterative processing. Usually combined with `humanInTheLoop: true` to allow for iteration over human input.
|
|
79
79
|
- `prompt: string` - The prompt to be sent to the LLM. The prompt is an instruction for what AI message to generate or a (scoped) tool to invoke. This is not general instruction for what the agent should do (e.g. "wait for x").
|
|
80
|
-
- `
|
|
80
|
+
- `sendAiMessage?: boolean` - When `false`, the AI response is processed internally without sending to the user. Default: `true`. Set to 'false' for internal calculations, reasoning, or decision-making logic that shouldn't be visible to users.
|
|
81
81
|
|
|
82
82
|
### Limitations
|
|
83
83
|
- Prompt nodes can not save information to memory directly. Rather the user & agent messages are stored in the messages array of the state object. Making user's input available to the next prompt nodes or tools in the form of input schema.
|
|
84
84
|
- Image recognition is only supported when a user attaches an image to the message. If you need to extract information from an image, use a tool with agent.llm to process the image. Return the result in the tool response so following prompt nodes can use it.
|
|
85
|
-
- By default, prompt nodes send a message to the user. Set `
|
|
85
|
+
- By default, prompt nodes send a message to the user. Set `sendAiMessage: false` if you want internal processing without user-facing output.
|
|
86
86
|
|
|
87
87
|
### Prompt examples
|
|
88
88
|
- "Draft a professional email to the merchant requesting verification of the dispute"
|
|
@@ -139,17 +139,17 @@ llmConfig:
|
|
|
139
139
|
|
|
140
140
|
### Internal Processing (No User Message)
|
|
141
141
|
|
|
142
|
-
To process logic internally without sending a message to the user, set `
|
|
142
|
+
To process logic internally without sending a message to the user, set `sendAiMessage: false`:
|
|
143
143
|
|
|
144
144
|
```yaml
|
|
145
145
|
- type: promptNode
|
|
146
146
|
name: calculate-refund-amount
|
|
147
147
|
displayName: Calculate Refund Amount
|
|
148
148
|
prompt: 'Based on the order details: {memory.orderItems}, calculate the appropriate refund amount.'
|
|
149
|
-
|
|
149
|
+
sendAiMessage: false
|
|
150
150
|
```
|
|
151
151
|
|
|
152
|
-
Use cases for `
|
|
152
|
+
Use cases for `sendAiMessage: false`:
|
|
153
153
|
- **Internal calculations and reasoning**: Determining refund amounts, calculating discounts, analyzing data
|
|
154
154
|
- **Decision-making logic**: Evaluating conditions before taking actions
|
|
155
155
|
- **Information extraction**: Processing and structuring data for subsequent nodes
|
package/package.json
CHANGED
|
@@ -294,11 +294,11 @@ export const addPromptNode = async ({ graph, node, llm, tools, emit, agent }: Ad
|
|
|
294
294
|
content: finalAIMessage.content,
|
|
295
295
|
sessionId: state.sessionId,
|
|
296
296
|
node: node.displayName,
|
|
297
|
-
|
|
297
|
+
sendAiMessage: node.sendAiMessage !== false,
|
|
298
298
|
});
|
|
299
299
|
|
|
300
|
-
// Only emit AI_MESSAGE if
|
|
301
|
-
if (node.
|
|
300
|
+
// Only emit AI_MESSAGE if sendAiMessage is not explicitly false
|
|
301
|
+
if (node.sendAiMessage !== false) {
|
|
302
302
|
await emit(AgentEvents.AI_MESSAGE, {
|
|
303
303
|
message: finalAIMessage.content as string,
|
|
304
304
|
state: state,
|
package/src/types/Flows.types.ts
CHANGED
|
@@ -138,7 +138,7 @@ export interface PromptNode extends BaseNode {
|
|
|
138
138
|
* When false, the AI response is processed internally without sending to the user.
|
|
139
139
|
* Default: true (AI message is sent to the user)
|
|
140
140
|
*/
|
|
141
|
-
|
|
141
|
+
sendAiMessage?: boolean;
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
export interface JumpToNode extends BaseNode {
|