@loopstack/ai-module 0.15.1 → 0.16.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/dist/schemas/ai-generate-tool-base.schema.d.ts +28 -28
- package/dist/services/ai-provider-model-helper.service.d.ts +1 -1
- package/dist/services/ai-provider-model-helper.service.js +4 -4
- package/dist/services/ai-provider-model-helper.service.js.map +1 -1
- package/dist/tools/ai-generate-document.tool.d.ts +4 -4
- package/dist/tools/ai-generate-document.tool.js +9 -2
- package/dist/tools/ai-generate-document.tool.js.map +1 -1
- package/dist/tools/ai-generate-object.tool.d.ts +40 -40
- package/dist/tools/ai-generate-object.tool.js +4 -2
- package/dist/tools/ai-generate-object.tool.js.map +1 -1
- package/dist/tools/ai-generate-text.tool.d.ts +30 -30
- package/dist/tools/ai-generate-text.tool.js +7 -10
- package/dist/tools/ai-generate-text.tool.js.map +1 -1
- package/dist/tools/delegate-tool-call.tool.d.ts +46 -3
- package/dist/tools/delegate-tool-call.tool.js +11 -1
- package/dist/tools/delegate-tool-call.tool.js.map +1 -1
- package/package.json +4 -5
|
@@ -6,52 +6,52 @@ export declare const AiGenerateToolBaseSchema: z.ZodObject<{
|
|
|
6
6
|
envApiKey: z.ZodOptional<z.ZodString>;
|
|
7
7
|
cacheResponse: z.ZodOptional<z.ZodBoolean>;
|
|
8
8
|
}, "strip", z.ZodTypeAny, {
|
|
9
|
-
model?: string;
|
|
10
|
-
provider?: string;
|
|
11
|
-
envApiKey?: string;
|
|
12
|
-
cacheResponse?: boolean;
|
|
9
|
+
model?: string | undefined;
|
|
10
|
+
provider?: string | undefined;
|
|
11
|
+
envApiKey?: string | undefined;
|
|
12
|
+
cacheResponse?: boolean | undefined;
|
|
13
13
|
}, {
|
|
14
|
-
model?: string;
|
|
15
|
-
provider?: string;
|
|
16
|
-
envApiKey?: string;
|
|
17
|
-
cacheResponse?: boolean;
|
|
14
|
+
model?: string | undefined;
|
|
15
|
+
provider?: string | undefined;
|
|
16
|
+
envApiKey?: string | undefined;
|
|
17
|
+
cacheResponse?: boolean | undefined;
|
|
18
18
|
}>>;
|
|
19
19
|
messages: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
20
20
|
role: z.ZodEnum<["system", "assistant", "user", "tool"]>;
|
|
21
21
|
content: z.ZodAny;
|
|
22
22
|
}, "strip", z.ZodTypeAny, {
|
|
23
|
-
role
|
|
23
|
+
role: "system" | "assistant" | "user" | "tool";
|
|
24
24
|
content?: any;
|
|
25
25
|
}, {
|
|
26
|
-
role
|
|
26
|
+
role: "system" | "assistant" | "user" | "tool";
|
|
27
27
|
content?: any;
|
|
28
28
|
}>, "many">>;
|
|
29
29
|
prompt: z.ZodOptional<z.ZodString>;
|
|
30
30
|
messagesSearchTag: z.ZodOptional<z.ZodString>;
|
|
31
31
|
}, "strip", z.ZodTypeAny, {
|
|
32
32
|
llm?: {
|
|
33
|
-
model?: string;
|
|
34
|
-
provider?: string;
|
|
35
|
-
envApiKey?: string;
|
|
36
|
-
cacheResponse?: boolean;
|
|
37
|
-
};
|
|
33
|
+
model?: string | undefined;
|
|
34
|
+
provider?: string | undefined;
|
|
35
|
+
envApiKey?: string | undefined;
|
|
36
|
+
cacheResponse?: boolean | undefined;
|
|
37
|
+
} | undefined;
|
|
38
38
|
messages?: {
|
|
39
|
-
role
|
|
39
|
+
role: "system" | "assistant" | "user" | "tool";
|
|
40
40
|
content?: any;
|
|
41
|
-
}[];
|
|
42
|
-
prompt?: string;
|
|
43
|
-
messagesSearchTag?: string;
|
|
41
|
+
}[] | undefined;
|
|
42
|
+
prompt?: string | undefined;
|
|
43
|
+
messagesSearchTag?: string | undefined;
|
|
44
44
|
}, {
|
|
45
45
|
llm?: {
|
|
46
|
-
model?: string;
|
|
47
|
-
provider?: string;
|
|
48
|
-
envApiKey?: string;
|
|
49
|
-
cacheResponse?: boolean;
|
|
50
|
-
};
|
|
46
|
+
model?: string | undefined;
|
|
47
|
+
provider?: string | undefined;
|
|
48
|
+
envApiKey?: string | undefined;
|
|
49
|
+
cacheResponse?: boolean | undefined;
|
|
50
|
+
} | undefined;
|
|
51
51
|
messages?: {
|
|
52
|
-
role
|
|
52
|
+
role: "system" | "assistant" | "user" | "tool";
|
|
53
53
|
content?: any;
|
|
54
|
-
}[];
|
|
55
|
-
prompt?: string;
|
|
56
|
-
messagesSearchTag?: string;
|
|
54
|
+
}[] | undefined;
|
|
55
|
+
prompt?: string | undefined;
|
|
56
|
+
messagesSearchTag?: string | undefined;
|
|
57
57
|
}>;
|
|
@@ -27,7 +27,7 @@ let AiProviderModelHelperService = class AiProviderModelHelperService {
|
|
|
27
27
|
}
|
|
28
28
|
getModel(modelName) {
|
|
29
29
|
const model = modelName ?? process.env['DEFAULT_MODEL'];
|
|
30
|
-
if (!
|
|
30
|
+
if (!model) {
|
|
31
31
|
throw new Error(`No Model defined. Please provide DEFAULT_MODEL or set the model parameter in the completion service call.`);
|
|
32
32
|
}
|
|
33
33
|
return model;
|
|
@@ -40,9 +40,9 @@ let AiProviderModelHelperService = class AiProviderModelHelperService {
|
|
|
40
40
|
return provider;
|
|
41
41
|
}
|
|
42
42
|
getProviderModel(config) {
|
|
43
|
-
const modelName = this.getModel(config
|
|
44
|
-
const providerName = this.getProvider(config
|
|
45
|
-
const apiKey = this.getApiKey(config
|
|
43
|
+
const modelName = this.getModel(config?.model);
|
|
44
|
+
const providerName = this.getProvider(config?.provider);
|
|
45
|
+
const apiKey = this.getApiKey(config?.envApiKey, providerName);
|
|
46
46
|
return this.aiProviderRegistry.createModel(providerName, {
|
|
47
47
|
apiKey: apiKey,
|
|
48
48
|
model: modelName,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-provider-model-helper.service.js","sourceRoot":"","sources":["../../src/services/ai-provider-model-helper.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,iFAA2E;AAUpE,IAAM,4BAA4B,GAAlC,MAAM,4BAA4B;IACV;IAA7B,YAA6B,kBAA6C;QAA7C,uBAAkB,GAAlB,kBAAkB,CAA2B;IAAG,CAAC;IAEtE,SAAS,CACf,SAA6B,EAC7B,YAAoB;QAEpB,MAAM,UAAU,GAAG,GAAG,YAAY,CAAC,WAAW,EAAE,UAAU,CAAC;QAC3D,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QAE5E,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CACb,kDAAkD,SAAS,IAAI,UAAU,sBAAsB,CAChG,CAAC;QACJ,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAEO,QAAQ,CAAC,SAA6B;QAC5C,MAAM,KAAK,GAAG,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;QAExD,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"ai-provider-model-helper.service.js","sourceRoot":"","sources":["../../src/services/ai-provider-model-helper.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,iFAA2E;AAUpE,IAAM,4BAA4B,GAAlC,MAAM,4BAA4B;IACV;IAA7B,YAA6B,kBAA6C;QAA7C,uBAAkB,GAAlB,kBAAkB,CAA2B;IAAG,CAAC;IAEtE,SAAS,CACf,SAA6B,EAC7B,YAAoB;QAEpB,MAAM,UAAU,GAAG,GAAG,YAAY,CAAC,WAAW,EAAE,UAAU,CAAC;QAC3D,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QAE5E,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CACb,kDAAkD,SAAS,IAAI,UAAU,sBAAsB,CAChG,CAAC;QACJ,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAEO,QAAQ,CAAC,SAA6B;QAC5C,MAAM,KAAK,GAAG,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;QAExD,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,MAAM,IAAI,KAAK,CACb,2GAA2G,CAC5G,CAAC;QACJ,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;IAEO,WAAW,CAAC,IAAwB;QAC1C,MAAM,QAAQ,GAAG,IAAI,IAAI,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;QAEzD,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CACb,oHAAoH,CACrH,CAAC;QACJ,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,gBAAgB,CAAC,MAA8B;QAC7C,MAAM,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QAC/C,MAAM,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QACxD,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;QAE/D,OAAO,IAAI,CAAC,kBAAkB,CAAC,WAAW,CAAC,YAAY,EAAE;YACvD,MAAM,EAAE,MAAM;YACd,KAAK,EAAE,SAAS;SACjB,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AArDY,oEAA4B;uCAA5B,4BAA4B;IADxC,IAAA,mBAAU,GAAE;qCAEsC,wDAAyB;GAD/D,4BAA4B,CAqDxC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ToolResult } from '@loopstack/common';
|
|
2
2
|
import { Block, ToolBase } from '@loopstack/core';
|
|
3
|
-
import {
|
|
3
|
+
import { AiGenerateObjectArgsType } from './ai-generate-object.tool';
|
|
4
4
|
import { WorkflowExecution } from '@loopstack/core/dist/workflow-processor/interfaces/workflow-execution.interface';
|
|
5
|
-
import { CreateDocument } from '@loopstack/core-ui-module';
|
|
6
5
|
export declare class AiGenerateDocument extends ToolBase<AiGenerateObjectArgsType> {
|
|
7
|
-
aiGenerateObject
|
|
8
|
-
createDocument
|
|
6
|
+
private aiGenerateObject;
|
|
7
|
+
private createDocument;
|
|
8
|
+
private getRequiredTool;
|
|
9
9
|
execute(args: AiGenerateObjectArgsType, ctx: WorkflowExecution, parent: Block): Promise<ToolResult>;
|
|
10
10
|
}
|
|
@@ -18,9 +18,16 @@ const core_ui_module_1 = require("@loopstack/core-ui-module");
|
|
|
18
18
|
let AiGenerateDocument = class AiGenerateDocument extends core_1.ToolBase {
|
|
19
19
|
aiGenerateObject;
|
|
20
20
|
createDocument;
|
|
21
|
+
getRequiredTool(name) {
|
|
22
|
+
const tool = this.getTool(name);
|
|
23
|
+
if (tool === undefined) {
|
|
24
|
+
throw new Error(`Tool "${name}" is not available`);
|
|
25
|
+
}
|
|
26
|
+
return tool;
|
|
27
|
+
}
|
|
21
28
|
async execute(args, ctx, parent) {
|
|
22
|
-
const result = await this.
|
|
23
|
-
return this.
|
|
29
|
+
const result = await this.getRequiredTool('aiGenerateObject').execute(args, ctx, parent);
|
|
30
|
+
return this.getRequiredTool('createDocument').execute({
|
|
24
31
|
id: args.response.id,
|
|
25
32
|
document: args.response.document,
|
|
26
33
|
update: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-generate-document.tool.js","sourceRoot":"","sources":["../../src/tools/ai-generate-document.tool.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"ai-generate-document.tool.js","sourceRoot":"","sources":["../../src/tools/ai-generate-document.tool.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAoD;AACpD,8CAK2B;AAC3B,0CAAkD;AAClD,uEAImC;AAEnC,8DAA2D;AAUpD,IAAM,kBAAkB,GAAx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.ZodBoolean>;
|
|
13
13
|
}, "strip", z.ZodTypeAny, {
|
|
14
|
-
model?: string;
|
|
15
|
-
provider?: string;
|
|
16
|
-
envApiKey?: string;
|
|
17
|
-
cacheResponse?: boolean;
|
|
14
|
+
model?: string | undefined;
|
|
15
|
+
provider?: string | undefined;
|
|
16
|
+
envApiKey?: string | undefined;
|
|
17
|
+
cacheResponse?: boolean | undefined;
|
|
18
18
|
}, {
|
|
19
|
-
model?: string;
|
|
20
|
-
provider?: string;
|
|
21
|
-
envApiKey?: string;
|
|
22
|
-
cacheResponse?: boolean;
|
|
19
|
+
model?: string | undefined;
|
|
20
|
+
provider?: string | undefined;
|
|
21
|
+
envApiKey?: string | undefined;
|
|
22
|
+
cacheResponse?: boolean | undefined;
|
|
23
23
|
}>>;
|
|
24
24
|
messages: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
25
25
|
role: z.ZodEnum<["system", "assistant", "user", "tool"]>;
|
|
26
26
|
content: z.ZodAny;
|
|
27
27
|
}, "strip", z.ZodTypeAny, {
|
|
28
|
-
role
|
|
28
|
+
role: "system" | "assistant" | "user" | "tool";
|
|
29
29
|
content?: any;
|
|
30
30
|
}, {
|
|
31
|
-
role
|
|
31
|
+
role: "system" | "assistant" | "user" | "tool";
|
|
32
32
|
content?: any;
|
|
33
33
|
}>, "many">>;
|
|
34
34
|
prompt: z.ZodOptional<z.ZodString>;
|
|
@@ -38,46 +38,46 @@ export declare const AiGenerateObjectSchema: z.ZodObject<{
|
|
|
38
38
|
id: z.ZodOptional<z.ZodString>;
|
|
39
39
|
document: z.ZodString;
|
|
40
40
|
}, "strip", z.ZodTypeAny, {
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
document: string;
|
|
42
|
+
id?: string | undefined;
|
|
43
43
|
}, {
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
document: string;
|
|
45
|
+
id?: string | undefined;
|
|
46
46
|
}>;
|
|
47
47
|
}, "strict", z.ZodTypeAny, {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
envApiKey?: string;
|
|
52
|
-
cacheResponse?: boolean;
|
|
48
|
+
response: {
|
|
49
|
+
document: string;
|
|
50
|
+
id?: string | undefined;
|
|
53
51
|
};
|
|
52
|
+
llm?: {
|
|
53
|
+
model?: string | undefined;
|
|
54
|
+
provider?: string | undefined;
|
|
55
|
+
envApiKey?: string | undefined;
|
|
56
|
+
cacheResponse?: boolean | undefined;
|
|
57
|
+
} | undefined;
|
|
54
58
|
messages?: {
|
|
55
|
-
role
|
|
59
|
+
role: "system" | "assistant" | "user" | "tool";
|
|
56
60
|
content?: any;
|
|
57
|
-
}[];
|
|
58
|
-
prompt?: string;
|
|
59
|
-
messagesSearchTag?: string;
|
|
60
|
-
response?: {
|
|
61
|
-
id?: string;
|
|
62
|
-
document?: string;
|
|
63
|
-
};
|
|
61
|
+
}[] | undefined;
|
|
62
|
+
prompt?: string | undefined;
|
|
63
|
+
messagesSearchTag?: string | undefined;
|
|
64
64
|
}, {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
envApiKey?: string;
|
|
69
|
-
cacheResponse?: boolean;
|
|
65
|
+
response: {
|
|
66
|
+
document: string;
|
|
67
|
+
id?: string | undefined;
|
|
70
68
|
};
|
|
69
|
+
llm?: {
|
|
70
|
+
model?: string | undefined;
|
|
71
|
+
provider?: string | undefined;
|
|
72
|
+
envApiKey?: string | undefined;
|
|
73
|
+
cacheResponse?: boolean | undefined;
|
|
74
|
+
} | undefined;
|
|
71
75
|
messages?: {
|
|
72
|
-
role
|
|
76
|
+
role: "system" | "assistant" | "user" | "tool";
|
|
73
77
|
content?: any;
|
|
74
|
-
}[];
|
|
75
|
-
prompt?: string;
|
|
76
|
-
messagesSearchTag?: string;
|
|
77
|
-
response?: {
|
|
78
|
-
id?: string;
|
|
79
|
-
document?: string;
|
|
80
|
-
};
|
|
78
|
+
}[] | undefined;
|
|
79
|
+
prompt?: string | undefined;
|
|
80
|
+
messagesSearchTag?: string | undefined;
|
|
81
81
|
}>;
|
|
82
82
|
export type AiGenerateObjectArgsType = z.infer<typeof AiGenerateObjectSchema>;
|
|
83
83
|
export declare class AiGenerateObject extends ToolBase<AiGenerateObjectArgsType> {
|
|
@@ -12,7 +12,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.AiGenerateObject = exports.AiGenerateObjectSchema = void 0;
|
|
13
13
|
const zod_1 = require("zod");
|
|
14
14
|
const common_1 = require("@loopstack/common");
|
|
15
|
-
const lodash_1 = require("lodash");
|
|
16
15
|
const ai_1 = require("ai");
|
|
17
16
|
const core_1 = require("@loopstack/core");
|
|
18
17
|
const services_1 = require("../services");
|
|
@@ -39,7 +38,10 @@ let AiGenerateObject = class AiGenerateObject extends core_1.ToolBase {
|
|
|
39
38
|
options.prompt = args.prompt;
|
|
40
39
|
}
|
|
41
40
|
else {
|
|
42
|
-
const messages = this.aiMessagesHelperService.getMessages(ctx.state.getMetadata('documents'),
|
|
41
|
+
const messages = this.aiMessagesHelperService.getMessages(ctx.state.getMetadata('documents'), {
|
|
42
|
+
messages: args.messages,
|
|
43
|
+
messagesSearchTag: args.messagesSearchTag,
|
|
44
|
+
});
|
|
43
45
|
options.messages = (0, ai_1.convertToModelMessages)(messages);
|
|
44
46
|
}
|
|
45
47
|
const document = parent.getDocument(args.response.document);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-generate-object.tool.js","sourceRoot":"","sources":["../../src/tools/ai-generate-object.tool.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6BAAwB;AACxB,8CAA2E;AAC3E,
|
|
1
|
+
{"version":3,"file":"ai-generate-object.tool.js","sourceRoot":"","sources":["../../src/tools/ai-generate-object.tool.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6BAAwB;AACxB,8CAA2E;AAC3E,2BAIY;AACZ,0CAAyD;AACzD,0CAAsD;AACtD,0CAA2D;AAG3D,0FAAmF;AAGtE,QAAA,sBA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", z.ZodTypeAny, {
|
|
15
|
-
model?: string;
|
|
16
|
-
provider?: string;
|
|
17
|
-
envApiKey?: string;
|
|
18
|
-
cacheResponse?: boolean;
|
|
15
|
+
model?: string | undefined;
|
|
16
|
+
provider?: string | undefined;
|
|
17
|
+
envApiKey?: string | undefined;
|
|
18
|
+
cacheResponse?: boolean | undefined;
|
|
19
19
|
}, {
|
|
20
|
-
model?: string;
|
|
21
|
-
provider?: string;
|
|
22
|
-
envApiKey?: string;
|
|
23
|
-
cacheResponse?: boolean;
|
|
20
|
+
model?: string | undefined;
|
|
21
|
+
provider?: string | undefined;
|
|
22
|
+
envApiKey?: string | undefined;
|
|
23
|
+
cacheResponse?: boolean | undefined;
|
|
24
24
|
}>>;
|
|
25
25
|
messages: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
26
26
|
role: z.ZodEnum<["system", "assistant", "user", "tool"]>;
|
|
27
27
|
content: z.ZodAny;
|
|
28
28
|
}, "strip", z.ZodTypeAny, {
|
|
29
|
-
role
|
|
29
|
+
role: "system" | "assistant" | "user" | "tool";
|
|
30
30
|
content?: any;
|
|
31
31
|
}, {
|
|
32
|
-
role
|
|
32
|
+
role: "system" | "assistant" | "user" | "tool";
|
|
33
33
|
content?: any;
|
|
34
34
|
}>, "many">>;
|
|
35
35
|
prompt: z.ZodOptional<z.ZodString>;
|
|
@@ -38,32 +38,32 @@ export declare const AiGenerateTextSchema: z.ZodObject<{
|
|
|
38
38
|
tools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
39
39
|
}, "strict", z.ZodTypeAny, {
|
|
40
40
|
llm?: {
|
|
41
|
-
model?: string;
|
|
42
|
-
provider?: string;
|
|
43
|
-
envApiKey?: string;
|
|
44
|
-
cacheResponse?: boolean;
|
|
45
|
-
};
|
|
41
|
+
model?: string | undefined;
|
|
42
|
+
provider?: string | undefined;
|
|
43
|
+
envApiKey?: string | undefined;
|
|
44
|
+
cacheResponse?: boolean | undefined;
|
|
45
|
+
} | undefined;
|
|
46
46
|
messages?: {
|
|
47
|
-
role
|
|
47
|
+
role: "system" | "assistant" | "user" | "tool";
|
|
48
48
|
content?: any;
|
|
49
|
-
}[];
|
|
50
|
-
prompt?: string;
|
|
51
|
-
messagesSearchTag?: string;
|
|
52
|
-
tools?: string[];
|
|
49
|
+
}[] | undefined;
|
|
50
|
+
prompt?: string | undefined;
|
|
51
|
+
messagesSearchTag?: string | undefined;
|
|
52
|
+
tools?: string[] | undefined;
|
|
53
53
|
}, {
|
|
54
54
|
llm?: {
|
|
55
|
-
model?: string;
|
|
56
|
-
provider?: string;
|
|
57
|
-
envApiKey?: string;
|
|
58
|
-
cacheResponse?: boolean;
|
|
59
|
-
};
|
|
55
|
+
model?: string | undefined;
|
|
56
|
+
provider?: string | undefined;
|
|
57
|
+
envApiKey?: string | undefined;
|
|
58
|
+
cacheResponse?: boolean | undefined;
|
|
59
|
+
} | undefined;
|
|
60
60
|
messages?: {
|
|
61
|
-
role
|
|
61
|
+
role: "system" | "assistant" | "user" | "tool";
|
|
62
62
|
content?: any;
|
|
63
|
-
}[];
|
|
64
|
-
prompt?: string;
|
|
65
|
-
messagesSearchTag?: string;
|
|
66
|
-
tools?: string[];
|
|
63
|
+
}[] | undefined;
|
|
64
|
+
prompt?: string | undefined;
|
|
65
|
+
messagesSearchTag?: string | undefined;
|
|
66
|
+
tools?: string[] | undefined;
|
|
67
67
|
}>;
|
|
68
68
|
type AiGenerateTextArgsType = z.infer<typeof AiGenerateTextSchema>;
|
|
69
69
|
export declare class AiGenerateText extends ToolBase<AiGenerateTextArgsType> {
|
|
@@ -12,7 +12,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.AiGenerateText = exports.AiGenerateTextSchema = void 0;
|
|
13
13
|
const zod_1 = require("zod");
|
|
14
14
|
const common_1 = require("@loopstack/common");
|
|
15
|
-
const lodash_1 = require("lodash");
|
|
16
15
|
const core_1 = require("@loopstack/core");
|
|
17
16
|
const services_1 = require("../services");
|
|
18
17
|
const services_2 = require("../services");
|
|
@@ -42,7 +41,10 @@ let AiGenerateText = class AiGenerateText extends core_1.ToolBase {
|
|
|
42
41
|
options.prompt = args.prompt;
|
|
43
42
|
}
|
|
44
43
|
else {
|
|
45
|
-
const messages = this.aiMessagesHelperService.getMessages(ctx.state.getMetadata('documents'),
|
|
44
|
+
const messages = this.aiMessagesHelperService.getMessages(ctx.state.getMetadata('documents'), {
|
|
45
|
+
messages: args.messages,
|
|
46
|
+
messagesSearchTag: args.messagesSearchTag,
|
|
47
|
+
});
|
|
46
48
|
options.messages = (0, ai_1.convertToModelMessages)(messages, {
|
|
47
49
|
tools: options.tools,
|
|
48
50
|
});
|
|
@@ -66,13 +68,8 @@ let AiGenerateText = class AiGenerateText extends core_1.ToolBase {
|
|
|
66
68
|
sendReasoning: true,
|
|
67
69
|
}));
|
|
68
70
|
},
|
|
69
|
-
onFinish:
|
|
70
|
-
|
|
71
|
-
resolve(data.responseMessage);
|
|
72
|
-
}
|
|
73
|
-
catch (error) {
|
|
74
|
-
reject(error);
|
|
75
|
-
}
|
|
71
|
+
onFinish: (data) => {
|
|
72
|
+
resolve(data.responseMessage);
|
|
76
73
|
},
|
|
77
74
|
});
|
|
78
75
|
(async () => {
|
|
@@ -85,7 +82,7 @@ let AiGenerateText = class AiGenerateText extends core_1.ToolBase {
|
|
|
85
82
|
}
|
|
86
83
|
}
|
|
87
84
|
catch (error) {
|
|
88
|
-
reject(error);
|
|
85
|
+
reject(error instanceof Error ? error : new Error(String(error)));
|
|
89
86
|
}
|
|
90
87
|
})();
|
|
91
88
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-generate-text.tool.js","sourceRoot":"","sources":["../../src/tools/ai-generate-text.tool.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6BAAwB;AACxB,8CAA2E;AAC3E,
|
|
1
|
+
{"version":3,"file":"ai-generate-text.tool.js","sourceRoot":"","sources":["../../src/tools/ai-generate-text.tool.ts"],"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,EAAE,CAAC;wBACf,MAAM,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;oBACpE,CAAC;gBACH,CAAC,CAAC,EAAE,CAAC;YACP,CAAC,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,iBAAiB,GAAG,WAAW,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC;YACxD,OAAO,CAAC,KAAK,CAAC,wBAAwB,iBAAiB,KAAK,EAAE,KAAK,CAAC,CAAC;YACrE,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF,CAAA;AA5FY,wCAAc;yBAAd,cAAc;IAN1B,IAAA,oBAAW,EAAC;QACX,MAAM,EAAE;YACN,WAAW,EAAE,4BAA4B;SAC1C;KACF,CAAC;IACD,IAAA,sBAAa,EAAC,4BAAoB,CAAC;qCAGU,kCAAuB;QAC1B,+BAAoB;QACZ,uCAA4B;GAJlE,cAAc,CA4F1B"}
|
|
@@ -3,11 +3,54 @@ import { z } from 'zod';
|
|
|
3
3
|
import { ToolBase, WorkflowBase } from '@loopstack/core';
|
|
4
4
|
import { WorkflowExecution } from '@loopstack/core/dist/workflow-processor/interfaces/workflow-execution.interface';
|
|
5
5
|
declare const DelegateToolCallsToolSchema: z.ZodObject<{
|
|
6
|
-
message: z.
|
|
6
|
+
message: z.ZodObject<{
|
|
7
|
+
id: z.ZodString;
|
|
8
|
+
parts: z.ZodArray<z.ZodObject<{
|
|
9
|
+
type: z.ZodString;
|
|
10
|
+
input: z.ZodAny;
|
|
11
|
+
toolCallId: z.ZodString;
|
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
|
13
|
+
type: string;
|
|
14
|
+
toolCallId: string;
|
|
15
|
+
input?: any;
|
|
16
|
+
}, {
|
|
17
|
+
type: string;
|
|
18
|
+
toolCallId: string;
|
|
19
|
+
input?: any;
|
|
20
|
+
}>, "many">;
|
|
21
|
+
}, "strip", z.ZodTypeAny, {
|
|
22
|
+
id: string;
|
|
23
|
+
parts: {
|
|
24
|
+
type: string;
|
|
25
|
+
toolCallId: string;
|
|
26
|
+
input?: any;
|
|
27
|
+
}[];
|
|
28
|
+
}, {
|
|
29
|
+
id: string;
|
|
30
|
+
parts: {
|
|
31
|
+
type: string;
|
|
32
|
+
toolCallId: string;
|
|
33
|
+
input?: any;
|
|
34
|
+
}[];
|
|
35
|
+
}>;
|
|
7
36
|
}, "strip", z.ZodTypeAny, {
|
|
8
|
-
message
|
|
37
|
+
message: {
|
|
38
|
+
id: string;
|
|
39
|
+
parts: {
|
|
40
|
+
type: string;
|
|
41
|
+
toolCallId: string;
|
|
42
|
+
input?: any;
|
|
43
|
+
}[];
|
|
44
|
+
};
|
|
9
45
|
}, {
|
|
10
|
-
message
|
|
46
|
+
message: {
|
|
47
|
+
id: string;
|
|
48
|
+
parts: {
|
|
49
|
+
type: string;
|
|
50
|
+
toolCallId: string;
|
|
51
|
+
input?: any;
|
|
52
|
+
}[];
|
|
53
|
+
};
|
|
11
54
|
}>;
|
|
12
55
|
type DelegateToolCallsToolArgs = z.infer<typeof DelegateToolCallsToolSchema>;
|
|
13
56
|
export declare class DelegateToolCall extends ToolBase<DelegateToolCallsToolArgs> {
|
|
@@ -11,7 +11,14 @@ const common_1 = require("@loopstack/common");
|
|
|
11
11
|
const zod_1 = require("zod");
|
|
12
12
|
const core_1 = require("@loopstack/core");
|
|
13
13
|
const DelegateToolCallsToolSchema = zod_1.z.object({
|
|
14
|
-
message: zod_1.z.
|
|
14
|
+
message: zod_1.z.object({
|
|
15
|
+
id: zod_1.z.string(),
|
|
16
|
+
parts: zod_1.z.array(zod_1.z.object({
|
|
17
|
+
type: zod_1.z.string(),
|
|
18
|
+
input: zod_1.z.any(),
|
|
19
|
+
toolCallId: zod_1.z.string(),
|
|
20
|
+
})),
|
|
21
|
+
}),
|
|
15
22
|
});
|
|
16
23
|
let DelegateToolCall = class DelegateToolCall extends core_1.ToolBase {
|
|
17
24
|
async execute(args, ctx, parent) {
|
|
@@ -23,6 +30,9 @@ let DelegateToolCall = class DelegateToolCall extends core_1.ToolBase {
|
|
|
23
30
|
}
|
|
24
31
|
const toolName = part.type.replace(/^tool-/, '');
|
|
25
32
|
const tool = parent.getTool(toolName);
|
|
33
|
+
if (!tool) {
|
|
34
|
+
throw new Error(`Tool ${toolName} not found.`);
|
|
35
|
+
}
|
|
26
36
|
const result = await tool.execute(part.input, ctx, parent);
|
|
27
37
|
resultParts.push({
|
|
28
38
|
type: part.type,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delegate-tool-call.tool.js","sourceRoot":"","sources":["../../src/tools/delegate-tool-call.tool.ts"],"names":[],"mappings":";;;;;;;;;AAAA,8CAA2E;AAC3E,6BAAwB;AACxB,0CAAyD;AAIzD,MAAM,2BAA2B,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3C,OAAO,EAAE,OAAC,CAAC,GAAG,EAAE;
|
|
1
|
+
{"version":3,"file":"delegate-tool-call.tool.js","sourceRoot":"","sources":["../../src/tools/delegate-tool-call.tool.ts"],"names":[],"mappings":";;;;;;;;;AAAA,8CAA2E;AAC3E,6BAAwB;AACxB,0CAAyD;AAIzD,MAAM,2BAA2B,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3C,OAAO,EAAE,OAAC,CAAC,MAAM,CAAC;QAChB,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;QACd,KAAK,EAAE,OAAC,CAAC,KAAK,CACZ,OAAC,CAAC,MAAM,CAAC;YACP,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;YAChB,KAAK,EAAE,OAAC,CAAC,GAAG,EAAE;YACd,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE;SACvB,CAAC,CACH;KACF,CAAC;CACH,CAAC,CAAC;AAUI,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,eAAmC;IACvE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IAN5B,IAAA,oBAAW,EAAC;QACX,MAAM,EAAE;YACN,WAAW,EAAE,uBAAuB;SACrC;KACF,CAAC;IACD,IAAA,sBAAa,EAAC,2BAA2B,CAAC;GAC9B,gBAAgB,CA4C5B"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@loopstack/ai-module",
|
|
3
3
|
"displayName": "Loopstack Ai Module",
|
|
4
4
|
"description": "A collection of useful tools for performing AI actions using model provider APIs such as OpenAI and Anthropic",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.16.0",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Jakob Klippel",
|
|
8
8
|
"url": "https://www.linkedin.com/in/jakob-klippel/"
|
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
"build": "nest build",
|
|
23
23
|
"watch": "nest build --watch",
|
|
24
24
|
"compile": "tsc --noEmit",
|
|
25
|
-
"prepare": "npm run build",
|
|
26
25
|
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
|
|
27
26
|
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
|
|
28
27
|
"test": "jest",
|
|
@@ -42,9 +41,9 @@
|
|
|
42
41
|
"@ai-sdk/anthropic": "^2.0.1",
|
|
43
42
|
"@ai-sdk/openai": "^2.0.4",
|
|
44
43
|
"@ai-sdk/provider-utils": "^3.0.8",
|
|
45
|
-
"@loopstack/common": "^0.
|
|
46
|
-
"@loopstack/core": "^0.
|
|
47
|
-
"@loopstack/core-ui-module": "^0.
|
|
44
|
+
"@loopstack/common": "^0.16.0",
|
|
45
|
+
"@loopstack/core": "^0.16.0",
|
|
46
|
+
"@loopstack/core-ui-module": "^0.16.0",
|
|
48
47
|
"ai": "^5.0.6",
|
|
49
48
|
"lodash": "^4.17.21",
|
|
50
49
|
"zod": "^3.24.1"
|