@loopstack/ai-module 0.16.1 → 0.16.3
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/ai.module.js +0 -4
- package/dist/ai.module.js.map +1 -1
- package/dist/schemas/ai-generate-tool-base.schema.d.ts +28 -28
- package/dist/services/ai-tools-helper.service.js +1 -2
- package/dist/services/ai-tools-helper.service.js.map +1 -1
- package/dist/tools/ai-generate-object.tool.d.ts +40 -40
- package/dist/tools/ai-generate-text.tool.d.ts +30 -30
- package/dist/tools/ai-generate-text.tool.js +0 -1
- package/dist/tools/ai-generate-text.tool.js.map +1 -1
- package/dist/tools/delegate-tool-call.tool.d.ts +24 -24
- package/dist/tools/delegate-tool-call.tool.js +5 -2
- package/dist/tools/delegate-tool-call.tool.js.map +1 -1
- package/package.json +1 -1
- package/tsconfig.build.json +4 -0
package/dist/ai.module.js
CHANGED
|
@@ -26,20 +26,16 @@ exports.AiModule = AiModule = __decorate([
|
|
|
26
26
|
(0, common_1.Module)({
|
|
27
27
|
imports: [core_1.LoopCoreModule, core_ui_module_1.CoreUiModule, core_2.DiscoveryModule],
|
|
28
28
|
providers: [
|
|
29
|
-
// services
|
|
30
29
|
services_1.AiMessagesHelperService,
|
|
31
30
|
services_2.AiProviderModelHelperService,
|
|
32
31
|
services_3.AiToolsHelperService,
|
|
33
32
|
ai_provider_registry_service_1.AiProviderRegistryService,
|
|
34
|
-
// ai providers
|
|
35
33
|
openai_provider_1.OpenAiProviderService,
|
|
36
34
|
anthropic_provider_1.AnthropicProviderService,
|
|
37
|
-
// tools
|
|
38
35
|
tools_1.AiGenerateDocument,
|
|
39
36
|
tools_1.AiGenerateObject,
|
|
40
37
|
tools_1.AiGenerateText,
|
|
41
38
|
tools_1.DelegateToolCall,
|
|
42
|
-
// documents
|
|
43
39
|
documents_1.AiMessageDocument,
|
|
44
40
|
],
|
|
45
41
|
exports: [
|
package/dist/ai.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai.module.js","sourceRoot":"","sources":["../src/ai.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,0CAAiD;AACjD,0FAAoF;AACpF,iEAAoE;AACpE,uEAA0E;AAC1E,uCAA+C;AAC/C,yCAAqD;AACrD,yCAA0D;AAC1D,yCAAkD;AAClD,mCAKiB;AACjB,2CAAgD;AAChD,8DAAyD;AAgClD,IAAM,QAAQ,GAAd,MAAM,QAAQ;CAAG,CAAA;AAAX,4BAAQ;mBAAR,QAAQ;IA9BpB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,qBAAc,EAAE,6BAAY,EAAE,sBAAe,CAAC;QACxD,SAAS,EAAE;
|
|
1
|
+
{"version":3,"file":"ai.module.js","sourceRoot":"","sources":["../src/ai.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,0CAAiD;AACjD,0FAAoF;AACpF,iEAAoE;AACpE,uEAA0E;AAC1E,uCAA+C;AAC/C,yCAAqD;AACrD,yCAA0D;AAC1D,yCAAkD;AAClD,mCAKiB;AACjB,2CAAgD;AAChD,8DAAyD;AAgClD,IAAM,QAAQ,GAAd,MAAM,QAAQ;CAAG,CAAA;AAAX,4BAAQ;mBAAR,QAAQ;IA9BpB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,qBAAc,EAAE,6BAAY,EAAE,sBAAe,CAAC;QACxD,SAAS,EAAE;YAET,kCAAuB;YACvB,uCAA4B;YAC5B,+BAAoB;YACpB,wDAAyB;YAGzB,uCAAqB;YACrB,6CAAwB;YAGxB,0BAAkB;YAClB,wBAAgB;YAChB,sBAAc;YACd,wBAAgB;YAGhB,6BAAiB;SAClB;QACD,OAAO,EAAE;YACP,0BAAkB;YAClB,wBAAgB;YAChB,sBAAc;YACd,wBAAgB;YAChB,6BAAiB;SAClB;KACF,CAAC;GACW,QAAQ,CAAG"}
|
|
@@ -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
|
}>;
|
|
@@ -10,7 +10,6 @@ exports.AiToolsHelperService = void 0;
|
|
|
10
10
|
const common_1 = require("@nestjs/common");
|
|
11
11
|
let AiToolsHelperService = class AiToolsHelperService {
|
|
12
12
|
getTools(tools, parent) {
|
|
13
|
-
// using any instead of ToolSet bc ai sdk types have some nesting issue
|
|
14
13
|
const toolDefinitions = {};
|
|
15
14
|
for (const toolName of tools) {
|
|
16
15
|
const tool = parent.getTool(toolName);
|
|
@@ -22,7 +21,7 @@ let AiToolsHelperService = class AiToolsHelperService {
|
|
|
22
21
|
toolDefinitions[toolName] = {
|
|
23
22
|
description: tool.config.description,
|
|
24
23
|
inputSchema,
|
|
25
|
-
};
|
|
24
|
+
};
|
|
26
25
|
}
|
|
27
26
|
}
|
|
28
27
|
return Object.keys(toolDefinitions).length ? toolDefinitions : undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-tools-helper.service.js","sourceRoot":"","sources":["../../src/services/ai-tools-helper.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAIrC,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAC/B,QAAQ,CACN,KAAe,EACf,MAAoB;
|
|
1
|
+
{"version":3,"file":"ai-tools-helper.service.js","sourceRoot":"","sources":["../../src/services/ai-tools-helper.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAIrC,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAC/B,QAAQ,CACN,KAAe,EACf,MAAoB;QAGpB,MAAM,eAAe,GAAwB,EAAE,CAAC;QAEhD,KAAK,MAAM,QAAQ,IAAI,KAAK,EAAE,CAAC;YAC7B,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;YACtC,IAAI,CAAC,IAAI,EAAE,CAAC;gBACV,MAAM,IAAI,KAAK,CACb,kBAAkB,QAAQ,qCAAqC,CAChE,CAAC;YACJ,CAAC;YAED,MAAM,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC;YAEpC,IAAI,WAAW,EAAE,CAAC;gBAChB,eAAe,CAAC,QAAQ,CAAC,GAAG;oBAC1B,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,WAAW;oBACpC,WAAW;iBACL,CAAC;YACX,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3E,CAAC;CACF,CAAA;AA5BY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,mBAAU,GAAE;GACA,oBAAoB,CA4BhC"}
|
|
@@ -11,24 +11,24 @@ export declare const AiGenerateObjectSchema: z.ZodObject<{
|
|
|
11
11
|
envApiKey: z.ZodOptional<z.ZodString>;
|
|
12
12
|
cacheResponse: z.ZodOptional<z.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,24 +12,24 @@ export declare const AiGenerateTextSchema: z.ZodObject<{
|
|
|
12
12
|
envApiKey: z.ZodOptional<z.ZodString>;
|
|
13
13
|
cacheResponse: z.ZodOptional<z.ZodBoolean>;
|
|
14
14
|
}, "strip", 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> {
|
|
@@ -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,0CAAyD;AACzD,0CAAsD;AACtD,0CAA2D;AAC3D,0CAAmD;AACnD,2BAKY;AAEZ,0FAAmF;AAGtE,QAAA,oBAAoB,GAAG,uDAAwB,CAAC,MAAM,CAAC;IAClE,KAAK,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CACtC,CAAC,CAAC,MAAM,EAAE,CAAC;AAUL,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,eAAgC;IAE/C;IACA;IACA;IAHnB,YACmB,uBAAgD,EAChD,oBAA0C,EAC1C,4BAA0D;QAE3E,KAAK,EAAE,CAAC;QAJS,4BAAuB,GAAvB,uBAAuB,CAAyB;QAChD,yBAAoB,GAApB,oBAAoB,CAAsB;QAC1C,iCAA4B,GAA5B,4BAA4B,CAA8B;IAG7E,CAAC;IAED,KAAK,CAAC,OAAO,CACX,IAA4B,EAC5B,GAAsB,EACtB,MAAoB;QAEpB,MAAM,KAAK,GAAG,IAAI,CAAC,4BAA4B,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAE3E,MAAM,OAAO,GAIT,EAAE,CAAC;QAEP,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK;YACxB,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC;YACxD,CAAC,C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AAE,CAAC;4BACrC,IAAI,IAAI;gCAAE,MAAM;wBAClB,CAAC;oBACH,CAAC;oBAAC,OAAO,KAAK,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"}
|
|
@@ -7,48 +7,48 @@ declare const DelegateToolCallsToolSchema: z.ZodObject<{
|
|
|
7
7
|
id: z.ZodString;
|
|
8
8
|
parts: z.ZodArray<z.ZodObject<{
|
|
9
9
|
type: z.ZodString;
|
|
10
|
-
input: z.ZodAny
|
|
11
|
-
toolCallId: z.ZodString
|
|
10
|
+
input: z.ZodOptional<z.ZodAny>;
|
|
11
|
+
toolCallId: z.ZodOptional<z.ZodString>;
|
|
12
12
|
}, "strip", z.ZodTypeAny, {
|
|
13
|
-
type
|
|
13
|
+
type: string;
|
|
14
14
|
input?: any;
|
|
15
|
-
toolCallId?: string;
|
|
15
|
+
toolCallId?: string | undefined;
|
|
16
16
|
}, {
|
|
17
|
-
type
|
|
17
|
+
type: string;
|
|
18
18
|
input?: any;
|
|
19
|
-
toolCallId?: string;
|
|
19
|
+
toolCallId?: string | undefined;
|
|
20
20
|
}>, "many">;
|
|
21
21
|
}, "strip", z.ZodTypeAny, {
|
|
22
|
-
id
|
|
23
|
-
parts
|
|
24
|
-
type
|
|
22
|
+
id: string;
|
|
23
|
+
parts: {
|
|
24
|
+
type: string;
|
|
25
25
|
input?: any;
|
|
26
|
-
toolCallId?: string;
|
|
26
|
+
toolCallId?: string | undefined;
|
|
27
27
|
}[];
|
|
28
28
|
}, {
|
|
29
|
-
id
|
|
30
|
-
parts
|
|
31
|
-
type
|
|
29
|
+
id: string;
|
|
30
|
+
parts: {
|
|
31
|
+
type: string;
|
|
32
32
|
input?: any;
|
|
33
|
-
toolCallId?: string;
|
|
33
|
+
toolCallId?: string | undefined;
|
|
34
34
|
}[];
|
|
35
35
|
}>;
|
|
36
36
|
}, "strip", z.ZodTypeAny, {
|
|
37
|
-
message
|
|
38
|
-
id
|
|
39
|
-
parts
|
|
40
|
-
type
|
|
37
|
+
message: {
|
|
38
|
+
id: string;
|
|
39
|
+
parts: {
|
|
40
|
+
type: string;
|
|
41
41
|
input?: any;
|
|
42
|
-
toolCallId?: string;
|
|
42
|
+
toolCallId?: string | undefined;
|
|
43
43
|
}[];
|
|
44
44
|
};
|
|
45
45
|
}, {
|
|
46
|
-
message
|
|
47
|
-
id
|
|
48
|
-
parts
|
|
49
|
-
type
|
|
46
|
+
message: {
|
|
47
|
+
id: string;
|
|
48
|
+
parts: {
|
|
49
|
+
type: string;
|
|
50
50
|
input?: any;
|
|
51
|
-
toolCallId?: string;
|
|
51
|
+
toolCallId?: string | undefined;
|
|
52
52
|
}[];
|
|
53
53
|
};
|
|
54
54
|
}>;
|
|
@@ -15,8 +15,8 @@ const DelegateToolCallsToolSchema = zod_1.z.object({
|
|
|
15
15
|
id: zod_1.z.string(),
|
|
16
16
|
parts: zod_1.z.array(zod_1.z.object({
|
|
17
17
|
type: zod_1.z.string(),
|
|
18
|
-
input: zod_1.z.any(),
|
|
19
|
-
toolCallId: zod_1.z.string(),
|
|
18
|
+
input: zod_1.z.any().optional(),
|
|
19
|
+
toolCallId: zod_1.z.string().optional(),
|
|
20
20
|
})),
|
|
21
21
|
}),
|
|
22
22
|
});
|
|
@@ -28,6 +28,9 @@ let DelegateToolCall = class DelegateToolCall extends core_1.ToolBase {
|
|
|
28
28
|
if (!part.type.startsWith('tool-')) {
|
|
29
29
|
continue;
|
|
30
30
|
}
|
|
31
|
+
if (!part.toolCallId) {
|
|
32
|
+
throw new Error(`No toolCallId provided`);
|
|
33
|
+
}
|
|
31
34
|
const toolName = part.type.replace(/^tool-/, '');
|
|
32
35
|
const tool = parent.getTool(toolName);
|
|
33
36
|
if (!tool) {
|
|
@@ -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,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;
|
|
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,O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,EAAE;oBACN,IAAI,EAAE,MAAM,CAAC,IAAI,IAAI,MAAM;oBAC3B,KAAK,EAAE,MAAM,CAAC,IAAI;iBACnB;gBACD,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,KAAK,EAAE,kBAAkB;aACL,CAAC,CAAC;QAC1B,CAAC;QAED,MAAM,aAAa,GAAG;YACpB,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE;YACnB,IAAI,EAAE,WAAW;YACjB,KAAK,EAAE,WAAW;SACC,CAAC;QAEtB,OAAO;YACL,IAAI,EAAE,aAAa;SACpB,CAAC;IACJ,CAAC;CACF,CAAA;AAhDY,4CAAgB;2BAAhB,gBAAgB;IAN5B,IAAA,oBAAW,EAAC;QACX,MAAM,EAAE;YACN,WAAW,EAAE,uBAAuB;SACrC;KACF,CAAC;IACD,IAAA,sBAAa,EAAC,2BAA2B,CAAC;GAC9B,gBAAgB,CAgD5B"}
|
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.16.
|
|
5
|
+
"version": "0.16.3",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Jakob Klippel",
|
|
8
8
|
"url": "https://www.linkedin.com/in/jakob-klippel/"
|