@reminix/sdk 0.12.0 → 0.14.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/CHANGELOG.md +21 -0
- package/client.d.mts +8 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +8 -2
- package/client.d.ts.map +1 -1
- package/client.js +6 -0
- package/client.js.map +1 -1
- package/client.mjs +6 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/agents.d.mts +123 -30
- package/resources/agents.d.mts.map +1 -1
- package/resources/agents.d.ts +123 -30
- package/resources/agents.d.ts.map +1 -1
- package/resources/agents.js.map +1 -1
- package/resources/agents.mjs.map +1 -1
- package/resources/execution-logs.d.mts +3 -3
- package/resources/execution-logs.d.mts.map +1 -1
- package/resources/execution-logs.d.ts +3 -3
- package/resources/execution-logs.d.ts.map +1 -1
- package/resources/execution-logs.js +1 -1
- package/resources/execution-logs.mjs +1 -1
- package/resources/index.d.mts +3 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +3 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -0
- package/resources/index.mjs.map +1 -1
- package/resources/knowledge/collections/collections.d.mts +89 -0
- package/resources/knowledge/collections/collections.d.mts.map +1 -0
- package/resources/knowledge/collections/collections.d.ts +89 -0
- package/resources/knowledge/collections/collections.d.ts.map +1 -0
- package/resources/knowledge/collections/collections.js +56 -0
- package/resources/knowledge/collections/collections.js.map +1 -0
- package/resources/knowledge/collections/collections.mjs +51 -0
- package/resources/knowledge/collections/collections.mjs.map +1 -0
- package/resources/knowledge/collections/documents.d.mts +121 -0
- package/resources/knowledge/collections/documents.d.mts.map +1 -0
- package/resources/knowledge/collections/documents.d.ts +121 -0
- package/resources/knowledge/collections/documents.d.ts.map +1 -0
- package/resources/knowledge/collections/documents.js +62 -0
- package/resources/knowledge/collections/documents.js.map +1 -0
- package/resources/knowledge/collections/documents.mjs +58 -0
- package/resources/knowledge/collections/documents.mjs.map +1 -0
- package/resources/knowledge/collections/index.d.mts +3 -0
- package/resources/knowledge/collections/index.d.mts.map +1 -0
- package/resources/knowledge/collections/index.d.ts +3 -0
- package/resources/knowledge/collections/index.d.ts.map +1 -0
- package/resources/knowledge/collections/index.js +9 -0
- package/resources/knowledge/collections/index.js.map +1 -0
- package/resources/knowledge/collections/index.mjs +4 -0
- package/resources/knowledge/collections/index.mjs.map +1 -0
- package/resources/knowledge/collections.d.mts +2 -0
- package/resources/knowledge/collections.d.mts.map +1 -0
- package/resources/knowledge/collections.d.ts +2 -0
- package/resources/knowledge/collections.d.ts.map +1 -0
- package/resources/knowledge/collections.js +6 -0
- package/resources/knowledge/collections.js.map +1 -0
- package/resources/knowledge/collections.mjs +3 -0
- package/resources/knowledge/collections.mjs.map +1 -0
- package/resources/knowledge/index.d.mts +3 -0
- package/resources/knowledge/index.d.mts.map +1 -0
- package/resources/knowledge/index.d.ts +3 -0
- package/resources/knowledge/index.d.ts.map +1 -0
- package/resources/knowledge/index.js +9 -0
- package/resources/knowledge/index.js.map +1 -0
- package/resources/knowledge/index.mjs +4 -0
- package/resources/knowledge/index.mjs.map +1 -0
- package/resources/knowledge/knowledge.d.mts +65 -0
- package/resources/knowledge/knowledge.d.mts.map +1 -0
- package/resources/knowledge/knowledge.d.ts +65 -0
- package/resources/knowledge/knowledge.d.ts.map +1 -0
- package/resources/knowledge/knowledge.js +26 -0
- package/resources/knowledge/knowledge.js.map +1 -0
- package/resources/knowledge/knowledge.mjs +21 -0
- package/resources/knowledge/knowledge.mjs.map +1 -0
- package/resources/knowledge.d.mts +2 -0
- package/resources/knowledge.d.mts.map +1 -0
- package/resources/knowledge.d.ts +2 -0
- package/resources/knowledge.d.ts.map +1 -0
- package/resources/knowledge.js +6 -0
- package/resources/knowledge.js.map +1 -0
- package/resources/knowledge.mjs +3 -0
- package/resources/knowledge.mjs.map +1 -0
- package/resources/memory.d.mts +148 -0
- package/resources/memory.d.mts.map +1 -0
- package/resources/memory.d.ts +148 -0
- package/resources/memory.d.ts.map +1 -0
- package/resources/memory.js +82 -0
- package/resources/memory.js.map +1 -0
- package/resources/memory.mjs +78 -0
- package/resources/memory.mjs.map +1 -0
- package/resources/tools.d.mts +70 -12
- package/resources/tools.d.mts.map +1 -1
- package/resources/tools.d.ts +70 -12
- package/resources/tools.d.ts.map +1 -1
- package/src/client.ts +30 -0
- package/src/resources/agents.ts +140 -33
- package/src/resources/execution-logs.ts +3 -3
- package/src/resources/index.ts +10 -0
- package/src/resources/knowledge/collections/collections.ts +167 -0
- package/src/resources/knowledge/collections/documents.ts +200 -0
- package/src/resources/knowledge/collections/index.ts +22 -0
- package/src/resources/knowledge/collections.ts +3 -0
- package/src/resources/knowledge/index.ts +11 -0
- package/src/resources/knowledge/knowledge.ts +101 -0
- package/src/resources/knowledge.ts +3 -0
- package/src/resources/memory.ts +188 -0
- package/src/resources/tools.ts +80 -12
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -20,7 +20,7 @@ class ExecutionLogs extends resource_1.APIResource {
|
|
|
20
20
|
*
|
|
21
21
|
* **Filters:**
|
|
22
22
|
*
|
|
23
|
-
* - `type`: Filter by execution type (
|
|
23
|
+
* - `type`: Filter by execution type (agent_invoke, agent_chat, tool_call)
|
|
24
24
|
* - `source`: Filter by request source (api, cli, dashboard, widget, sdk)
|
|
25
25
|
* - `name`: Filter by agent or tool name
|
|
26
26
|
* - `status`: Filter by result status (success, error, timeout)
|
|
@@ -17,7 +17,7 @@ export class ExecutionLogs extends APIResource {
|
|
|
17
17
|
*
|
|
18
18
|
* **Filters:**
|
|
19
19
|
*
|
|
20
|
-
* - `type`: Filter by execution type (
|
|
20
|
+
* - `type`: Filter by execution type (agent_invoke, agent_chat, tool_call)
|
|
21
21
|
* - `source`: Filter by request source (api, cli, dashboard, widget, sdk)
|
|
22
22
|
* - `name`: Filter by agent or tool name
|
|
23
23
|
* - `status`: Filter by result status (success, error, timeout)
|
package/resources/index.d.mts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
export { Agents, type Agent, type AgentConfig, type ChatMessage, type StreamChunk, type AgentChatResponse, type AgentInvokeResponse, type AgentListParams, type AgentChatParams, type AgentChatParamsNonStreaming, type AgentChatParamsStreaming, type AgentInvokeParams, type AgentInvokeParamsNonStreaming, type AgentInvokeParamsStreaming, type AgentsCursor, } from "./agents.mjs";
|
|
1
|
+
export { Agents, type Agent, type AgentConfig, type AgentKnowledgeBaseConfig, type AgentMemoryConfig, type ChatMessage, type StreamChunk, type AgentChatResponse, type AgentInvokeResponse, type AgentListParams, type AgentChatParams, type AgentChatParamsNonStreaming, type AgentChatParamsStreaming, type AgentInvokeParams, type AgentInvokeParamsNonStreaming, type AgentInvokeParamsStreaming, type AgentsCursor, } from "./agents.mjs";
|
|
2
2
|
export { ClientTokens, type ClientTokenCreateResponse, type ClientTokenCreateParams } from "./client-tokens.mjs";
|
|
3
3
|
export { Conversations, type Conversation, type ConversationRetrieveResponse, type ConversationListParams, type ConversationsCursor, } from "./conversations.mjs";
|
|
4
4
|
export { ExecutionLogs, type ExecutionLog, type ExecutionLogListParams, type ExecutionLogsCursor, } from "./execution-logs.mjs";
|
|
5
|
+
export { Knowledge, type KnowledgeSearchResponse, type KnowledgeSearchParams } from "./knowledge/knowledge.mjs";
|
|
6
|
+
export { MemoryResource, type Memory, type MemoryListResponse, type MemoryDeleteAllResponse, type MemoryStoreParams, } from "./memory.mjs";
|
|
5
7
|
export { Projects, type Project } from "./projects.mjs";
|
|
6
8
|
export { Tools, type Tool, type ToolCallResponse, type ToolListParams, type ToolCallParams, type ToolsCursor, } from "./tools.mjs";
|
|
7
9
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"OAEO,EACL,MAAM,EACN,KAAK,KAAK,EACV,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,2BAA2B,EAChC,KAAK,wBAAwB,EAC7B,KAAK,iBAAiB,EACtB,KAAK,6BAA6B,EAClC,KAAK,0BAA0B,EAC/B,KAAK,YAAY,GAClB;OACM,EAAE,YAAY,EAAE,KAAK,yBAAyB,EAAE,KAAK,uBAAuB,EAAE;OAC9E,EACL,aAAa,EACb,KAAK,YAAY,EACjB,KAAK,4BAA4B,EACjC,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,GACzB;OACM,EACL,aAAa,EACb,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,GACzB;OACM,EAAE,QAAQ,EAAE,KAAK,OAAO,EAAE;OAC1B,EACL,KAAK,EACL,KAAK,IAAI,EACT,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,WAAW,GACjB"}
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"OAEO,EACL,MAAM,EACN,KAAK,KAAK,EACV,KAAK,WAAW,EAChB,KAAK,wBAAwB,EAC7B,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,2BAA2B,EAChC,KAAK,wBAAwB,EAC7B,KAAK,iBAAiB,EACtB,KAAK,6BAA6B,EAClC,KAAK,0BAA0B,EAC/B,KAAK,YAAY,GAClB;OACM,EAAE,YAAY,EAAE,KAAK,yBAAyB,EAAE,KAAK,uBAAuB,EAAE;OAC9E,EACL,aAAa,EACb,KAAK,YAAY,EACjB,KAAK,4BAA4B,EACjC,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,GACzB;OACM,EACL,aAAa,EACb,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,GACzB;OACM,EAAE,SAAS,EAAE,KAAK,uBAAuB,EAAE,KAAK,qBAAqB,EAAE;OACvE,EACL,cAAc,EACd,KAAK,MAAM,EACX,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,GACvB;OACM,EAAE,QAAQ,EAAE,KAAK,OAAO,EAAE;OAC1B,EACL,KAAK,EACL,KAAK,IAAI,EACT,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,WAAW,GACjB"}
|
package/resources/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
export { Agents, type Agent, type AgentConfig, type ChatMessage, type StreamChunk, type AgentChatResponse, type AgentInvokeResponse, type AgentListParams, type AgentChatParams, type AgentChatParamsNonStreaming, type AgentChatParamsStreaming, type AgentInvokeParams, type AgentInvokeParamsNonStreaming, type AgentInvokeParamsStreaming, type AgentsCursor, } from "./agents.js";
|
|
1
|
+
export { Agents, type Agent, type AgentConfig, type AgentKnowledgeBaseConfig, type AgentMemoryConfig, type ChatMessage, type StreamChunk, type AgentChatResponse, type AgentInvokeResponse, type AgentListParams, type AgentChatParams, type AgentChatParamsNonStreaming, type AgentChatParamsStreaming, type AgentInvokeParams, type AgentInvokeParamsNonStreaming, type AgentInvokeParamsStreaming, type AgentsCursor, } from "./agents.js";
|
|
2
2
|
export { ClientTokens, type ClientTokenCreateResponse, type ClientTokenCreateParams } from "./client-tokens.js";
|
|
3
3
|
export { Conversations, type Conversation, type ConversationRetrieveResponse, type ConversationListParams, type ConversationsCursor, } from "./conversations.js";
|
|
4
4
|
export { ExecutionLogs, type ExecutionLog, type ExecutionLogListParams, type ExecutionLogsCursor, } from "./execution-logs.js";
|
|
5
|
+
export { Knowledge, type KnowledgeSearchResponse, type KnowledgeSearchParams } from "./knowledge/knowledge.js";
|
|
6
|
+
export { MemoryResource, type Memory, type MemoryListResponse, type MemoryDeleteAllResponse, type MemoryStoreParams, } from "./memory.js";
|
|
5
7
|
export { Projects, type Project } from "./projects.js";
|
|
6
8
|
export { Tools, type Tool, type ToolCallResponse, type ToolListParams, type ToolCallParams, type ToolsCursor, } from "./tools.js";
|
|
7
9
|
//# sourceMappingURL=index.d.ts.map
|
package/resources/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"OAEO,EACL,MAAM,EACN,KAAK,KAAK,EACV,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,2BAA2B,EAChC,KAAK,wBAAwB,EAC7B,KAAK,iBAAiB,EACtB,KAAK,6BAA6B,EAClC,KAAK,0BAA0B,EAC/B,KAAK,YAAY,GAClB;OACM,EAAE,YAAY,EAAE,KAAK,yBAAyB,EAAE,KAAK,uBAAuB,EAAE;OAC9E,EACL,aAAa,EACb,KAAK,YAAY,EACjB,KAAK,4BAA4B,EACjC,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,GACzB;OACM,EACL,aAAa,EACb,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,GACzB;OACM,EAAE,QAAQ,EAAE,KAAK,OAAO,EAAE;OAC1B,EACL,KAAK,EACL,KAAK,IAAI,EACT,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,WAAW,GACjB"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"OAEO,EACL,MAAM,EACN,KAAK,KAAK,EACV,KAAK,WAAW,EAChB,KAAK,wBAAwB,EAC7B,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,2BAA2B,EAChC,KAAK,wBAAwB,EAC7B,KAAK,iBAAiB,EACtB,KAAK,6BAA6B,EAClC,KAAK,0BAA0B,EAC/B,KAAK,YAAY,GAClB;OACM,EAAE,YAAY,EAAE,KAAK,yBAAyB,EAAE,KAAK,uBAAuB,EAAE;OAC9E,EACL,aAAa,EACb,KAAK,YAAY,EACjB,KAAK,4BAA4B,EACjC,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,GACzB;OACM,EACL,aAAa,EACb,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,GACzB;OACM,EAAE,SAAS,EAAE,KAAK,uBAAuB,EAAE,KAAK,qBAAqB,EAAE;OACvE,EACL,cAAc,EACd,KAAK,MAAM,EACX,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,GACvB;OACM,EAAE,QAAQ,EAAE,KAAK,OAAO,EAAE;OAC1B,EACL,KAAK,EACL,KAAK,IAAI,EACT,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,WAAW,GACjB"}
|
package/resources/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Tools = exports.Projects = exports.ExecutionLogs = exports.Conversations = exports.ClientTokens = exports.Agents = void 0;
|
|
4
|
+
exports.Tools = exports.Projects = exports.MemoryResource = exports.Knowledge = exports.ExecutionLogs = exports.Conversations = exports.ClientTokens = exports.Agents = void 0;
|
|
5
5
|
var agents_1 = require("./agents.js");
|
|
6
6
|
Object.defineProperty(exports, "Agents", { enumerable: true, get: function () { return agents_1.Agents; } });
|
|
7
7
|
var client_tokens_1 = require("./client-tokens.js");
|
|
@@ -10,6 +10,10 @@ var conversations_1 = require("./conversations.js");
|
|
|
10
10
|
Object.defineProperty(exports, "Conversations", { enumerable: true, get: function () { return conversations_1.Conversations; } });
|
|
11
11
|
var execution_logs_1 = require("./execution-logs.js");
|
|
12
12
|
Object.defineProperty(exports, "ExecutionLogs", { enumerable: true, get: function () { return execution_logs_1.ExecutionLogs; } });
|
|
13
|
+
var knowledge_1 = require("./knowledge/knowledge.js");
|
|
14
|
+
Object.defineProperty(exports, "Knowledge", { enumerable: true, get: function () { return knowledge_1.Knowledge; } });
|
|
15
|
+
var memory_1 = require("./memory.js");
|
|
16
|
+
Object.defineProperty(exports, "MemoryResource", { enumerable: true, get: function () { return memory_1.MemoryResource; } });
|
|
13
17
|
var projects_1 = require("./projects.js");
|
|
14
18
|
Object.defineProperty(exports, "Projects", { enumerable: true, get: function () { return projects_1.Projects; } });
|
|
15
19
|
var tools_1 = require("./tools.js");
|
package/resources/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,sCAkBkB;AAjBhB,gGAAA,MAAM,OAAA;AAkBR,oDAA6G;AAApG,6GAAA,YAAY,OAAA;AACrB,oDAMyB;AALvB,8GAAA,aAAa,OAAA;AAMf,sDAK0B;AAJxB,+GAAA,aAAa,OAAA;AAKf,sDAA4G;AAAnG,sGAAA,SAAS,OAAA;AAClB,sCAMkB;AALhB,wGAAA,cAAc,OAAA;AAMhB,0CAAoD;AAA3C,oGAAA,QAAQ,OAAA;AACjB,oCAOiB;AANf,8FAAA,KAAK,OAAA"}
|
package/resources/index.mjs
CHANGED
|
@@ -3,6 +3,8 @@ export { Agents, } from "./agents.mjs";
|
|
|
3
3
|
export { ClientTokens } from "./client-tokens.mjs";
|
|
4
4
|
export { Conversations, } from "./conversations.mjs";
|
|
5
5
|
export { ExecutionLogs, } from "./execution-logs.mjs";
|
|
6
|
+
export { Knowledge } from "./knowledge/knowledge.mjs";
|
|
7
|
+
export { MemoryResource, } from "./memory.mjs";
|
|
6
8
|
export { Projects } from "./projects.mjs";
|
|
7
9
|
export { Tools, } from "./tools.mjs";
|
|
8
10
|
//# sourceMappingURL=index.mjs.map
|
package/resources/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,MAAM,
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,MAAM,GAiBP;OACM,EAAE,YAAY,EAAgE;OAC9E,EACL,aAAa,GAKd;OACM,EACL,aAAa,GAId;OACM,EAAE,SAAS,EAA4D;OACvE,EACL,cAAc,GAKf;OACM,EAAE,QAAQ,EAAgB;OAC1B,EACL,KAAK,GAMN"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
2
|
+
import * as DocumentsAPI from "./documents.mjs";
|
|
3
|
+
import { DocumentDeleteParams, DocumentListParams, DocumentProcessParams, DocumentProcessResponse, DocumentRetrieveParams, DocumentUploadParams, DocumentUploadResponse, Documents, KnowledgeDocument, KnowledgeDocumentsCursor } from "./documents.mjs";
|
|
4
|
+
import { APIPromise } from "../../../core/api-promise.mjs";
|
|
5
|
+
import { Cursor, type CursorParams, PagePromise } from "../../../core/pagination.mjs";
|
|
6
|
+
import { RequestOptions } from "../../../internal/request-options.mjs";
|
|
7
|
+
export declare class Collections extends APIResource {
|
|
8
|
+
documents: DocumentsAPI.Documents;
|
|
9
|
+
/**
|
|
10
|
+
* Create a new knowledge collection for storing documents.
|
|
11
|
+
*/
|
|
12
|
+
create(body: CollectionCreateParams, options?: RequestOptions): APIPromise<KnowledgeCollection>;
|
|
13
|
+
/**
|
|
14
|
+
* Get details of a knowledge collection including document stats.
|
|
15
|
+
*/
|
|
16
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<KnowledgeCollection>;
|
|
17
|
+
/**
|
|
18
|
+
* Update a knowledge collection name or description.
|
|
19
|
+
*/
|
|
20
|
+
update(id: string, body?: CollectionUpdateParams | null | undefined, options?: RequestOptions): APIPromise<KnowledgeCollection>;
|
|
21
|
+
/**
|
|
22
|
+
* List all knowledge collections for the project.
|
|
23
|
+
*/
|
|
24
|
+
list(query?: CollectionListParams | null | undefined, options?: RequestOptions): PagePromise<KnowledgeCollectionsCursor, KnowledgeCollection>;
|
|
25
|
+
/**
|
|
26
|
+
* Delete a knowledge collection and all its documents.
|
|
27
|
+
*/
|
|
28
|
+
delete(id: string, options?: RequestOptions): APIPromise<void>;
|
|
29
|
+
}
|
|
30
|
+
export type KnowledgeCollectionsCursor = Cursor<KnowledgeCollection>;
|
|
31
|
+
export interface KnowledgeCollection {
|
|
32
|
+
/**
|
|
33
|
+
* Unique collection ID
|
|
34
|
+
*/
|
|
35
|
+
id: string;
|
|
36
|
+
/**
|
|
37
|
+
* When the collection was created
|
|
38
|
+
*/
|
|
39
|
+
createdAt: string;
|
|
40
|
+
/**
|
|
41
|
+
* Collection description
|
|
42
|
+
*/
|
|
43
|
+
description: string | null;
|
|
44
|
+
/**
|
|
45
|
+
* Embedding model used
|
|
46
|
+
*/
|
|
47
|
+
embeddingModel: string;
|
|
48
|
+
/**
|
|
49
|
+
* Collection name
|
|
50
|
+
*/
|
|
51
|
+
name: string;
|
|
52
|
+
/**
|
|
53
|
+
* Project ID
|
|
54
|
+
*/
|
|
55
|
+
projectId: string;
|
|
56
|
+
/**
|
|
57
|
+
* When the collection was last updated
|
|
58
|
+
*/
|
|
59
|
+
updatedAt: string;
|
|
60
|
+
/**
|
|
61
|
+
* Total number of documents
|
|
62
|
+
*/
|
|
63
|
+
documentCount?: number;
|
|
64
|
+
/**
|
|
65
|
+
* Number of processed documents
|
|
66
|
+
*/
|
|
67
|
+
readyDocumentCount?: number;
|
|
68
|
+
}
|
|
69
|
+
export interface CollectionCreateParams {
|
|
70
|
+
/**
|
|
71
|
+
* Collection name
|
|
72
|
+
*/
|
|
73
|
+
name: string;
|
|
74
|
+
/**
|
|
75
|
+
* Collection description
|
|
76
|
+
*/
|
|
77
|
+
description?: string;
|
|
78
|
+
}
|
|
79
|
+
export interface CollectionUpdateParams {
|
|
80
|
+
description?: string;
|
|
81
|
+
name?: string;
|
|
82
|
+
}
|
|
83
|
+
export interface CollectionListParams extends CursorParams {
|
|
84
|
+
}
|
|
85
|
+
export declare namespace Collections {
|
|
86
|
+
export { type KnowledgeCollection as KnowledgeCollection, type KnowledgeCollectionsCursor as KnowledgeCollectionsCursor, type CollectionCreateParams as CollectionCreateParams, type CollectionUpdateParams as CollectionUpdateParams, type CollectionListParams as CollectionListParams, };
|
|
87
|
+
export { Documents as Documents, type KnowledgeDocument as KnowledgeDocument, type DocumentProcessResponse as DocumentProcessResponse, type DocumentUploadResponse as DocumentUploadResponse, type KnowledgeDocumentsCursor as KnowledgeDocumentsCursor, type DocumentRetrieveParams as DocumentRetrieveParams, type DocumentListParams as DocumentListParams, type DocumentDeleteParams as DocumentDeleteParams, type DocumentProcessParams as DocumentProcessParams, type DocumentUploadParams as DocumentUploadParams, };
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=collections.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collections.d.mts","sourceRoot":"","sources":["../../../src/resources/knowledge/collections/collections.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,YAAY;OACjB,EACL,oBAAoB,EACpB,kBAAkB,EAClB,qBAAqB,EACrB,uB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E,MAAM,CAAC;IAEb;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,sBAAsB;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,oBAAqB,SAAQ,YAAY;CAAG;AAI7D,MAAM,CAAC,OAAO,WAAW,WAAW,CAAC;IACnC,OAAO,EACL,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,oBAAoB,IAAI,oBAAoB,GAClD,CAAC;IAEF,OAAO,EACL,SAAS,IAAI,SAAS,EACtB,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,oBAAoB,IAAI,oBAAoB,GAClD,CAAC;CACH"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { APIResource } from "../../../core/resource.js";
|
|
2
|
+
import * as DocumentsAPI from "./documents.js";
|
|
3
|
+
import { DocumentDeleteParams, DocumentListParams, DocumentProcessParams, DocumentProcessResponse, DocumentRetrieveParams, DocumentUploadParams, DocumentUploadResponse, Documents, KnowledgeDocument, KnowledgeDocumentsCursor } from "./documents.js";
|
|
4
|
+
import { APIPromise } from "../../../core/api-promise.js";
|
|
5
|
+
import { Cursor, type CursorParams, PagePromise } from "../../../core/pagination.js";
|
|
6
|
+
import { RequestOptions } from "../../../internal/request-options.js";
|
|
7
|
+
export declare class Collections extends APIResource {
|
|
8
|
+
documents: DocumentsAPI.Documents;
|
|
9
|
+
/**
|
|
10
|
+
* Create a new knowledge collection for storing documents.
|
|
11
|
+
*/
|
|
12
|
+
create(body: CollectionCreateParams, options?: RequestOptions): APIPromise<KnowledgeCollection>;
|
|
13
|
+
/**
|
|
14
|
+
* Get details of a knowledge collection including document stats.
|
|
15
|
+
*/
|
|
16
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<KnowledgeCollection>;
|
|
17
|
+
/**
|
|
18
|
+
* Update a knowledge collection name or description.
|
|
19
|
+
*/
|
|
20
|
+
update(id: string, body?: CollectionUpdateParams | null | undefined, options?: RequestOptions): APIPromise<KnowledgeCollection>;
|
|
21
|
+
/**
|
|
22
|
+
* List all knowledge collections for the project.
|
|
23
|
+
*/
|
|
24
|
+
list(query?: CollectionListParams | null | undefined, options?: RequestOptions): PagePromise<KnowledgeCollectionsCursor, KnowledgeCollection>;
|
|
25
|
+
/**
|
|
26
|
+
* Delete a knowledge collection and all its documents.
|
|
27
|
+
*/
|
|
28
|
+
delete(id: string, options?: RequestOptions): APIPromise<void>;
|
|
29
|
+
}
|
|
30
|
+
export type KnowledgeCollectionsCursor = Cursor<KnowledgeCollection>;
|
|
31
|
+
export interface KnowledgeCollection {
|
|
32
|
+
/**
|
|
33
|
+
* Unique collection ID
|
|
34
|
+
*/
|
|
35
|
+
id: string;
|
|
36
|
+
/**
|
|
37
|
+
* When the collection was created
|
|
38
|
+
*/
|
|
39
|
+
createdAt: string;
|
|
40
|
+
/**
|
|
41
|
+
* Collection description
|
|
42
|
+
*/
|
|
43
|
+
description: string | null;
|
|
44
|
+
/**
|
|
45
|
+
* Embedding model used
|
|
46
|
+
*/
|
|
47
|
+
embeddingModel: string;
|
|
48
|
+
/**
|
|
49
|
+
* Collection name
|
|
50
|
+
*/
|
|
51
|
+
name: string;
|
|
52
|
+
/**
|
|
53
|
+
* Project ID
|
|
54
|
+
*/
|
|
55
|
+
projectId: string;
|
|
56
|
+
/**
|
|
57
|
+
* When the collection was last updated
|
|
58
|
+
*/
|
|
59
|
+
updatedAt: string;
|
|
60
|
+
/**
|
|
61
|
+
* Total number of documents
|
|
62
|
+
*/
|
|
63
|
+
documentCount?: number;
|
|
64
|
+
/**
|
|
65
|
+
* Number of processed documents
|
|
66
|
+
*/
|
|
67
|
+
readyDocumentCount?: number;
|
|
68
|
+
}
|
|
69
|
+
export interface CollectionCreateParams {
|
|
70
|
+
/**
|
|
71
|
+
* Collection name
|
|
72
|
+
*/
|
|
73
|
+
name: string;
|
|
74
|
+
/**
|
|
75
|
+
* Collection description
|
|
76
|
+
*/
|
|
77
|
+
description?: string;
|
|
78
|
+
}
|
|
79
|
+
export interface CollectionUpdateParams {
|
|
80
|
+
description?: string;
|
|
81
|
+
name?: string;
|
|
82
|
+
}
|
|
83
|
+
export interface CollectionListParams extends CursorParams {
|
|
84
|
+
}
|
|
85
|
+
export declare namespace Collections {
|
|
86
|
+
export { type KnowledgeCollection as KnowledgeCollection, type KnowledgeCollectionsCursor as KnowledgeCollectionsCursor, type CollectionCreateParams as CollectionCreateParams, type CollectionUpdateParams as CollectionUpdateParams, type CollectionListParams as CollectionListParams, };
|
|
87
|
+
export { Documents as Documents, type KnowledgeDocument as KnowledgeDocument, type DocumentProcessResponse as DocumentProcessResponse, type DocumentUploadResponse as DocumentUploadResponse, type KnowledgeDocumentsCursor as KnowledgeDocumentsCursor, type DocumentRetrieveParams as DocumentRetrieveParams, type DocumentListParams as DocumentListParams, type DocumentDeleteParams as DocumentDeleteParams, type DocumentProcessParams as DocumentProcessParams, type DocumentUploadParams as DocumentUploadParams, };
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=collections.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collections.d.ts","sourceRoot":"","sources":["../../../src/resources/knowledge/collections/collections.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,YAAY;OACjB,EACL,oBAAoB,EACpB,kBAAkB,EAClB,qBAAqB,EACrB,uBAAuB,EACvB,sBAAsB,EACtB,oBAAoB,EACpB,sBAAsB,EACtB,SAAS,EACT,iBAAiB,EACjB,wBAAwB,EACzB;OACM,EAAE,UAAU,EAAE;OACd,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,WAAW,EAAE;OAE1C,EAAE,cAAc,EAAE;AAGzB,qBAAa,WAAY,SAAQ,WAAW;IAC1C,SAAS,EAAE,YAAY,CAAC,SAAS,CAA4C;IAE7E;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,mBAAmB,CAAC;IAI/F;;OAEG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,mBAAmB,CAAC;IAI/E;;OAEG;IACH,MAAM,CACJ,EAAE,EAAE,MAAM,EACV,IAAI,GAAE,sBAAsB,GAAG,IAAI,GAAG,SAAc,EACpD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,mBAAmB,CAAC;IAIlC;;OAEG;IACH,IAAI,CACF,KAAK,GAAE,oBAAoB,GAAG,IAAI,GAAG,SAAc,EACnD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,0BAA0B,EAAE,mBAAmB,CAAC;IAO/D;;OAEG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;CAM/D;AAED,MAAM,MA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kB,IAAI,kBAAkB,EAC7C,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,oBAAoB,IAAI,oBAAoB,GAClD,CAAC;CACH"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Collections = void 0;
|
|
5
|
+
const tslib_1 = require("../../../internal/tslib.js");
|
|
6
|
+
const resource_1 = require("../../../core/resource.js");
|
|
7
|
+
const DocumentsAPI = tslib_1.__importStar(require("./documents.js"));
|
|
8
|
+
const documents_1 = require("./documents.js");
|
|
9
|
+
const pagination_1 = require("../../../core/pagination.js");
|
|
10
|
+
const headers_1 = require("../../../internal/headers.js");
|
|
11
|
+
const path_1 = require("../../../internal/utils/path.js");
|
|
12
|
+
class Collections extends resource_1.APIResource {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.documents = new DocumentsAPI.Documents(this._client);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Create a new knowledge collection for storing documents.
|
|
19
|
+
*/
|
|
20
|
+
create(body, options) {
|
|
21
|
+
return this._client.post('/knowledge/collections', { body, ...options });
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Get details of a knowledge collection including document stats.
|
|
25
|
+
*/
|
|
26
|
+
retrieve(id, options) {
|
|
27
|
+
return this._client.get((0, path_1.path) `/knowledge/collections/${id}`, options);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Update a knowledge collection name or description.
|
|
31
|
+
*/
|
|
32
|
+
update(id, body = {}, options) {
|
|
33
|
+
return this._client.patch((0, path_1.path) `/knowledge/collections/${id}`, { body, ...options });
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* List all knowledge collections for the project.
|
|
37
|
+
*/
|
|
38
|
+
list(query = {}, options) {
|
|
39
|
+
return this._client.getAPIList('/knowledge/collections', (pagination_1.Cursor), {
|
|
40
|
+
query,
|
|
41
|
+
...options,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Delete a knowledge collection and all its documents.
|
|
46
|
+
*/
|
|
47
|
+
delete(id, options) {
|
|
48
|
+
return this._client.delete((0, path_1.path) `/knowledge/collections/${id}`, {
|
|
49
|
+
...options,
|
|
50
|
+
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.Collections = Collections;
|
|
55
|
+
Collections.Documents = documents_1.Documents;
|
|
56
|
+
//# sourceMappingURL=collections.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collections.js","sourceRoot":"","sources":["../../../src/resources/knowledge/collections/collections.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,wDAAqD;AACrD,qEAA4C;AAC5C,8CAWqB;AAErB,4DAAkF;AAClF,0DAAyD;AAEzD,0DAAoD;AAEpD,MAAa,WAAY,SAAQ,sBAAW;IAA5C;;QACE,cAAS,GAA2B,IAAI,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAiD/E,CAAC;IA/CC;;OAEG;IACH,MAAM,CAAC,IAA4B,EAAE,OAAwB;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,wBAAwB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC3E,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,0BAA0B,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACvE,CAAC;IAED;;OAEG;IACH,MAAM,CACJ,EAAU,EACV,OAAkD,EAAE,EACpD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAA,WAAI,EAAA,0BAA0B,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACtF,CAAC;IAED;;OAEG;IACH,IAAI,CACF,QAAiD,EAAE,EACnD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,wBAAwB,EAAE,CAAA,mBAA2B,CAAA,EAAE;YACpF,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,EAAU,EAAE,OAAwB;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,0BAA0B,EAAE,EAAE,EAAE;YAC7D,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;CACF;AAlDD,kCAkDC;AAuED,WAAW,CAAC,SAAS,GAAG,qBAAS,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
3
|
+
import * as DocumentsAPI from "./documents.mjs";
|
|
4
|
+
import { Documents, } from "./documents.mjs";
|
|
5
|
+
import { Cursor } from "../../../core/pagination.mjs";
|
|
6
|
+
import { buildHeaders } from "../../../internal/headers.mjs";
|
|
7
|
+
import { path } from "../../../internal/utils/path.mjs";
|
|
8
|
+
export class Collections extends APIResource {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
this.documents = new DocumentsAPI.Documents(this._client);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Create a new knowledge collection for storing documents.
|
|
15
|
+
*/
|
|
16
|
+
create(body, options) {
|
|
17
|
+
return this._client.post('/knowledge/collections', { body, ...options });
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Get details of a knowledge collection including document stats.
|
|
21
|
+
*/
|
|
22
|
+
retrieve(id, options) {
|
|
23
|
+
return this._client.get(path `/knowledge/collections/${id}`, options);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Update a knowledge collection name or description.
|
|
27
|
+
*/
|
|
28
|
+
update(id, body = {}, options) {
|
|
29
|
+
return this._client.patch(path `/knowledge/collections/${id}`, { body, ...options });
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* List all knowledge collections for the project.
|
|
33
|
+
*/
|
|
34
|
+
list(query = {}, options) {
|
|
35
|
+
return this._client.getAPIList('/knowledge/collections', (Cursor), {
|
|
36
|
+
query,
|
|
37
|
+
...options,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Delete a knowledge collection and all its documents.
|
|
42
|
+
*/
|
|
43
|
+
delete(id, options) {
|
|
44
|
+
return this._client.delete(path `/knowledge/collections/${id}`, {
|
|
45
|
+
...options,
|
|
46
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
Collections.Documents = Documents;
|
|
51
|
+
//# sourceMappingURL=collections.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collections.mjs","sourceRoot":"","sources":["../../../src/resources/knowledge/collections/collections.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,YAAY;OACjB,EAQL,SAAS,GAGV;OAEM,EAAE,MAAM,EAAkC;OAC1C,EAAE,YAAY,EAAE;OAEhB,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,WAAY,SAAQ,WAAW;IAA5C;;QACE,cAAS,GAA2B,IAAI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|
+
import { APIPromise } from "../../../core/api-promise.mjs";
|
|
3
|
+
import { Cursor, type CursorParams, PagePromise } from "../../../core/pagination.mjs";
|
|
4
|
+
import { RequestOptions } from "../../../internal/request-options.mjs";
|
|
5
|
+
export declare class Documents extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* Get details of a document.
|
|
8
|
+
*/
|
|
9
|
+
retrieve(documentID: string, params: DocumentRetrieveParams, options?: RequestOptions): APIPromise<KnowledgeDocument>;
|
|
10
|
+
/**
|
|
11
|
+
* List all documents in a knowledge collection.
|
|
12
|
+
*/
|
|
13
|
+
list(id: string, query?: DocumentListParams | null | undefined, options?: RequestOptions): PagePromise<KnowledgeDocumentsCursor, KnowledgeDocument>;
|
|
14
|
+
/**
|
|
15
|
+
* Delete a document and its associated data.
|
|
16
|
+
*/
|
|
17
|
+
delete(documentID: string, params: DocumentDeleteParams, options?: RequestOptions): APIPromise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* Trigger processing for a document after upload.
|
|
20
|
+
*
|
|
21
|
+
* This extracts text from the document, splits it into chunks, generates
|
|
22
|
+
* embeddings, and stores them for search.
|
|
23
|
+
*
|
|
24
|
+
* The document status will transition: pending → processing → ready (or failed).
|
|
25
|
+
*/
|
|
26
|
+
process(documentID: string, params: DocumentProcessParams, options?: RequestOptions): APIPromise<DocumentProcessResponse>;
|
|
27
|
+
/**
|
|
28
|
+
* Create a document record and get a presigned URL for upload.
|
|
29
|
+
*
|
|
30
|
+
* After receiving the response, upload the file to the presigned URL using a PUT
|
|
31
|
+
* request. The document will be processed automatically after upload.
|
|
32
|
+
*/
|
|
33
|
+
upload(id: string, body: DocumentUploadParams, options?: RequestOptions): APIPromise<DocumentUploadResponse>;
|
|
34
|
+
}
|
|
35
|
+
export type KnowledgeDocumentsCursor = Cursor<KnowledgeDocument>;
|
|
36
|
+
export interface KnowledgeDocument {
|
|
37
|
+
/**
|
|
38
|
+
* Unique document ID
|
|
39
|
+
*/
|
|
40
|
+
id: string;
|
|
41
|
+
/**
|
|
42
|
+
* Collection ID
|
|
43
|
+
*/
|
|
44
|
+
collectionId: string;
|
|
45
|
+
/**
|
|
46
|
+
* When the document was created
|
|
47
|
+
*/
|
|
48
|
+
createdAt: string;
|
|
49
|
+
/**
|
|
50
|
+
* MIME type
|
|
51
|
+
*/
|
|
52
|
+
mimeType: string;
|
|
53
|
+
/**
|
|
54
|
+
* Document name
|
|
55
|
+
*/
|
|
56
|
+
name: string;
|
|
57
|
+
/**
|
|
58
|
+
* S3 URL of the document
|
|
59
|
+
*/
|
|
60
|
+
sourceUrl: string;
|
|
61
|
+
/**
|
|
62
|
+
* Processing status
|
|
63
|
+
*/
|
|
64
|
+
status: 'pending' | 'processing' | 'ready' | 'failed';
|
|
65
|
+
/**
|
|
66
|
+
* When the document was last updated
|
|
67
|
+
*/
|
|
68
|
+
updatedAt: string;
|
|
69
|
+
/**
|
|
70
|
+
* Document metadata
|
|
71
|
+
*/
|
|
72
|
+
metadata?: unknown;
|
|
73
|
+
}
|
|
74
|
+
export interface DocumentProcessResponse {
|
|
75
|
+
document: KnowledgeDocument;
|
|
76
|
+
message: string;
|
|
77
|
+
}
|
|
78
|
+
export interface DocumentUploadResponse {
|
|
79
|
+
document: KnowledgeDocument;
|
|
80
|
+
/**
|
|
81
|
+
* Presigned URL for uploading the file
|
|
82
|
+
*/
|
|
83
|
+
uploadUrl: string;
|
|
84
|
+
}
|
|
85
|
+
export interface DocumentRetrieveParams {
|
|
86
|
+
collectionId: string;
|
|
87
|
+
}
|
|
88
|
+
export interface DocumentListParams extends CursorParams {
|
|
89
|
+
status?: 'pending' | 'processing' | 'ready' | 'failed';
|
|
90
|
+
}
|
|
91
|
+
export interface DocumentDeleteParams {
|
|
92
|
+
collectionId: string;
|
|
93
|
+
}
|
|
94
|
+
export interface DocumentProcessParams {
|
|
95
|
+
/**
|
|
96
|
+
* Path param
|
|
97
|
+
*/
|
|
98
|
+
collectionId: string;
|
|
99
|
+
/**
|
|
100
|
+
* Body param: Use Unstructured.io for extraction if available
|
|
101
|
+
*/
|
|
102
|
+
preferUnstructured?: boolean;
|
|
103
|
+
}
|
|
104
|
+
export interface DocumentUploadParams {
|
|
105
|
+
/**
|
|
106
|
+
* MIME type of the document
|
|
107
|
+
*/
|
|
108
|
+
mimeType: string;
|
|
109
|
+
/**
|
|
110
|
+
* Document name (filename)
|
|
111
|
+
*/
|
|
112
|
+
name: string;
|
|
113
|
+
/**
|
|
114
|
+
* File size in bytes
|
|
115
|
+
*/
|
|
116
|
+
size?: number;
|
|
117
|
+
}
|
|
118
|
+
export declare namespace Documents {
|
|
119
|
+
export { type KnowledgeDocument as KnowledgeDocument, type DocumentProcessResponse as DocumentProcessResponse, type DocumentUploadResponse as DocumentUploadResponse, type KnowledgeDocumentsCursor as KnowledgeDocumentsCursor, type DocumentRetrieveParams as DocumentRetrieveParams, type DocumentListParams as DocumentListParams, type DocumentDeleteParams as DocumentDeleteParams, type DocumentProcessParams as DocumentProcessParams, type DocumentUploadParams as DocumentUploadParams, };
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=documents.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"documents.d.mts","sourceRoot":"","sources":["../../../src/resources/knowledge/collections/documents.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,WAAW,EAAE;OAE1C,EAAE,cAAc,EAAE;AAGzB,qBAAa,SAAU,SAAQ,WAAW;IACxC;;OAEG;IACH,QAAQ,CACN,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,sBAAsB,EAC9B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,iBAAiB,CAAC;IAKhC;;OAEG;IACH,IAAI,CACF,EAAE,EAAE,MAAM,EACV,KAAK,GAAE,kBAAkB,GAAG,IAAI,GAAG,SAAc,EACjD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CA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