@recombine-ai/engine 0.5.0 → 0.6.0
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.
- package/build/lib/ai.d.ts +19 -26
- package/build/lib/ai.d.ts.map +1 -1
- package/build/lib/ai.js +53 -46
- package/build/lib/bosun/agent.d.ts +1 -1
- package/build/lib/bosun/agent.d.ts.map +1 -1
- package/changelog.md +11 -0
- package/package.json +3 -3
package/build/lib/ai.d.ts
CHANGED
|
@@ -35,8 +35,10 @@ export declare namespace AIEngine {
|
|
|
35
35
|
* to this schema ensuring reliable structured output.
|
|
36
36
|
*/
|
|
37
37
|
json: boolean | ZodSchema;
|
|
38
|
-
/**
|
|
39
|
-
|
|
38
|
+
/**
|
|
39
|
+
* Do not put messages that were added via {@link Conversation.addMessage} into the prompt.
|
|
40
|
+
*/
|
|
41
|
+
ignoreAddedMessages?: boolean;
|
|
40
42
|
/**
|
|
41
43
|
* Additional data to be inserted into the prompt. Accessible via Nunjucks variables.
|
|
42
44
|
* @example
|
|
@@ -237,36 +239,26 @@ export declare namespace AIEngine {
|
|
|
237
239
|
*/
|
|
238
240
|
setAgentName(name: string): void;
|
|
239
241
|
/**
|
|
240
|
-
*
|
|
241
|
-
* @param
|
|
242
|
-
* @returns The string representation of the conversation.
|
|
242
|
+
* Sets the default formatter for stringifying messages when toString is called.
|
|
243
|
+
* @param formatter - A function that takes a message and returns a formatted string.
|
|
243
244
|
*/
|
|
244
|
-
|
|
245
|
+
setDefaultFormatter: (formatter: (message: Message) => string) => void;
|
|
245
246
|
/**
|
|
246
|
-
*
|
|
247
|
-
* @param
|
|
247
|
+
* Converts the conversation to a string representation to be fed to an LLM.
|
|
248
|
+
* @param filter - A function that filters messages based on certain criteria.
|
|
248
249
|
* @example
|
|
249
|
-
*
|
|
250
|
-
* // Add a directive to guide the LLM response
|
|
251
|
-
* conversation.addDirective("Ask the user for their preferred date and time for the reservation");
|
|
252
|
-
*
|
|
253
|
-
* // The resulting conversation string might look like:
|
|
254
|
-
* // User: I'd like to book a table at your restaurant.
|
|
255
|
-
* // System: Ask the user for their preferred date and time for the reservation
|
|
256
|
-
* ```
|
|
250
|
+
* @returns The string representation of the conversation.
|
|
257
251
|
*/
|
|
258
|
-
|
|
252
|
+
toString: (options?: {
|
|
253
|
+
ignoreAddedMessages?: boolean;
|
|
254
|
+
}) => string;
|
|
259
255
|
/**
|
|
260
256
|
* Adds a message from a specified sender to the conversation.
|
|
261
|
-
* @param
|
|
262
|
-
* @param message - The content of the message.
|
|
263
|
-
*/
|
|
264
|
-
addMessage: (name: Message['sender'], message: string) => void;
|
|
265
|
-
/**
|
|
266
|
-
* Sets a custom formatter for directive messages.
|
|
267
|
-
* @param formatter - A function that takes a Message and returns a formatted string.
|
|
257
|
+
* @param message - The message to add to the conversation.
|
|
268
258
|
*/
|
|
269
|
-
|
|
259
|
+
addMessage: (message: Message, opts?: {
|
|
260
|
+
formatter?: (message: Message) => string;
|
|
261
|
+
}) => void;
|
|
270
262
|
/**
|
|
271
263
|
* Sets a custom formatter for proposed messages.
|
|
272
264
|
* @param formatter - A function that takes a message string and returns a formatted string.
|
|
@@ -284,6 +276,7 @@ export declare namespace AIEngine {
|
|
|
284
276
|
getProposedReply: () => string | null;
|
|
285
277
|
/**
|
|
286
278
|
* Gets the history of all messages in the conversation.
|
|
279
|
+
* Returns {@link Message} rather than {@link ConversationMessage} because none of the {@link ConversationMessage} properties should be accessed outside of the {@link Conversation} context.
|
|
287
280
|
* @returns An array of Message objects representing the conversation history.
|
|
288
281
|
*/
|
|
289
282
|
getHistory: () => Message[];
|
|
@@ -299,7 +292,6 @@ export declare namespace AIEngine {
|
|
|
299
292
|
text: string;
|
|
300
293
|
/** Optional URL of an image associated with the message */
|
|
301
294
|
imageUrl?: string;
|
|
302
|
-
formatter?: (message: Message) => string;
|
|
303
295
|
}
|
|
304
296
|
export interface File {
|
|
305
297
|
content: () => Promise<string>;
|
|
@@ -357,6 +349,7 @@ export declare namespace AIEngine {
|
|
|
357
349
|
*/
|
|
358
350
|
export function createAIEngine(cfg?: EngineConfig): AIEngine;
|
|
359
351
|
function renderPrompt(prompt: string, context?: Record<string, unknown>): string;
|
|
352
|
+
export function createConversation(initialMessages?: Message[]): Conversation;
|
|
360
353
|
export {};
|
|
361
354
|
}
|
|
362
355
|
//# sourceMappingURL=ai.d.ts.map
|
package/build/lib/ai.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai.d.ts","sourceRoot":"","sources":["../../src/lib/ai.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AAE/B,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAc,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAGvD,yBAAiB,QAAQ,CAAC;IACtB;;OAEG;IACH,MAAM,MAAM,UAAU,GAChB,oBAAoB,GACpB,uBAAuB,GACvB,mBAAmB,GACnB,eAAe,GACf,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;IAEnB,MAAM,WAAW,gBAAgB;QAC7B,8BAA8B;QAC9B,IAAI,EAAE,MAAM,CAAA;QAEZ,kDAAkD;QAClD,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE,YAAY,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;QAE9D,0BAA0B;QAC1B,OAAO,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAA;QAE/B,6EAA6E;QAC7E,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;KAC/C;IAED,MAAM,WAAW,OAAO;QACpB,8BAA8B;QAC9B,IAAI,EAAE,MAAM,CAAA;QAEZ,kDAAkD;QAClD,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE,YAAY,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;QAE9D,qCAAqC;QACrC,K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,6 @@ var AIEngine;
|
|
|
54
54
|
function createStep(step) {
|
|
55
55
|
return step;
|
|
56
56
|
}
|
|
57
|
-
function getConversation(messages = []) {
|
|
58
|
-
let defaultDirectivesFormatter = (message) => `${message.sender}: ${message.text}`;
|
|
59
|
-
let proposedFormatter = (message) => `Proposed reply: ${message}`;
|
|
60
|
-
let proposedReply = null;
|
|
61
|
-
const names = {
|
|
62
|
-
agent: 'Agent',
|
|
63
|
-
user: 'User',
|
|
64
|
-
system: 'System',
|
|
65
|
-
};
|
|
66
|
-
return {
|
|
67
|
-
toString: (ignoreDirectives = false) => messages
|
|
68
|
-
.map((msg) => {
|
|
69
|
-
if (msg.sender === 'system') {
|
|
70
|
-
logger.debug('formatter', msg.formatter);
|
|
71
|
-
return ignoreDirectives ? null : (msg.formatter ? msg.formatter(msg) : defaultDirectivesFormatter(msg));
|
|
72
|
-
}
|
|
73
|
-
return `${names[msg.sender]}: ${msg.text}`;
|
|
74
|
-
})
|
|
75
|
-
.filter((msg) => msg !== null)
|
|
76
|
-
.join('\n') +
|
|
77
|
-
(proposedReply ? `\n${proposedFormatter(proposedReply)}` : ''),
|
|
78
|
-
addMessage: (sender, text) => messages.push({ sender, text }),
|
|
79
|
-
addDirective: (message, formatter) => {
|
|
80
|
-
logger.debug(`AI Engine: add directive: ${message}`);
|
|
81
|
-
messages.push({ sender: 'system', text: message, formatter });
|
|
82
|
-
},
|
|
83
|
-
setDefaultDirectiveFormatter: (formatter) => {
|
|
84
|
-
defaultDirectivesFormatter = formatter;
|
|
85
|
-
},
|
|
86
|
-
setProposedMessageFormatter: (formatter) => {
|
|
87
|
-
proposedFormatter = formatter;
|
|
88
|
-
},
|
|
89
|
-
setProposedReply: (message) => (proposedReply = message),
|
|
90
|
-
getProposedReply: () => proposedReply,
|
|
91
|
-
getHistory: () => messages,
|
|
92
|
-
setUserName: (name) => {
|
|
93
|
-
names.user = name;
|
|
94
|
-
},
|
|
95
|
-
setAgentName: (name) => {
|
|
96
|
-
names.agent = name;
|
|
97
|
-
},
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
57
|
async function createWorkflow(...steps) {
|
|
101
58
|
const apiKey = await tokenStorage.getToken();
|
|
102
59
|
let shouldRun = true;
|
|
@@ -165,10 +122,10 @@ var AIEngine;
|
|
|
165
122
|
let prompt = typeof step.prompt === 'string' ? step.prompt : await step.prompt.content();
|
|
166
123
|
stepTrace.receivedPrompt = prompt;
|
|
167
124
|
logger.debug('AI Engine: context', step.context);
|
|
168
|
-
logger.debug('AI Engine: messages', messages.toString(step.
|
|
125
|
+
logger.debug('AI Engine: messages', messages.toString({ ignoreAddedMessages: step.ignoreAddedMessages }));
|
|
169
126
|
prompt = renderPrompt(prompt, step.context);
|
|
170
127
|
stepTrace.renderedPrompt = prompt;
|
|
171
|
-
const stringifiedMessages = messages.toString(step.
|
|
128
|
+
const stringifiedMessages = messages.toString({ ignoreAddedMessages: step.ignoreAddedMessages });
|
|
172
129
|
stepTrace.stringifiedConversation = stringifiedMessages;
|
|
173
130
|
response = await runLLM(apiKey, prompt, stringifiedMessages, step.json, step.model);
|
|
174
131
|
if (!response) {
|
|
@@ -264,7 +221,7 @@ var AIEngine;
|
|
|
264
221
|
createWorkflow: createWorkflow,
|
|
265
222
|
createStep,
|
|
266
223
|
loadFile,
|
|
267
|
-
createConversation
|
|
224
|
+
createConversation,
|
|
268
225
|
renderPrompt
|
|
269
226
|
};
|
|
270
227
|
}
|
|
@@ -307,4 +264,54 @@ var AIEngine;
|
|
|
307
264
|
});
|
|
308
265
|
return nunjucks_1.default.renderString(prompt, context || {});
|
|
309
266
|
}
|
|
267
|
+
function createConversation(initialMessages = []) {
|
|
268
|
+
const messages = initialMessages.map((msg) => ({
|
|
269
|
+
...msg,
|
|
270
|
+
isAddedMessage: false,
|
|
271
|
+
formatter: undefined
|
|
272
|
+
}));
|
|
273
|
+
const names = {
|
|
274
|
+
agent: 'Agent',
|
|
275
|
+
user: 'User',
|
|
276
|
+
system: 'System',
|
|
277
|
+
};
|
|
278
|
+
let defaultFormatter = (message) => `${names[message.sender]}: ${message.text}`;
|
|
279
|
+
let proposedFormatter = (message) => `Proposed reply: ${message}`;
|
|
280
|
+
let proposedReply = null;
|
|
281
|
+
return {
|
|
282
|
+
toString: (options) => {
|
|
283
|
+
return messages
|
|
284
|
+
.filter((msg) => !options?.ignoreAddedMessages || !msg.isAddedMessage)
|
|
285
|
+
.map((msg) => {
|
|
286
|
+
return msg.formatter ? msg.formatter(msg) : defaultFormatter(msg);
|
|
287
|
+
})
|
|
288
|
+
.filter((msg) => msg !== null)
|
|
289
|
+
.join('\n') +
|
|
290
|
+
(proposedReply ? `\n${proposedFormatter(proposedReply)}` : '');
|
|
291
|
+
},
|
|
292
|
+
addMessage: (message, opts) => {
|
|
293
|
+
messages.push({
|
|
294
|
+
...message,
|
|
295
|
+
isAddedMessage: true,
|
|
296
|
+
formatter: opts?.formatter ?? defaultFormatter,
|
|
297
|
+
});
|
|
298
|
+
},
|
|
299
|
+
setDefaultFormatter: (formatter) => {
|
|
300
|
+
defaultFormatter = formatter;
|
|
301
|
+
},
|
|
302
|
+
setProposedMessageFormatter: (formatter) => {
|
|
303
|
+
proposedFormatter = formatter;
|
|
304
|
+
},
|
|
305
|
+
setProposedReply: (message) => (proposedReply = message),
|
|
306
|
+
getProposedReply: () => proposedReply,
|
|
307
|
+
getHistory: () => messages,
|
|
308
|
+
setUserName: (name) => {
|
|
309
|
+
names.user = name;
|
|
310
|
+
},
|
|
311
|
+
setAgentName: (name) => {
|
|
312
|
+
names.agent = name;
|
|
313
|
+
}
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
AIEngine.createConversation = createConversation;
|
|
310
317
|
})(AIEngine || (exports.AIEngine = AIEngine = {}));
|
|
@@ -28,7 +28,7 @@ export declare namespace Bosun {
|
|
|
28
28
|
scheduler: Scheduler.Scheduler;
|
|
29
29
|
ai: AIEngine.AIEngine;
|
|
30
30
|
getMessages: () => AIEngine.Message[];
|
|
31
|
-
sendMessage: (message: string) => Promise<void>;
|
|
31
|
+
sendMessage: (message: string | AIEngine.Message) => Promise<void>;
|
|
32
32
|
sendAction: SendAction;
|
|
33
33
|
ctx: Context<CTX>;
|
|
34
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../src/lib/bosun/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC;;;;;;;;;;;;;;;;;;GAkBG;AACH,yBAAiB,KAAK,CAAA;IAClB,KAAK,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACzC,MAAM,WAAW,oBAAoB,CAAC,GAAG,SAAS,cAAc,GAAG,cAAc;QAC7E,MAAM,EAAE,MAAM,CAAA;QACd,SAAS,EAAE,SAAS,CAAC,SAAS,CAAA;QAC9B,EAAE,EAAE,QAAQ,CAAC,QAAQ,CAAA;QACrB,WAAW,EAAE,MAAM,QAAQ,CAAC,OAAO,EAAE,CAAA;QACrC,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../src/lib/bosun/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC;;;;;;;;;;;;;;;;;;GAkBG;AACH,yBAAiB,KAAK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
7
|
+
- addDirective is removed. Use addMessage with role: 'system' instead.
|
|
8
|
+
- ignoreDirectives → ignoreAddedMessages
|
|
9
|
+
|
|
10
|
+
Other changes:
|
|
11
|
+
|
|
12
|
+
- AIEngine.sendMessage now accepts "Message" rather than a string
|
|
13
|
+
|
|
3
14
|
### 0.4.0 → 0.5.0 (unstable)
|
|
4
15
|
|
|
5
16
|
Breaking changes:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@recombine-ai/engine",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Recombine AI engine for creating conversational AI agents",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
"@types/node": "^22.8.1",
|
|
19
19
|
"@types/nunjucks": "^3.2.6",
|
|
20
20
|
"prettier": "^3.3.3",
|
|
21
|
-
"typescript": "^5.
|
|
21
|
+
"typescript": "^5.8.3",
|
|
22
22
|
"vitest": "^3.0.6"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"nunjucks": "^3.2.4",
|
|
26
26
|
"openai": "^4.68.4",
|
|
27
27
|
"zod": "3.23.8",
|
|
28
|
-
"zod-to-json-schema": "^3.
|
|
28
|
+
"zod-to-json-schema": "^3.24.6"
|
|
29
29
|
}
|
|
30
30
|
}
|