@purpleschool/gptbot 0.13.25 → 0.13.26
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/api/controllers/http/agents/agent-document.ts +1 -0
- package/build/api/controllers/http/agents/agent-document.js +1 -0
- package/build/commands/agents/agent-document/add-document-from-url.command.js +20 -0
- package/build/commands/agents/agent-document/index.js +1 -0
- package/build/constants/agents/enums/index.js +1 -0
- package/build/constants/agents/enums/url-ingestion-strategy.enum.js +10 -0
- package/build/models/agents/agent-document.schema.js +1 -0
- package/commands/agents/agent-document/add-document-from-url.command.ts +24 -0
- package/commands/agents/agent-document/index.ts +1 -0
- package/constants/agents/enums/index.ts +1 -0
- package/constants/agents/enums/url-ingestion-strategy.enum.ts +6 -0
- package/models/agents/agent-document.schema.ts +1 -0
- package/package.json +1 -1
|
@@ -5,4 +5,5 @@ export const AGENT_DOCUMENT_ROUTES = {
|
|
|
5
5
|
GET_BY_ID: (agentId: string, documentId: string) => `${agentId}/${documentId}`,
|
|
6
6
|
DELETE: (agentId: string, documentId: string) => `${agentId}/${documentId}`,
|
|
7
7
|
UPLOAD: (agentId: string) => `${agentId}/upload`,
|
|
8
|
+
ADD_FROM_URL: (agentId: string) => `${agentId}/add-from-url`,
|
|
8
9
|
} as const;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AddDocumentFromUrlCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
var AddDocumentFromUrlCommand;
|
|
6
|
+
(function (AddDocumentFromUrlCommand) {
|
|
7
|
+
AddDocumentFromUrlCommand.RequestParamsSchema = zod_1.z.object({
|
|
8
|
+
agentId: zod_1.z.string().uuid(),
|
|
9
|
+
});
|
|
10
|
+
AddDocumentFromUrlCommand.RequestBodySchema = zod_1.z.object({
|
|
11
|
+
url: zod_1.z.string().url(),
|
|
12
|
+
});
|
|
13
|
+
AddDocumentFromUrlCommand.ResponseDataSchema = zod_1.z.object({
|
|
14
|
+
sourceId: zod_1.z.string().uuid(),
|
|
15
|
+
accepted: zod_1.z.literal(true),
|
|
16
|
+
});
|
|
17
|
+
AddDocumentFromUrlCommand.ResponseSchema = zod_1.z.object({
|
|
18
|
+
data: AddDocumentFromUrlCommand.ResponseDataSchema,
|
|
19
|
+
});
|
|
20
|
+
})(AddDocumentFromUrlCommand || (exports.AddDocumentFromUrlCommand = AddDocumentFromUrlCommand = {}));
|
|
@@ -18,3 +18,4 @@ __exportStar(require("./find-agent-documents.command"), exports);
|
|
|
18
18
|
__exportStar(require("./get-agent-document-by-id.command"), exports);
|
|
19
19
|
__exportStar(require("./delete-agent-document.command"), exports);
|
|
20
20
|
__exportStar(require("./upload-agent-document.command"), exports);
|
|
21
|
+
__exportStar(require("./add-document-from-url.command"), exports);
|
|
@@ -22,3 +22,4 @@ __exportStar(require("./agent-tool-status.enum"), exports);
|
|
|
22
22
|
__exportStar(require("./agent-document-status.enum"), exports);
|
|
23
23
|
__exportStar(require("./dialog-status.enum"), exports);
|
|
24
24
|
__exportStar(require("./message-sender-type.enum"), exports);
|
|
25
|
+
__exportStar(require("./url-ingestion-strategy.enum"), exports);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.URL_INGESTION_STRATEGY_TYPE = void 0;
|
|
4
|
+
var URL_INGESTION_STRATEGY_TYPE;
|
|
5
|
+
(function (URL_INGESTION_STRATEGY_TYPE) {
|
|
6
|
+
URL_INGESTION_STRATEGY_TYPE["SINGLE_PAGE_FETCH"] = "single_page_fetch";
|
|
7
|
+
URL_INGESTION_STRATEGY_TYPE["FETCH_CRAWLER"] = "fetch_crawler";
|
|
8
|
+
URL_INGESTION_STRATEGY_TYPE["SINGLE_PAGE_CSR"] = "single_page_csr";
|
|
9
|
+
URL_INGESTION_STRATEGY_TYPE["CSR_CRAWLER"] = "csr_crawler";
|
|
10
|
+
})(URL_INGESTION_STRATEGY_TYPE || (exports.URL_INGESTION_STRATEGY_TYPE = URL_INGESTION_STRATEGY_TYPE = {}));
|
|
@@ -11,6 +11,7 @@ exports.AgentDocumentSchema = zod_1.z.object({
|
|
|
11
11
|
fileSize: zod_1.z.number().optional(),
|
|
12
12
|
contentType: zod_1.z.string(),
|
|
13
13
|
status: zod_1.z.nativeEnum(enums_1.AGENT_DOCUMENT_STATUS),
|
|
14
|
+
sourceId: zod_1.z.string().uuid().optional(),
|
|
14
15
|
chunksCount: zod_1.z.number().optional(),
|
|
15
16
|
isDeleted: zod_1.z.boolean(),
|
|
16
17
|
createdAt: zod_1.z.date(),
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export namespace AddDocumentFromUrlCommand {
|
|
4
|
+
export const RequestParamsSchema = z.object({
|
|
5
|
+
agentId: z.string().uuid(),
|
|
6
|
+
});
|
|
7
|
+
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
8
|
+
|
|
9
|
+
export const RequestBodySchema = z.object({
|
|
10
|
+
url: z.string().url(),
|
|
11
|
+
});
|
|
12
|
+
export type RequestBody = z.infer<typeof RequestBodySchema>;
|
|
13
|
+
|
|
14
|
+
export const ResponseDataSchema = z.object({
|
|
15
|
+
sourceId: z.string().uuid(),
|
|
16
|
+
accepted: z.literal(true),
|
|
17
|
+
});
|
|
18
|
+
export type ResponseData = z.infer<typeof ResponseDataSchema>;
|
|
19
|
+
|
|
20
|
+
export const ResponseSchema = z.object({
|
|
21
|
+
data: ResponseDataSchema,
|
|
22
|
+
});
|
|
23
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
24
|
+
}
|
|
@@ -9,6 +9,7 @@ export const AgentDocumentSchema = z.object({
|
|
|
9
9
|
fileSize: z.number().optional(),
|
|
10
10
|
contentType: z.string(),
|
|
11
11
|
status: z.nativeEnum(AGENT_DOCUMENT_STATUS),
|
|
12
|
+
sourceId: z.string().uuid().optional(),
|
|
12
13
|
chunksCount: z.number().optional(),
|
|
13
14
|
isDeleted: z.boolean(),
|
|
14
15
|
createdAt: z.date(),
|