@botonic/plugin-ai-agents 0.56.0-alpha.0 → 0.57.0-rslib-esm.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/lib/esm/agents/base-agent.d.ts +4 -4
- package/lib/esm/agents/base-agent.js +47 -20
- package/lib/esm/agents/base-agent.js.map +1 -1
- package/lib/esm/agents/index.d.ts +2 -2
- package/lib/esm/agents/index.js +8 -7
- package/lib/esm/agents/index.js.map +1 -1
- package/lib/esm/agents/router-agent.d.ts +5 -5
- package/lib/esm/agents/router-agent.js +32 -15
- package/lib/esm/agents/router-agent.js.map +1 -1
- package/lib/esm/agents/specialist-agent.d.ts +5 -5
- package/lib/esm/agents/specialist-agent.js +65 -45
- package/lib/esm/agents/specialist-agent.js.map +1 -1
- package/lib/esm/bot-config-tools.d.ts +1 -1
- package/lib/esm/bot-config-tools.js +15 -13
- package/lib/esm/bot-config-tools.js.map +1 -1
- package/lib/esm/constants.js +18 -17
- package/lib/esm/constants.js.map +1 -1
- package/lib/esm/debug-logger.d.ts +1 -1
- package/lib/esm/debug-logger.js +14 -9
- package/lib/esm/debug-logger.js.map +1 -1
- package/lib/esm/guardrails/index.d.ts +1 -1
- package/lib/esm/guardrails/index.js +5 -4
- package/lib/esm/guardrails/index.js.map +1 -1
- package/lib/esm/guardrails/input.d.ts +2 -2
- package/lib/esm/guardrails/input.js +65 -42
- package/lib/esm/guardrails/input.js.map +1 -1
- package/lib/esm/index.d.ts +3 -3
- package/lib/esm/index.js +114 -74
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/llm-config.d.ts +1 -1
- package/lib/esm/llm-config.js +81 -52
- package/lib/esm/llm-config.js.map +1 -1
- package/lib/esm/package.json +3 -0
- package/lib/esm/runners/base-runner.d.ts +3 -3
- package/lib/esm/runners/base-runner.js +81 -69
- package/lib/esm/runners/base-runner.js.map +1 -1
- package/lib/esm/runners/index.d.ts +2 -2
- package/lib/esm/runners/index.js +8 -7
- package/lib/esm/runners/index.js.map +1 -1
- package/lib/esm/runners/router-runner.d.ts +2 -2
- package/lib/esm/runners/router-runner.js +19 -14
- package/lib/esm/runners/router-runner.js.map +1 -1
- package/lib/esm/runners/specialist-runner.d.ts +1 -1
- package/lib/esm/runners/specialist-runner.js +8 -6
- package/lib/esm/runners/specialist-runner.js.map +1 -1
- package/lib/esm/services/hubtype-api-client.d.ts +2 -2
- package/lib/esm/services/hubtype-api-client.js +110 -95
- package/lib/esm/services/hubtype-api-client.js.map +1 -1
- package/lib/esm/services/types.d.ts +1 -1
- package/lib/esm/services/types.js +9 -9
- package/lib/esm/services/types.js.map +1 -1
- package/lib/esm/structured-output/bot-executor.js +20 -17
- package/lib/esm/structured-output/bot-executor.js.map +1 -1
- package/lib/esm/structured-output/carousel.js +25 -22
- package/lib/esm/structured-output/carousel.js.map +1 -1
- package/lib/esm/structured-output/exit.js +13 -10
- package/lib/esm/structured-output/exit.js.map +1 -1
- package/lib/esm/structured-output/index.d.ts +0 -10
- package/lib/esm/structured-output/index.js +39 -29
- package/lib/esm/structured-output/index.js.map +1 -1
- package/lib/esm/structured-output/text-with-buttons.js +24 -23
- package/lib/esm/structured-output/text-with-buttons.js.map +1 -1
- package/lib/esm/structured-output/text.js +16 -13
- package/lib/esm/structured-output/text.js.map +1 -1
- package/lib/esm/tools/index.d.ts +2 -2
- package/lib/esm/tools/index.js +7 -7
- package/lib/esm/tools/index.js.map +1 -1
- package/lib/esm/tools/retrieve-knowledge.d.ts +2 -2
- package/lib/esm/tools/retrieve-knowledge.js +38 -32
- package/lib/esm/tools/retrieve-knowledge.js.map +1 -1
- package/lib/esm/types.d.ts +3 -3
- package/lib/esm/types.js +4 -2
- package/lib/esm/types.js.map +1 -1
- package/package.json +8 -7
- package/src/structured-output/index.ts +0 -2
- package/src/types.ts +4 -4
- package/lib/cjs/agents/base-agent.d.ts +0 -28
- package/lib/cjs/agents/base-agent.js +0 -39
- package/lib/cjs/agents/base-agent.js.map +0 -1
- package/lib/cjs/agents/index.d.ts +0 -2
- package/lib/cjs/agents/index.js +0 -8
- package/lib/cjs/agents/index.js.map +0 -1
- package/lib/cjs/agents/router-agent.d.ts +0 -25
- package/lib/cjs/agents/router-agent.js +0 -33
- package/lib/cjs/agents/router-agent.js.map +0 -1
- package/lib/cjs/agents/specialist-agent.d.ts +0 -39
- package/lib/cjs/agents/specialist-agent.js +0 -108
- package/lib/cjs/agents/specialist-agent.js.map +0 -1
- package/lib/cjs/bot-config-tools.d.ts +0 -7
- package/lib/cjs/bot-config-tools.js +0 -18
- package/lib/cjs/bot-config-tools.js.map +0 -1
- package/lib/cjs/constants.d.ts +0 -21
- package/lib/cjs/constants.js +0 -25
- package/lib/cjs/constants.js.map +0 -1
- package/lib/cjs/debug-logger.d.ts +0 -33
- package/lib/cjs/debug-logger.js +0 -116
- package/lib/cjs/debug-logger.js.map +0 -1
- package/lib/cjs/guardrails/index.d.ts +0 -1
- package/lib/cjs/guardrails/index.js +0 -5
- package/lib/cjs/guardrails/index.js.map +0 -1
- package/lib/cjs/guardrails/input.d.ts +0 -10
- package/lib/cjs/guardrails/input.js +0 -96
- package/lib/cjs/guardrails/input.js.map +0 -1
- package/lib/cjs/index.d.ts +0 -22
- package/lib/cjs/index.js +0 -219
- package/lib/cjs/index.js.map +0 -1
- package/lib/cjs/llm-config.d.ts +0 -30
- package/lib/cjs/llm-config.js +0 -121
- package/lib/cjs/llm-config.js.map +0 -1
- package/lib/cjs/runners/base-runner.d.ts +0 -31
- package/lib/cjs/runners/base-runner.js +0 -189
- package/lib/cjs/runners/base-runner.js.map +0 -1
- package/lib/cjs/runners/index.d.ts +0 -2
- package/lib/cjs/runners/index.js +0 -8
- package/lib/cjs/runners/index.js.map +0 -1
- package/lib/cjs/runners/router-runner.d.ts +0 -8
- package/lib/cjs/runners/router-runner.js +0 -44
- package/lib/cjs/runners/router-runner.js.map +0 -1
- package/lib/cjs/runners/specialist-runner.d.ts +0 -4
- package/lib/cjs/runners/specialist-runner.js +0 -8
- package/lib/cjs/runners/specialist-runner.js.map +0 -1
- package/lib/cjs/services/hubtype-api-client.d.ts +0 -13
- package/lib/cjs/services/hubtype-api-client.js +0 -176
- package/lib/cjs/services/hubtype-api-client.js.map +0 -1
- package/lib/cjs/services/types.d.ts +0 -72
- package/lib/cjs/services/types.js +0 -13
- package/lib/cjs/services/types.js.map +0 -1
- package/lib/cjs/structured-output/bot-executor.d.ts +0 -13
- package/lib/cjs/structured-output/bot-executor.js +0 -18
- package/lib/cjs/structured-output/bot-executor.js.map +0 -1
- package/lib/cjs/structured-output/carousel.d.ts +0 -18
- package/lib/cjs/structured-output/carousel.js +0 -23
- package/lib/cjs/structured-output/carousel.js.map +0 -1
- package/lib/cjs/structured-output/exit.d.ts +0 -6
- package/lib/cjs/structured-output/exit.js +0 -11
- package/lib/cjs/structured-output/exit.js.map +0 -1
- package/lib/cjs/structured-output/index.d.ts +0 -108
- package/lib/cjs/structured-output/index.js +0 -45
- package/lib/cjs/structured-output/index.js.map +0 -1
- package/lib/cjs/structured-output/request-contact-info.d.ts +0 -9
- package/lib/cjs/structured-output/request-contact-info.js +0 -14
- package/lib/cjs/structured-output/request-contact-info.js.map +0 -1
- package/lib/cjs/structured-output/text-with-buttons.d.ts +0 -17
- package/lib/cjs/structured-output/text-with-buttons.js +0 -24
- package/lib/cjs/structured-output/text-with-buttons.js.map +0 -1
- package/lib/cjs/structured-output/text.d.ts +0 -9
- package/lib/cjs/structured-output/text.js +0 -14
- package/lib/cjs/structured-output/text.js.map +0 -1
- package/lib/cjs/tools/index.d.ts +0 -3
- package/lib/cjs/tools/index.js +0 -8
- package/lib/cjs/tools/index.js.map +0 -1
- package/lib/cjs/tools/retrieve-knowledge.d.ts +0 -6
- package/lib/cjs/tools/retrieve-knowledge.js +0 -34
- package/lib/cjs/tools/retrieve-knowledge.js.map +0 -1
- package/lib/cjs/types.d.ts +0 -53
- package/lib/cjs/types.js +0 -3
- package/lib/cjs/types.js.map +0 -1
- package/lib/esm/structured-output/request-contact-info.d.ts +0 -9
- package/lib/esm/structured-output/request-contact-info.js +0 -14
- package/lib/esm/structured-output/request-contact-info.js.map +0 -1
- package/src/structured-output/request-contact-info.ts +0 -18
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
1
|
+
import { OutputMessageType } from "@botonic/core";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
const TextWithButtonsSchema = z.object({
|
|
9
|
+
type: z.literal(OutputMessageType.TextWithButtons),
|
|
10
|
+
content: z.object({
|
|
11
|
+
text: z.string(),
|
|
12
|
+
buttons: z.array(z.object({
|
|
13
|
+
text: z.string(),
|
|
14
|
+
url: z.string().nullable().optional(),
|
|
15
|
+
target: z["enum"]([
|
|
16
|
+
'_blank',
|
|
17
|
+
'_self'
|
|
18
|
+
]).default('_blank').nullable().optional().describe('The target of the button when it has an url. If not provided, it will default to _blank.')
|
|
19
|
+
}))
|
|
20
|
+
})
|
|
21
|
+
}).describe('A text message with buttons to allow the user to use quick replies');
|
|
22
|
+
|
|
23
|
+
export { TextWithButtonsSchema };
|
|
24
|
+
|
|
24
25
|
//# sourceMappingURL=text-with-buttons.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-with-buttons.js","
|
|
1
|
+
{"version":3,"file":"structured-output/text-with-buttons.js","sources":["../../../src/structured-output/text-with-buttons.ts"],"sourcesContent":["import { OutputMessageType, type TextWithButtonsMessage } from '@botonic/core'\nimport { z } from 'zod'\n\nexport type { TextWithButtonsMessage }\n\nexport const TextWithButtonsSchema = z\n .object({\n type: z.literal(OutputMessageType.TextWithButtons),\n content: z.object({\n text: z.string(),\n buttons: z.array(\n z.object({\n text: z.string(),\n url: z.string().nullable().optional(),\n target: z\n .enum(['_blank', '_self'])\n .default('_blank')\n .nullable()\n .optional()\n .describe(\n 'The target of the button when it has an url. If not provided, it will default to _blank.'\n ),\n })\n ),\n }),\n })\n .describe(\n 'A text message with buttons to allow the user to use quick replies'\n )\n"],"names":["OutputMessageType","z","TextWithButtonsSchema"],"mappings":";;;;;AAA8E;AACvD;AAIhB,MAAME,qBAAqBA,GAAGD,QAC5B,CAAC;IACN,MAAMA,SAAS,CAACD,iCAAiC;IACjD,SAASC,QAAQ,CAAC;QAChB,MAAMA,QAAQ;QACd,SAASA,OAAO,CACdA,QAAQ,CAAC;YACP,MAAMA,QAAQ;YACd,KAAKA,QAAQ,GAAG,QAAQ,GAAG,QAAQ;YACnC,QAAQA,SACD,CAAC;gBAAC;gBAAU;aAAQ,EACxB,OAAO,CAAC,UACR,QAAQ,GACR,QAAQ,GACR,QAAQ,CACP;QAEN;IAEJ;AACF,GACC,QAAQ,CACP,sEACD"}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
})
|
|
13
|
-
|
|
1
|
+
import { OutputMessageType } from "@botonic/core";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
const TextSchema = z.object({
|
|
9
|
+
type: z.literal(OutputMessageType.Text),
|
|
10
|
+
content: z.object({
|
|
11
|
+
text: z.string()
|
|
12
|
+
})
|
|
13
|
+
}).describe('A text message');
|
|
14
|
+
|
|
15
|
+
export { TextSchema };
|
|
16
|
+
|
|
14
17
|
//# sourceMappingURL=text.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.js","
|
|
1
|
+
{"version":3,"file":"structured-output/text.js","sources":["../../../src/structured-output/text.ts"],"sourcesContent":["import { OutputMessageType, type TextMessage } from '@botonic/core'\nimport { z } from 'zod'\n\nexport type { TextMessage }\n\nexport const TextSchema = z\n .object({\n type: z.literal(OutputMessageType.Text),\n content: z.object({\n text: z.string(),\n }),\n })\n .describe('A text message')\n"],"names":["OutputMessageType","z","TextSchema"],"mappings":";;;;;AAAmE;AAC5C;AAIhB,MAAME,UAAUA,GAAGD,QACjB,CAAC;IACN,MAAMA,SAAS,CAACD,sBAAsB;IACtC,SAASC,QAAQ,CAAC;QAChB,MAAMA,QAAQ;IAChB;AACF,GACC,QAAQ,CAAC,kBAAiB"}
|
package/lib/esm/tools/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { Tool } from '../types';
|
|
2
|
-
export { createRetrieveKnowledge, RETRIEVE_KNOWLEDGE_TOOL_NAME, } from './retrieve-knowledge';
|
|
1
|
+
import type { Tool } from '../types.js';
|
|
2
|
+
export { createRetrieveKnowledge, RETRIEVE_KNOWLEDGE_TOOL_NAME, } from './retrieve-knowledge.js';
|
|
3
3
|
export declare const mandatoryTools: Tool[];
|
package/lib/esm/tools/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
const mandatoryTools = [];
|
|
4
|
+
|
|
5
|
+
export { mandatoryTools };
|
|
6
|
+
export { RETRIEVE_KNOWLEDGE_TOOL_NAME, createRetrieveKnowledge } from "./retrieve-knowledge.js";
|
|
7
|
+
|
|
8
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","
|
|
1
|
+
{"version":3,"file":"tools/index.js","sources":["../../../src/tools/index.ts"],"sourcesContent":["import type { Tool } from '../types'\n\nexport {\n createRetrieveKnowledge,\n RETRIEVE_KNOWLEDGE_TOOL_NAME,\n} from './retrieve-knowledge'\n\nexport const mandatoryTools: Tool[] = []\n"],"names":["createRetrieveKnowledge","RETRIEVE_KNOWLEDGE_TOOL_NAME","mandatoryTools"],"mappings":";AAK6B;AAEtB,MAAME,cAAcA,GAAW,EAAE"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import type { Context } from '../types';
|
|
2
|
+
import type { Context } from '../types.js';
|
|
3
3
|
export declare const RETRIEVE_KNOWLEDGE_TOOL_NAME = "retrieve_knowledge";
|
|
4
|
-
export declare const createRetrieveKnowledge: (sourceIds: string[]) => import("@openai/agents").FunctionTool<Context<import("@botonic/core").ResolvedPlugins, any>, z.ZodObject<{
|
|
4
|
+
export declare const createRetrieveKnowledge: (sourceIds: string[]) => import("@openai/agents-core").FunctionTool<Context<import("@botonic/core").ResolvedPlugins, any>, z.ZodObject<{
|
|
5
5
|
query: z.ZodString;
|
|
6
6
|
}, z.core.$strip>, string>;
|
|
@@ -1,34 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { tool } from "@openai/agents";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { HubtypeApiClient } from "../services/hubtype-api-client.js";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
const RETRIEVE_KNOWLEDGE_TOOL_NAME = 'retrieve_knowledge';
|
|
12
|
+
const createRetrieveKnowledge = (sourceIds)=>tool({
|
|
13
|
+
name: RETRIEVE_KNOWLEDGE_TOOL_NAME,
|
|
14
|
+
description: 'Consult the knowledge base for information before answering. Use this tool to make sure the information you provide is faithful.',
|
|
15
|
+
parameters: z.object({
|
|
16
|
+
query: z.string().describe('The query to search the knowledge base for')
|
|
17
|
+
}),
|
|
18
|
+
execute: async (input, runContext)=>{
|
|
19
|
+
const context = runContext?.context;
|
|
20
|
+
const query = input.query;
|
|
21
|
+
if (!context) {
|
|
22
|
+
throw new Error('Context is required');
|
|
23
|
+
}
|
|
24
|
+
const client = new HubtypeApiClient(context.authToken);
|
|
25
|
+
const chunks = await client.retrieveSimilarChunks(query, sourceIds);
|
|
26
|
+
const chunksIds = chunks.map((chunk)=>chunk.id);
|
|
27
|
+
const chunkTexts = chunks.map((chunk)=>chunk.text);
|
|
28
|
+
context.knowledgeUsed = {
|
|
29
|
+
query,
|
|
30
|
+
sourceIds,
|
|
31
|
+
chunksIds,
|
|
32
|
+
chunkTexts
|
|
33
|
+
};
|
|
34
|
+
return chunkTexts;
|
|
19
35
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
context.knowledgeUsed = {
|
|
25
|
-
query,
|
|
26
|
-
sourceIds,
|
|
27
|
-
chunksIds,
|
|
28
|
-
chunkTexts,
|
|
29
|
-
};
|
|
30
|
-
return chunkTexts;
|
|
31
|
-
},
|
|
32
|
-
});
|
|
33
|
-
exports.createRetrieveKnowledge = createRetrieveKnowledge;
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export { RETRIEVE_KNOWLEDGE_TOOL_NAME, createRetrieveKnowledge };
|
|
39
|
+
|
|
34
40
|
//# sourceMappingURL=retrieve-knowledge.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retrieve-knowledge.js","
|
|
1
|
+
{"version":3,"file":"tools/retrieve-knowledge.js","sources":["../../../src/tools/retrieve-knowledge.ts"],"sourcesContent":["import { type RunContext, tool } from '@openai/agents'\nimport { z } from 'zod'\n\nimport { HubtypeApiClient } from '../services/hubtype-api-client'\nimport type { Context } from '../types'\n\nexport const RETRIEVE_KNOWLEDGE_TOOL_NAME = 'retrieve_knowledge'\n\nexport const createRetrieveKnowledge = (sourceIds: string[]) =>\n tool({\n name: RETRIEVE_KNOWLEDGE_TOOL_NAME,\n description:\n 'Consult the knowledge base for information before answering. Use this tool to make sure the information you provide is faithful.',\n parameters: z.object({\n query: z.string().describe('The query to search the knowledge base for'),\n }),\n execute: async (\n input: { query: string },\n runContext?: RunContext<Context>\n ): Promise<string[]> => {\n const context = runContext?.context\n const query = input.query\n if (!context) {\n throw new Error('Context is required')\n }\n const client = new HubtypeApiClient(context.authToken)\n const chunks = await client.retrieveSimilarChunks(query, sourceIds)\n const chunksIds = chunks.map(chunk => chunk.id)\n const chunkTexts = chunks.map(chunk => chunk.text)\n\n context.knowledgeUsed = {\n query,\n sourceIds,\n chunksIds,\n chunkTexts,\n }\n\n return chunkTexts\n },\n })\n"],"names":["tool","z","HubtypeApiClient","RETRIEVE_KNOWLEDGE_TOOL_NAME","createRetrieveKnowledge","sourceIds","input","runContext","context","query","Error","client","chunks","chunksIds","chunk","chunkTexts"],"mappings":";;;;;;;AAAsD;AAC/B;AAE0C;AAG1D,MAAMG,4BAA4BA,GAAG,qBAAoB;AAEzD,MAAMC,uBAAuBA,GAAG,CAACC,YACtCL,IAAIA,CAAC;QACH,MAAMG,4BAA4BA;QAClC,aACE;QACF,YAAYF,QAAQ,CAAC;YACnB,OAAOA,QAAQ,GAAG,QAAQ,CAAC;QAC7B;QACA,SAAS,OACPK,OACAC;YAEA,MAAMC,UAAUD,YAAY;YAC5B,MAAME,QAAQH,MAAM,KAAK;YACzB,IAAI,CAACE,SAAS;gBACZ,MAAM,IAAIE,MAAM;YAClB;YACA,MAAMC,SAAS,IAAIT,gBAAgBA,CAACM,QAAQ,SAAS;YACrD,MAAMI,SAAS,MAAMD,OAAO,qBAAqB,CAACF,OAAOJ;YACzD,MAAMQ,YAAYD,OAAO,GAAG,CAACE,CAAAA,QAASA,MAAM,EAAE;YAC9C,MAAMC,aAAaH,OAAO,GAAG,CAACE,CAAAA,QAASA,MAAM,IAAI;YAEjDN,QAAQ,aAAa,GAAG;gBACtBC;gBACAJ;gBACAQ;gBACAE;YACF;YAEA,OAAOA;QACT;IACF,GAAE"}
|
package/lib/esm/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { AgenticOutputMessage, AiAgentArgs,
|
|
1
|
+
import type { AgenticOutputMessage, AiAgentArgs, BotContext, GuardrailRule, InferenceResponse, ResolvedPlugins, RunResult } from '@botonic/core';
|
|
2
2
|
import type { Agent, AgentInputItem, AgentOutputType, RunContext as OpenAIRunContext, Tool as OpenAITool } from '@openai/agents';
|
|
3
3
|
import type { ZodType } from 'zod';
|
|
4
|
-
import type { OutputSchema } from './structured-output';
|
|
4
|
+
import type { OutputSchema } from './structured-output/index.js';
|
|
5
5
|
export interface Context<TPlugins extends ResolvedPlugins = ResolvedPlugins, TExtraData = any> {
|
|
6
6
|
authToken: string;
|
|
7
7
|
knowledgeUsed: {
|
|
@@ -50,4 +50,4 @@ export interface ResultRawResponse {
|
|
|
50
50
|
providerData?: Record<string, unknown>;
|
|
51
51
|
}
|
|
52
52
|
export type AgenticInputMessage = AgentInputItem;
|
|
53
|
-
export { AgenticOutputMessage, AiAgentArgs, GuardrailRule, InferenceResponse, RunResult, };
|
|
53
|
+
export type { AgenticOutputMessage, AiAgentArgs, GuardrailRule, InferenceResponse, RunResult, };
|
package/lib/esm/types.js
CHANGED
package/lib/esm/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../../src/types.ts"],"sourcesContent":["import type {\n AgenticOutputMessage,\n AiAgentArgs,\n BotContext,\n GuardrailRule,\n InferenceResponse,\n ResolvedPlugins,\n RunResult,\n} from '@botonic/core'\nimport type {\n Agent,\n AgentInputItem,\n AgentOutputType,\n RunContext as OpenAIRunContext,\n Tool as OpenAITool,\n} from '@openai/agents'\nimport type { ZodType } from 'zod'\n\nimport type { OutputSchema } from './structured-output'\n\nexport interface Context<\n TPlugins extends ResolvedPlugins = ResolvedPlugins,\n TExtraData = any,\n> {\n authToken: string\n knowledgeUsed: {\n query: string\n sourceIds: string[]\n chunksIds: string[]\n chunkTexts: string[]\n }\n request: BotContext<TPlugins, TExtraData>\n}\n\nexport type RunContext<\n TPlugins extends ResolvedPlugins = ResolvedPlugins,\n TExtraData = any,\n> = OpenAIRunContext<Context<TPlugins, TExtraData>>\n\nexport interface CustomTool<\n TPlugins extends ResolvedPlugins = ResolvedPlugins,\n TExtraData = any,\n> {\n name: string\n description: string\n schema: ZodType\n func: (\n input?: any,\n runContext?: RunContext<TPlugins, TExtraData>\n ) => Promise<any>\n}\n\nexport interface Chunk {\n id: string\n text: string\n}\n\nexport type Tool<\n TPlugins extends ResolvedPlugins = ResolvedPlugins,\n TExtraData = any,\n> = OpenAITool<Context<TPlugins, TExtraData>>\n\nexport type AIAgent<\n TPlugins extends ResolvedPlugins = ResolvedPlugins,\n TExtraData = any,\n> = Agent<Context<TPlugins, TExtraData>, AgentOutputType<typeof OutputSchema>>\n\nexport interface MemoryOptions {\n maxMessages: number\n includeToolCalls: boolean\n maxFullToolResults: number\n debugMode: boolean\n}\n\nexport interface PluginAiAgentOptions<\n TPlugins extends ResolvedPlugins = ResolvedPlugins,\n TExtraData = any,\n> {\n authToken?: string\n customTools?: CustomTool<TPlugins, TExtraData>[]\n maxRetries?: number\n timeout?: number\n memory?: Partial<MemoryOptions>\n /** Enable debug logging for AI agent configuration and execution details. */\n enableDebug?: boolean\n /** Key for the local storage to to get messages in local development mode */\n localStorageKey?: string\n}\n\nexport interface ResultRawResponse {\n usage: {\n inputTokens: number\n outputTokens: number\n }\n providerData?: Record<string, unknown>\n}\n\nexport type AgenticInputMessage = AgentInputItem\n\nexport type {\n AgenticOutputMessage,\n AiAgentArgs,\n GuardrailRule,\n InferenceResponse,\n RunResult,\n}\n"],"names":[],"mappings":"AAyGC"}
|
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@botonic/plugin-ai-agents",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"main": "./lib/
|
|
3
|
+
"version": "0.57.0-rslib-esm.0",
|
|
4
|
+
"main": "./lib/esm/index.js",
|
|
5
5
|
"module": "./lib/esm/index.js",
|
|
6
6
|
"description": "Use AI Agents to generate your contents",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"build": "
|
|
9
|
-
"build:watch": "
|
|
8
|
+
"build": "node ../../scripts/build/clean.mjs && rslib build --no-env",
|
|
9
|
+
"build:watch": "node ../../scripts/build/clean.mjs && rslib build --watch --no-env",
|
|
10
10
|
"test": "../../node_modules/.bin/jest --coverage",
|
|
11
|
-
"prepublishOnly": "
|
|
11
|
+
"prepublishOnly": "npm run build && npm run test && npm run lint",
|
|
12
12
|
"lint": "biome check --write src/ tests/",
|
|
13
13
|
"lint:check": "biome check src/ tests/",
|
|
14
14
|
"format": "biome format --write src/ tests/"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@botonic/core": "^0.
|
|
17
|
+
"@botonic/core": "^0.57.0-rslib-esm.0",
|
|
18
18
|
"@openai/agents": "^0.10.1",
|
|
19
19
|
"axios": "^1.18.1",
|
|
20
20
|
"openai": "^6.36.0",
|
|
@@ -45,5 +45,6 @@
|
|
|
45
45
|
"typescript",
|
|
46
46
|
"javascript"
|
|
47
47
|
],
|
|
48
|
-
"author": ""
|
|
48
|
+
"author": "",
|
|
49
|
+
"types": "./lib/esm/index.d.ts"
|
|
49
50
|
}
|
|
@@ -3,7 +3,6 @@ import { z } from 'zod'
|
|
|
3
3
|
import { BotExecutorSchema } from './bot-executor'
|
|
4
4
|
import { CarouselSchema } from './carousel'
|
|
5
5
|
import { ExitSchema } from './exit'
|
|
6
|
-
import { RequestContactInfoSchema } from './request-contact-info'
|
|
7
6
|
import { TextSchema } from './text'
|
|
8
7
|
import { TextWithButtonsSchema } from './text-with-buttons'
|
|
9
8
|
|
|
@@ -17,7 +16,6 @@ const baseMessageSchemas = [
|
|
|
17
16
|
CarouselSchema,
|
|
18
17
|
ExitSchema,
|
|
19
18
|
BotExecutorSchema,
|
|
20
|
-
RequestContactInfoSchema,
|
|
21
19
|
] as const
|
|
22
20
|
export const OutputSchema = z
|
|
23
21
|
.object({
|
package/src/types.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
2
|
AgenticOutputMessage,
|
|
3
3
|
AiAgentArgs,
|
|
4
|
-
|
|
4
|
+
BotContext,
|
|
5
5
|
GuardrailRule,
|
|
6
6
|
InferenceResponse,
|
|
7
|
-
|
|
7
|
+
ResolvedPlugins,
|
|
8
8
|
RunResult,
|
|
9
9
|
} from '@botonic/core'
|
|
10
10
|
import type {
|
|
@@ -97,7 +97,7 @@ export interface ResultRawResponse {
|
|
|
97
97
|
|
|
98
98
|
export type AgenticInputMessage = AgentInputItem
|
|
99
99
|
|
|
100
|
-
export {
|
|
100
|
+
export type {
|
|
101
101
|
AgenticOutputMessage,
|
|
102
102
|
AiAgentArgs,
|
|
103
103
|
GuardrailRule,
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { AgentOutputType, InputGuardrail, Model, ModelSettings } from '@openai/agents';
|
|
2
|
-
import type { z } from 'zod';
|
|
3
|
-
import type { GuardrailTrackingContext } from '../guardrails/input';
|
|
4
|
-
import type { LLMConfig } from '../llm-config';
|
|
5
|
-
import { type OutputSchema } from '../structured-output';
|
|
6
|
-
import type { GuardrailRule } from '../types';
|
|
7
|
-
export interface BaseAgentOptions {
|
|
8
|
-
name: string;
|
|
9
|
-
instructions: string;
|
|
10
|
-
llmConfig: LLMConfig;
|
|
11
|
-
inputGuardrailRules: GuardrailRule[];
|
|
12
|
-
outputMessagesSchemas?: z.ZodObject[];
|
|
13
|
-
guardrailTrackingContext: GuardrailTrackingContext;
|
|
14
|
-
}
|
|
15
|
-
export declare abstract class BaseAgent {
|
|
16
|
-
protected name: string;
|
|
17
|
-
protected instructions: string;
|
|
18
|
-
protected llmConfig: LLMConfig;
|
|
19
|
-
private inputGuardrailRules;
|
|
20
|
-
private outputMessagesSchemas;
|
|
21
|
-
private guardrailTrackingContext;
|
|
22
|
-
constructor(options: BaseAgentOptions);
|
|
23
|
-
protected getAgentModelSettings(): ModelSettings;
|
|
24
|
-
protected getInputGuardrails(): Promise<InputGuardrail[]>;
|
|
25
|
-
protected getOutputType(): AgentOutputType<typeof OutputSchema>;
|
|
26
|
-
protected addOutputInstructions(instructions: string): string;
|
|
27
|
-
protected getModel(): Promise<string | Model>;
|
|
28
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BaseAgent = void 0;
|
|
4
|
-
const guardrails_1 = require("../guardrails");
|
|
5
|
-
const structured_output_1 = require("../structured-output");
|
|
6
|
-
class BaseAgent {
|
|
7
|
-
constructor(options) {
|
|
8
|
-
this.name = options.name;
|
|
9
|
-
this.instructions = options.instructions;
|
|
10
|
-
this.llmConfig = options.llmConfig;
|
|
11
|
-
this.inputGuardrailRules = options.inputGuardrailRules;
|
|
12
|
-
this.outputMessagesSchemas = options.outputMessagesSchemas || [];
|
|
13
|
-
this.guardrailTrackingContext = options.guardrailTrackingContext;
|
|
14
|
-
}
|
|
15
|
-
getAgentModelSettings() {
|
|
16
|
-
const modelSettings = { ...this.llmConfig.modelSettings };
|
|
17
|
-
if (this.llmConfig.modelSettings.reasoning) {
|
|
18
|
-
modelSettings.reasoning = { ...this.llmConfig.modelSettings.reasoning };
|
|
19
|
-
}
|
|
20
|
-
if (this.llmConfig.modelSettings.text) {
|
|
21
|
-
modelSettings.text = { ...this.llmConfig.modelSettings.text };
|
|
22
|
-
}
|
|
23
|
-
return modelSettings;
|
|
24
|
-
}
|
|
25
|
-
async getInputGuardrails() {
|
|
26
|
-
return await (0, guardrails_1.createInputGuardrails)(this.inputGuardrailRules, this.llmConfig, this.guardrailTrackingContext);
|
|
27
|
-
}
|
|
28
|
-
getOutputType() {
|
|
29
|
-
return (0, structured_output_1.getOutputSchema)(this.outputMessagesSchemas);
|
|
30
|
-
}
|
|
31
|
-
addOutputInstructions(instructions) {
|
|
32
|
-
return `${instructions}\n\n${(0, structured_output_1.getOutputInstructions)()}`;
|
|
33
|
-
}
|
|
34
|
-
async getModel() {
|
|
35
|
-
return await this.llmConfig.getModel();
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
exports.BaseAgent = BaseAgent;
|
|
39
|
-
//# sourceMappingURL=base-agent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base-agent.js","sourceRoot":"","sources":["../../../src/agents/base-agent.ts"],"names":[],"mappings":";;;AAQA,8CAAqD;AAGrD,4DAI6B;AAY7B,MAAsB,SAAS;IAQ7B,YAAY,OAAyB;QACnC,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAA;QACxB,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAA;QACxC,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAA;QAClC,IAAI,CAAC,mBAAmB,GAAG,OAAO,CAAC,mBAAmB,CAAA;QACtD,IAAI,CAAC,qBAAqB,GAAG,OAAO,CAAC,qBAAqB,IAAI,EAAE,CAAA;QAChE,IAAI,CAAC,wBAAwB,GAAG,OAAO,CAAC,wBAAwB,CAAA;IAClE,CAAC;IAES,qBAAqB;QAC7B,MAAM,aAAa,GAAkB,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,aAAa,EAAE,CAAA;QAExE,IAAI,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,SAAS,EAAE,CAAC;YAC3C,aAAa,CAAC,SAAS,GAAG,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,SAAS,EAAE,CAAA;QACzE,CAAC;QAED,IAAI,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;YACtC,aAAa,CAAC,IAAI,GAAG,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,IAAI,EAAE,CAAA;QAC/D,CAAC;QAED,OAAO,aAAa,CAAA;IACtB,CAAC;IAES,KAAK,CAAC,kBAAkB;QAChC,OAAO,MAAM,IAAA,kCAAqB,EAChC,IAAI,CAAC,mBAAmB,EACxB,IAAI,CAAC,SAAS,EACd,IAAI,CAAC,wBAAwB,CAC9B,CAAA;IACH,CAAC;IAES,aAAa;QACrB,OAAO,IAAA,mCAAe,EAAC,IAAI,CAAC,qBAAqB,CAAC,CAAA;IACpD,CAAC;IAES,qBAAqB,CAAC,YAAoB;QAClD,OAAO,GAAG,YAAY,OAAO,IAAA,yCAAqB,GAAE,EAAE,CAAA;IACxD,CAAC;IAES,KAAK,CAAC,QAAQ;QACtB,OAAO,MAAM,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAA;IACxC,CAAC;CACF;AAlDD,8BAkDC"}
|
package/lib/cjs/agents/index.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SpecialistAgent = exports.RouterAgent = void 0;
|
|
4
|
-
var router_agent_1 = require("./router-agent");
|
|
5
|
-
Object.defineProperty(exports, "RouterAgent", { enumerable: true, get: function () { return router_agent_1.RouterAgent; } });
|
|
6
|
-
var specialist_agent_1 = require("./specialist-agent");
|
|
7
|
-
Object.defineProperty(exports, "SpecialistAgent", { enumerable: true, get: function () { return specialist_agent_1.SpecialistAgent; } });
|
|
8
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/agents/index.ts"],"names":[],"mappings":";;;AAAA,+CAA4C;AAAnC,2GAAA,WAAW,OAAA;AACpB,uDAAoD;AAA3C,mHAAA,eAAe,OAAA"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { ResolvedPlugins } from '@botonic/core';
|
|
2
|
-
import { type AgentOutputType, type Handoff } from '@openai/agents';
|
|
3
|
-
import type { z } from 'zod';
|
|
4
|
-
import type { GuardrailTrackingContext } from '../guardrails/input';
|
|
5
|
-
import type { LLMConfig } from '../llm-config';
|
|
6
|
-
import type { OutputSchema } from '../structured-output';
|
|
7
|
-
import type { AIAgent, Context, GuardrailRule } from '../types';
|
|
8
|
-
import { BaseAgent } from './base-agent';
|
|
9
|
-
interface RouterAgentOptions<TPlugins extends ResolvedPlugins = ResolvedPlugins, TExtraData = unknown> {
|
|
10
|
-
name: string;
|
|
11
|
-
instructions: string;
|
|
12
|
-
llmConfig: LLMConfig;
|
|
13
|
-
handoffs: Handoff<Context<TPlugins, TExtraData>, AgentOutputType<typeof OutputSchema>>[];
|
|
14
|
-
inputGuardrailRules: GuardrailRule[];
|
|
15
|
-
outputMessagesSchemas?: z.ZodObject[];
|
|
16
|
-
guardrailTrackingContext: GuardrailTrackingContext;
|
|
17
|
-
}
|
|
18
|
-
export declare class RouterAgent<TPlugins extends ResolvedPlugins = ResolvedPlugins, TExtraData = unknown> extends BaseAgent {
|
|
19
|
-
private handoffs;
|
|
20
|
-
private agent;
|
|
21
|
-
private constructor();
|
|
22
|
-
static create<TPlugins extends ResolvedPlugins = ResolvedPlugins, TExtraData = unknown>(options: RouterAgentOptions<TPlugins, TExtraData>): Promise<RouterAgent<TPlugins, TExtraData>>;
|
|
23
|
-
getAgent(): AIAgent<TPlugins, TExtraData>;
|
|
24
|
-
}
|
|
25
|
-
export {};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RouterAgent = void 0;
|
|
4
|
-
const agents_1 = require("@openai/agents");
|
|
5
|
-
const extensions_1 = require("@openai/agents-core/extensions");
|
|
6
|
-
const base_agent_1 = require("./base-agent");
|
|
7
|
-
class RouterAgent extends base_agent_1.BaseAgent {
|
|
8
|
-
constructor(options) {
|
|
9
|
-
super(options);
|
|
10
|
-
this.handoffs = options.handoffs;
|
|
11
|
-
}
|
|
12
|
-
static async create(options) {
|
|
13
|
-
const routerAgent = new RouterAgent(options);
|
|
14
|
-
const inputGuardrails = await routerAgent.getInputGuardrails();
|
|
15
|
-
// Agent.create is typed as Agent<UnknownContext>; we run with Context<TPlugins, TExtraData>.
|
|
16
|
-
const agent = agents_1.Agent.create({
|
|
17
|
-
name: routerAgent.name,
|
|
18
|
-
model: await routerAgent.getModel(),
|
|
19
|
-
modelSettings: routerAgent.getAgentModelSettings(),
|
|
20
|
-
instructions: routerAgent.addOutputInstructions(`${extensions_1.RECOMMENDED_PROMPT_PREFIX}${routerAgent.instructions}`),
|
|
21
|
-
handoffs: routerAgent.handoffs,
|
|
22
|
-
outputType: routerAgent.getOutputType(),
|
|
23
|
-
inputGuardrails,
|
|
24
|
-
});
|
|
25
|
-
routerAgent.agent = agent;
|
|
26
|
-
return routerAgent;
|
|
27
|
-
}
|
|
28
|
-
getAgent() {
|
|
29
|
-
return this.agent;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
exports.RouterAgent = RouterAgent;
|
|
33
|
-
//# sourceMappingURL=router-agent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"router-agent.js","sourceRoot":"","sources":["../../../src/agents/router-agent.ts"],"names":[],"mappings":";;;AACA,2CAA0E;AAC1E,+DAA0E;AAM1E,6CAAwC;AAkBxC,MAAa,WAGX,SAAQ,sBAAS;IAOjB,YAAoB,OAAiD;QACnE,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAA;IAClC,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,MAAM,CAIjB,OAAiD;QAEjD,MAAM,WAAW,GAAG,IAAI,WAAW,CAAuB,OAAO,CAAC,CAAA;QAClE,MAAM,eAAe,GAAG,MAAM,WAAW,CAAC,kBAAkB,EAAE,CAAA;QAE9D,6FAA6F;QAC7F,MAAM,KAAK,GAAG,cAAK,CAAC,MAAM,CAAC;YACzB,IAAI,EAAE,WAAW,CAAC,IAAI;YACtB,KAAK,EAAE,MAAM,WAAW,CAAC,QAAQ,EAAE;YACnC,aAAa,EAAE,WAAW,CAAC,qBAAqB,EAAE;YAClD,YAAY,EAAE,WAAW,CAAC,qBAAqB,CAC7C,GAAG,sCAAyB,GAAG,WAAW,CAAC,YAAY,EAAE,CAC1D;YACD,QAAQ,EAAE,WAAW,CAAC,QAAQ;YAC9B,UAAU,EAAE,WAAW,CAAC,aAAa,EAAE;YACvC,eAAe;SAChB,CAAkC,CAAA;QAEnC,WAAW,CAAC,KAAK,GAAG,KAAK,CAAA;QACzB,OAAO,WAAW,CAAA;IACpB,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,KAAK,CAAA;IACnB,CAAC;CACF;AA5CD,kCA4CC"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import type { CampaignV2, ContactInfo, ResolvedPlugins } from '@botonic/core';
|
|
2
|
-
import type { z } from 'zod';
|
|
3
|
-
import type { DebugLogger } from '../debug-logger';
|
|
4
|
-
import type { GuardrailTrackingContext } from '../guardrails/input';
|
|
5
|
-
import type { LLMConfig } from '../llm-config';
|
|
6
|
-
import type { AIAgent, GuardrailRule, Tool } from '../types';
|
|
7
|
-
import { BaseAgent } from './base-agent';
|
|
8
|
-
interface SpecialistAgentOptions<TPlugins extends ResolvedPlugins = ResolvedPlugins, TExtraData = unknown> {
|
|
9
|
-
name: string;
|
|
10
|
-
instructions: string;
|
|
11
|
-
tools: Tool<TPlugins, TExtraData>[];
|
|
12
|
-
campaignsContext?: CampaignV2[];
|
|
13
|
-
contactInfo: ContactInfo[];
|
|
14
|
-
inputGuardrailRules: GuardrailRule[];
|
|
15
|
-
sourceIds: string[];
|
|
16
|
-
outputMessagesSchemas?: z.ZodObject[];
|
|
17
|
-
llmConfig: LLMConfig;
|
|
18
|
-
logger: DebugLogger;
|
|
19
|
-
guardrailTrackingContext: GuardrailTrackingContext;
|
|
20
|
-
forceToolNameOverride?: string;
|
|
21
|
-
disableForceRetrieveKnowledge?: boolean;
|
|
22
|
-
}
|
|
23
|
-
export declare class SpecialistAgent<TPlugins extends ResolvedPlugins = ResolvedPlugins, TExtraData = unknown> extends BaseAgent {
|
|
24
|
-
private tools;
|
|
25
|
-
private logger;
|
|
26
|
-
private agent;
|
|
27
|
-
private forceToolNameOverride?;
|
|
28
|
-
private disableForceRetrieveKnowledge?;
|
|
29
|
-
private constructor();
|
|
30
|
-
static create<TPlugins extends ResolvedPlugins = ResolvedPlugins, TExtraData = unknown>(options: SpecialistAgentOptions<TPlugins, TExtraData>): Promise<SpecialistAgent<TPlugins, TExtraData>>;
|
|
31
|
-
getAgent(): AIAgent<TPlugins, TExtraData>;
|
|
32
|
-
private getSpecialistModelSettings;
|
|
33
|
-
private addExtraInstructions;
|
|
34
|
-
private getContactInfoInstructions;
|
|
35
|
-
private getMetadataInstructions;
|
|
36
|
-
private getCampaignInstructions;
|
|
37
|
-
private addHubtypeTools;
|
|
38
|
-
}
|
|
39
|
-
export {};
|