@papr/memory 1.5.1 → 1.6.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 +18 -0
- package/README.md +13 -25
- package/client.d.mts +2 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +2 -2
- package/client.d.ts.map +1 -1
- package/client.js.map +1 -1
- package/client.mjs.map +1 -1
- package/internal/shim-types.d.mts +11 -22
- package/internal/shim-types.d.mts.map +1 -0
- package/internal/shim-types.d.ts +11 -22
- package/internal/shim-types.d.ts.map +1 -0
- package/internal/shim-types.js +4 -0
- package/internal/shim-types.js.map +1 -0
- package/internal/shim-types.mjs +3 -0
- package/internal/shim-types.mjs.map +1 -0
- package/internal/shims.d.mts +2 -2
- package/internal/shims.d.mts.map +1 -1
- package/internal/shims.d.ts +2 -2
- package/internal/shims.d.ts.map +1 -1
- package/internal/uploads.js.map +1 -1
- package/internal/uploads.mjs.map +1 -1
- package/package.json +1 -4
- package/resources/document.d.mts +1 -88
- package/resources/document.d.mts.map +1 -1
- package/resources/document.d.ts +1 -88
- package/resources/document.d.ts.map +1 -1
- package/resources/document.js +0 -24
- package/resources/document.js.map +1 -1
- package/resources/document.mjs +0 -24
- package/resources/document.mjs.map +1 -1
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/memory.d.mts +94 -17
- package/resources/memory.d.mts.map +1 -1
- package/resources/memory.d.ts +94 -17
- package/resources/memory.d.ts.map +1 -1
- package/resources/memory.js +9 -1
- package/resources/memory.js.map +1 -1
- package/resources/memory.mjs +9 -1
- package/resources/memory.mjs.map +1 -1
- package/resources/user.d.mts +5 -5
- package/resources/user.d.mts.map +1 -1
- package/resources/user.d.ts +5 -5
- package/resources/user.d.ts.map +1 -1
- package/resources/user.js +2 -2
- package/resources/user.mjs +2 -2
- package/src/client.ts +2 -7
- package/src/internal/shim-types.ts +26 -0
- package/src/internal/shims.ts +2 -2
- package/src/internal/uploads.ts +1 -1
- package/src/resources/document.ts +2 -120
- package/src/resources/index.ts +1 -6
- package/src/resources/memory.ts +137 -19
- package/src/resources/user.ts +5 -5
- 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
- package/src/internal/shim-types.d.ts +0 -28
package/resources/document.d.mts
CHANGED
|
@@ -1,25 +1,5 @@
|
|
|
1
1
|
import { APIResource } from "../core/resource.mjs";
|
|
2
|
-
import { APIPromise } from "../core/api-promise.mjs";
|
|
3
|
-
import { RequestOptions } from "../internal/request-options.mjs";
|
|
4
2
|
export declare class Document extends APIResource {
|
|
5
|
-
/**
|
|
6
|
-
* Upload a document (PDF/HTML/TXT) to be processed and added to memory.
|
|
7
|
-
*
|
|
8
|
-
* **Authentication Required**:
|
|
9
|
-
* One of the following authentication methods must be used:
|
|
10
|
-
* - Bearer token in `Authorization` header
|
|
11
|
-
* - API Key in `X-API-Key` header
|
|
12
|
-
* - Session token in `X-Session-Token` header
|
|
13
|
-
*
|
|
14
|
-
* **Required Headers**:
|
|
15
|
-
* - Content-Type: multipart/form-data
|
|
16
|
-
* - X-Client-Type: (e.g., 'papr_plugin', 'browser_extension')
|
|
17
|
-
*
|
|
18
|
-
* **Form Data**:
|
|
19
|
-
* - file: The document file to upload (PDF/HTML/TXT)
|
|
20
|
-
* - metadata: (optional) JSON string containing additional metadata
|
|
21
|
-
*/
|
|
22
|
-
upload(params?: DocumentUploadParams | null | undefined, options?: RequestOptions): APIPromise<DocumentUploadResponse>;
|
|
23
3
|
}
|
|
24
4
|
/**
|
|
25
5
|
* Response model for a single memory item in add_memory response
|
|
@@ -30,74 +10,7 @@ export interface AddMemoryItem {
|
|
|
30
10
|
objectId: string;
|
|
31
11
|
memoryChunkIds?: Array<string>;
|
|
32
12
|
}
|
|
33
|
-
export interface DocumentUploadResponse {
|
|
34
|
-
/**
|
|
35
|
-
* Status and progress of the document upload
|
|
36
|
-
*/
|
|
37
|
-
document_status: DocumentUploadResponse.DocumentStatus;
|
|
38
|
-
/**
|
|
39
|
-
* HTTP status code
|
|
40
|
-
*/
|
|
41
|
-
code?: number;
|
|
42
|
-
/**
|
|
43
|
-
* Additional error details or context
|
|
44
|
-
*/
|
|
45
|
-
details?: unknown;
|
|
46
|
-
/**
|
|
47
|
-
* Error message if failed
|
|
48
|
-
*/
|
|
49
|
-
error?: string | null;
|
|
50
|
-
/**
|
|
51
|
-
* For backward compatibility
|
|
52
|
-
*/
|
|
53
|
-
memories?: Array<AddMemoryItem> | null;
|
|
54
|
-
/**
|
|
55
|
-
* List of memory items created from the document
|
|
56
|
-
*/
|
|
57
|
-
memory_items?: Array<AddMemoryItem>;
|
|
58
|
-
/**
|
|
59
|
-
* Human-readable status message
|
|
60
|
-
*/
|
|
61
|
-
message?: string | null;
|
|
62
|
-
/**
|
|
63
|
-
* 'success', 'processing', 'error', etc.
|
|
64
|
-
*/
|
|
65
|
-
status?: string;
|
|
66
|
-
}
|
|
67
|
-
export declare namespace DocumentUploadResponse {
|
|
68
|
-
/**
|
|
69
|
-
* Status and progress of the document upload
|
|
70
|
-
*/
|
|
71
|
-
interface DocumentStatus {
|
|
72
|
-
/**
|
|
73
|
-
* 0.0 to 1.0 for percentage
|
|
74
|
-
*/
|
|
75
|
-
progress: number;
|
|
76
|
-
current_filename?: string | null;
|
|
77
|
-
current_page?: number | null;
|
|
78
|
-
/**
|
|
79
|
-
* Error message if failed
|
|
80
|
-
*/
|
|
81
|
-
error?: string | null;
|
|
82
|
-
/**
|
|
83
|
-
* Processing status type
|
|
84
|
-
*/
|
|
85
|
-
status_type?: 'processing' | 'completed' | 'failed' | 'not_found' | 'queued' | 'cancelled' | null;
|
|
86
|
-
total_pages?: number | null;
|
|
87
|
-
upload_id?: string | null;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
export interface DocumentUploadParams {
|
|
91
|
-
/**
|
|
92
|
-
* Optional Post objectId for updating status
|
|
93
|
-
*/
|
|
94
|
-
post_objectId?: string | null;
|
|
95
|
-
/**
|
|
96
|
-
* If True, skips adding background tasks for processing
|
|
97
|
-
*/
|
|
98
|
-
skip_background_processing?: boolean;
|
|
99
|
-
}
|
|
100
13
|
export declare namespace Document {
|
|
101
|
-
export { type AddMemoryItem as AddMemoryItem
|
|
14
|
+
export { type AddMemoryItem as AddMemoryItem };
|
|
102
15
|
}
|
|
103
16
|
//# sourceMappingURL=document.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document.d.mts","sourceRoot":"","sources":["../src/resources/document.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;
|
|
1
|
+
{"version":3,"file":"document.d.mts","sourceRoot":"","sources":["../src/resources/document.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;AAEtB,qBAAa,QAAS,SAAQ,WAAW;CAAG;AAE5C;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAC;IAElB,QAAQ,EAAE,MAAM,CAAC;IAEjB,QAAQ,EAAE,MAAM,CAAC;IAEjB,cAAc,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CAChC;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EAAE,KAAK,aAAa,IAAI,aAAa,EAAE,CAAC;CAChD"}
|
package/resources/document.d.ts
CHANGED
|
@@ -1,25 +1,5 @@
|
|
|
1
1
|
import { APIResource } from "../core/resource.js";
|
|
2
|
-
import { APIPromise } from "../core/api-promise.js";
|
|
3
|
-
import { RequestOptions } from "../internal/request-options.js";
|
|
4
2
|
export declare class Document extends APIResource {
|
|
5
|
-
/**
|
|
6
|
-
* Upload a document (PDF/HTML/TXT) to be processed and added to memory.
|
|
7
|
-
*
|
|
8
|
-
* **Authentication Required**:
|
|
9
|
-
* One of the following authentication methods must be used:
|
|
10
|
-
* - Bearer token in `Authorization` header
|
|
11
|
-
* - API Key in `X-API-Key` header
|
|
12
|
-
* - Session token in `X-Session-Token` header
|
|
13
|
-
*
|
|
14
|
-
* **Required Headers**:
|
|
15
|
-
* - Content-Type: multipart/form-data
|
|
16
|
-
* - X-Client-Type: (e.g., 'papr_plugin', 'browser_extension')
|
|
17
|
-
*
|
|
18
|
-
* **Form Data**:
|
|
19
|
-
* - file: The document file to upload (PDF/HTML/TXT)
|
|
20
|
-
* - metadata: (optional) JSON string containing additional metadata
|
|
21
|
-
*/
|
|
22
|
-
upload(params?: DocumentUploadParams | null | undefined, options?: RequestOptions): APIPromise<DocumentUploadResponse>;
|
|
23
3
|
}
|
|
24
4
|
/**
|
|
25
5
|
* Response model for a single memory item in add_memory response
|
|
@@ -30,74 +10,7 @@ export interface AddMemoryItem {
|
|
|
30
10
|
objectId: string;
|
|
31
11
|
memoryChunkIds?: Array<string>;
|
|
32
12
|
}
|
|
33
|
-
export interface DocumentUploadResponse {
|
|
34
|
-
/**
|
|
35
|
-
* Status and progress of the document upload
|
|
36
|
-
*/
|
|
37
|
-
document_status: DocumentUploadResponse.DocumentStatus;
|
|
38
|
-
/**
|
|
39
|
-
* HTTP status code
|
|
40
|
-
*/
|
|
41
|
-
code?: number;
|
|
42
|
-
/**
|
|
43
|
-
* Additional error details or context
|
|
44
|
-
*/
|
|
45
|
-
details?: unknown;
|
|
46
|
-
/**
|
|
47
|
-
* Error message if failed
|
|
48
|
-
*/
|
|
49
|
-
error?: string | null;
|
|
50
|
-
/**
|
|
51
|
-
* For backward compatibility
|
|
52
|
-
*/
|
|
53
|
-
memories?: Array<AddMemoryItem> | null;
|
|
54
|
-
/**
|
|
55
|
-
* List of memory items created from the document
|
|
56
|
-
*/
|
|
57
|
-
memory_items?: Array<AddMemoryItem>;
|
|
58
|
-
/**
|
|
59
|
-
* Human-readable status message
|
|
60
|
-
*/
|
|
61
|
-
message?: string | null;
|
|
62
|
-
/**
|
|
63
|
-
* 'success', 'processing', 'error', etc.
|
|
64
|
-
*/
|
|
65
|
-
status?: string;
|
|
66
|
-
}
|
|
67
|
-
export declare namespace DocumentUploadResponse {
|
|
68
|
-
/**
|
|
69
|
-
* Status and progress of the document upload
|
|
70
|
-
*/
|
|
71
|
-
interface DocumentStatus {
|
|
72
|
-
/**
|
|
73
|
-
* 0.0 to 1.0 for percentage
|
|
74
|
-
*/
|
|
75
|
-
progress: number;
|
|
76
|
-
current_filename?: string | null;
|
|
77
|
-
current_page?: number | null;
|
|
78
|
-
/**
|
|
79
|
-
* Error message if failed
|
|
80
|
-
*/
|
|
81
|
-
error?: string | null;
|
|
82
|
-
/**
|
|
83
|
-
* Processing status type
|
|
84
|
-
*/
|
|
85
|
-
status_type?: 'processing' | 'completed' | 'failed' | 'not_found' | 'queued' | 'cancelled' | null;
|
|
86
|
-
total_pages?: number | null;
|
|
87
|
-
upload_id?: string | null;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
export interface DocumentUploadParams {
|
|
91
|
-
/**
|
|
92
|
-
* Optional Post objectId for updating status
|
|
93
|
-
*/
|
|
94
|
-
post_objectId?: string | null;
|
|
95
|
-
/**
|
|
96
|
-
* If True, skips adding background tasks for processing
|
|
97
|
-
*/
|
|
98
|
-
skip_background_processing?: boolean;
|
|
99
|
-
}
|
|
100
13
|
export declare namespace Document {
|
|
101
|
-
export { type AddMemoryItem as AddMemoryItem
|
|
14
|
+
export { type AddMemoryItem as AddMemoryItem };
|
|
102
15
|
}
|
|
103
16
|
//# sourceMappingURL=document.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document.d.ts","sourceRoot":"","sources":["../src/resources/document.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;
|
|
1
|
+
{"version":3,"file":"document.d.ts","sourceRoot":"","sources":["../src/resources/document.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;AAEtB,qBAAa,QAAS,SAAQ,WAAW;CAAG;AAE5C;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAC;IAElB,QAAQ,EAAE,MAAM,CAAC;IAEjB,QAAQ,EAAE,MAAM,CAAC;IAEjB,cAAc,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CAChC;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EAAE,KAAK,aAAa,IAAI,aAAa,EAAE,CAAC;CAChD"}
|
package/resources/document.js
CHANGED
|
@@ -4,30 +4,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
exports.Document = void 0;
|
|
5
5
|
const resource_1 = require("../core/resource.js");
|
|
6
6
|
class Document extends resource_1.APIResource {
|
|
7
|
-
/**
|
|
8
|
-
* Upload a document (PDF/HTML/TXT) to be processed and added to memory.
|
|
9
|
-
*
|
|
10
|
-
* **Authentication Required**:
|
|
11
|
-
* One of the following authentication methods must be used:
|
|
12
|
-
* - Bearer token in `Authorization` header
|
|
13
|
-
* - API Key in `X-API-Key` header
|
|
14
|
-
* - Session token in `X-Session-Token` header
|
|
15
|
-
*
|
|
16
|
-
* **Required Headers**:
|
|
17
|
-
* - Content-Type: multipart/form-data
|
|
18
|
-
* - X-Client-Type: (e.g., 'papr_plugin', 'browser_extension')
|
|
19
|
-
*
|
|
20
|
-
* **Form Data**:
|
|
21
|
-
* - file: The document file to upload (PDF/HTML/TXT)
|
|
22
|
-
* - metadata: (optional) JSON string containing additional metadata
|
|
23
|
-
*/
|
|
24
|
-
upload(params = {}, options) {
|
|
25
|
-
const { post_objectId, skip_background_processing } = params ?? {};
|
|
26
|
-
return this._client.post('/v1/document', {
|
|
27
|
-
query: { post_objectId, skip_background_processing },
|
|
28
|
-
...options,
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
7
|
}
|
|
32
8
|
exports.Document = Document;
|
|
33
9
|
//# sourceMappingURL=document.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document.js","sourceRoot":"","sources":["../src/resources/document.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;
|
|
1
|
+
{"version":3,"file":"document.js","sourceRoot":"","sources":["../src/resources/document.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,MAAa,QAAS,SAAQ,sBAAW;CAAG;AAA5C,4BAA4C"}
|
package/resources/document.mjs
CHANGED
|
@@ -1,29 +1,5 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
import { APIResource } from "../core/resource.mjs";
|
|
3
3
|
export class Document extends APIResource {
|
|
4
|
-
/**
|
|
5
|
-
* Upload a document (PDF/HTML/TXT) to be processed and added to memory.
|
|
6
|
-
*
|
|
7
|
-
* **Authentication Required**:
|
|
8
|
-
* One of the following authentication methods must be used:
|
|
9
|
-
* - Bearer token in `Authorization` header
|
|
10
|
-
* - API Key in `X-API-Key` header
|
|
11
|
-
* - Session token in `X-Session-Token` header
|
|
12
|
-
*
|
|
13
|
-
* **Required Headers**:
|
|
14
|
-
* - Content-Type: multipart/form-data
|
|
15
|
-
* - X-Client-Type: (e.g., 'papr_plugin', 'browser_extension')
|
|
16
|
-
*
|
|
17
|
-
* **Form Data**:
|
|
18
|
-
* - file: The document file to upload (PDF/HTML/TXT)
|
|
19
|
-
* - metadata: (optional) JSON string containing additional metadata
|
|
20
|
-
*/
|
|
21
|
-
upload(params = {}, options) {
|
|
22
|
-
const { post_objectId, skip_background_processing } = params ?? {};
|
|
23
|
-
return this._client.post('/v1/document', {
|
|
24
|
-
query: { post_objectId, skip_background_processing },
|
|
25
|
-
...options,
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
4
|
}
|
|
29
5
|
//# sourceMappingURL=document.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document.mjs","sourceRoot":"","sources":["../src/resources/document.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;
|
|
1
|
+
{"version":3,"file":"document.mjs","sourceRoot":"","sources":["../src/resources/document.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAEtB,MAAM,OAAO,QAAS,SAAQ,WAAW;CAAG"}
|
package/resources/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Document, type AddMemoryItem
|
|
1
|
+
export { Document, type AddMemoryItem } from "./document.mjs";
|
|
2
2
|
export { Memory, type AddMemory, type AddMemoryResponse, type ContextItem, type MemoryMetadata, type MemoryType, type RelationshipItem, type SearchResponse, type MemoryUpdateResponse, type MemoryDeleteResponse, type MemoryAddBatchResponse, type MemoryUpdateParams, type MemoryDeleteParams, type MemoryAddParams, type MemoryAddBatchParams, type MemorySearchParams, } from "./memory.mjs";
|
|
3
3
|
export { User, type UserResponse, type UserType, type UserListResponse, type UserDeleteResponse, type UserCreateParams, type UserUpdateParams, type UserListParams, } from "./user.mjs";
|
|
4
4
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"OAEO,
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"OAEO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE;OAChC,EACL,MAAM,EACN,KAAK,SAAS,EACd,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,GACxB;OACM,EACL,IAAI,EACJ,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,cAAc,GACpB"}
|
package/resources/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Document, type AddMemoryItem
|
|
1
|
+
export { Document, type AddMemoryItem } from "./document.js";
|
|
2
2
|
export { Memory, type AddMemory, type AddMemoryResponse, type ContextItem, type MemoryMetadata, type MemoryType, type RelationshipItem, type SearchResponse, type MemoryUpdateResponse, type MemoryDeleteResponse, type MemoryAddBatchResponse, type MemoryUpdateParams, type MemoryDeleteParams, type MemoryAddParams, type MemoryAddBatchParams, type MemorySearchParams, } from "./memory.js";
|
|
3
3
|
export { User, type UserResponse, type UserType, type UserListResponse, type UserDeleteResponse, type UserCreateParams, type UserUpdateParams, type UserListParams, } from "./user.js";
|
|
4
4
|
//# 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,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"OAEO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE;OAChC,EACL,MAAM,EACN,KAAK,SAAS,EACd,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,GACxB;OACM,EACL,IAAI,EACJ,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,cAAc,GACpB"}
|
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,0CAA0D;AAAjD,oGAAA,QAAQ,OAAA;AACjB,sCAiBkB;AAhBhB,gGAAA,MAAM,OAAA;AAiBR,kCASgB;AARd,4FAAA,IAAI,OAAA"}
|
package/resources/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
export { Document
|
|
2
|
+
export { Document } from "./document.mjs";
|
|
3
3
|
export { Memory, } from "./memory.mjs";
|
|
4
4
|
export { User, } from "./user.mjs";
|
|
5
5
|
//# 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,
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,QAAQ,EAAsB;OAChC,EACL,MAAM,GAgBP;OACM,EACL,IAAI,GAQL"}
|
package/resources/memory.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { APIResource } from "../core/resource.mjs";
|
|
2
|
+
import * as MemoryAPI from "./memory.mjs";
|
|
2
3
|
import * as DocumentAPI from "./document.mjs";
|
|
3
4
|
import { APIPromise } from "../core/api-promise.mjs";
|
|
4
5
|
import { RequestOptions } from "../internal/request-options.mjs";
|
|
@@ -63,6 +64,7 @@ export declare class Memory extends APIResource {
|
|
|
63
64
|
* const addMemoryResponse = await client.memory.add({
|
|
64
65
|
* content:
|
|
65
66
|
* 'Meeting notes from the product planning session',
|
|
67
|
+
* type: 'text',
|
|
66
68
|
* });
|
|
67
69
|
* ```
|
|
68
70
|
*/
|
|
@@ -90,9 +92,11 @@ export declare class Memory extends APIResource {
|
|
|
90
92
|
* {
|
|
91
93
|
* content:
|
|
92
94
|
* 'Meeting notes from the product planning session',
|
|
95
|
+
* type: 'text',
|
|
93
96
|
* },
|
|
94
97
|
* {
|
|
95
98
|
* content: 'Follow-up tasks from the planning meeting',
|
|
99
|
+
* type: 'text',
|
|
96
100
|
* },
|
|
97
101
|
* ],
|
|
98
102
|
* });
|
|
@@ -133,11 +137,16 @@ export declare class Memory extends APIResource {
|
|
|
133
137
|
*
|
|
134
138
|
* The API supports response compression for improved performance. Responses larger than 1KB will be automatically compressed when this header is present.
|
|
135
139
|
*
|
|
140
|
+
* **User Resolution Precedence:**
|
|
141
|
+
* - If both user_id and external_user_id are provided, user_id takes precedence.
|
|
142
|
+
* - If only external_user_id is provided, it will be resolved to the internal user.
|
|
143
|
+
* - If neither is provided, the authenticated user is used.
|
|
144
|
+
*
|
|
136
145
|
* @example
|
|
137
146
|
* ```ts
|
|
138
147
|
* const searchResponse = await client.memory.search({
|
|
139
148
|
* query:
|
|
140
|
-
*
|
|
149
|
+
* "Find recurring customer complaints about API performance from the last month. Focus on issues that multiple customers have mentioned and any specific feature requests or workflow improvements they've suggested.",
|
|
141
150
|
* });
|
|
142
151
|
* ```
|
|
143
152
|
*/
|
|
@@ -151,6 +160,10 @@ export interface AddMemory {
|
|
|
151
160
|
* The content of the memory item you want to add to memory
|
|
152
161
|
*/
|
|
153
162
|
content: string;
|
|
163
|
+
/**
|
|
164
|
+
* Valid memory types
|
|
165
|
+
*/
|
|
166
|
+
type: MemoryType;
|
|
154
167
|
/**
|
|
155
168
|
* Context can be conversation history or any relevant context for a memory item
|
|
156
169
|
*/
|
|
@@ -163,10 +176,6 @@ export interface AddMemory {
|
|
|
163
176
|
* Array of relationships that we can use in Graph DB (neo4J)
|
|
164
177
|
*/
|
|
165
178
|
relationships_json?: Array<RelationshipItem> | null;
|
|
166
|
-
/**
|
|
167
|
-
* Content type of the memory item
|
|
168
|
-
*/
|
|
169
|
-
type?: MemoryType;
|
|
170
179
|
}
|
|
171
180
|
/**
|
|
172
181
|
* Unified response model for add_memory API endpoint (success or error).
|
|
@@ -209,20 +218,31 @@ export interface MemoryMetadata {
|
|
|
209
218
|
* ISO datetime when the memory was created
|
|
210
219
|
*/
|
|
211
220
|
createdAt?: string | null;
|
|
212
|
-
|
|
213
|
-
|
|
221
|
+
/**
|
|
222
|
+
* Optional object for arbitrary custom metadata fields. Only string, number,
|
|
223
|
+
* boolean, or list of strings allowed. Nested dicts are not allowed.
|
|
224
|
+
*/
|
|
225
|
+
customMetadata?: Record<string, string | number | boolean | Array<string>> | null;
|
|
226
|
+
'emoji tags'?: Array<string> | null;
|
|
227
|
+
'emotion tags'?: Array<string> | null;
|
|
228
|
+
external_user_id?: string | null;
|
|
229
|
+
external_user_read_access?: Array<string> | null;
|
|
230
|
+
external_user_write_access?: Array<string> | null;
|
|
214
231
|
/**
|
|
215
232
|
* Hierarchical structures to enable navigation from broad topics to specific ones
|
|
216
233
|
*/
|
|
217
234
|
hierarchical_structures?: string | null;
|
|
218
235
|
location?: string | null;
|
|
236
|
+
pageId?: string | null;
|
|
219
237
|
role_read_access?: Array<string> | null;
|
|
220
238
|
role_write_access?: Array<string> | null;
|
|
239
|
+
sourceType?: string | null;
|
|
221
240
|
sourceUrl?: string | null;
|
|
222
|
-
topics?: string | null;
|
|
241
|
+
topics?: Array<string> | null;
|
|
223
242
|
user_id?: string | null;
|
|
224
243
|
user_read_access?: Array<string> | null;
|
|
225
244
|
user_write_access?: Array<string> | null;
|
|
245
|
+
workspace_id?: string | null;
|
|
226
246
|
workspace_read_access?: Array<string> | null;
|
|
227
247
|
workspace_write_access?: Array<string> | null;
|
|
228
248
|
[k: string]: unknown;
|
|
@@ -238,7 +258,7 @@ export interface RelationshipItem {
|
|
|
238
258
|
related_item_id: 'TextMemoryItem' | 'previous_memory_item_id';
|
|
239
259
|
related_item_type: 'TextMemoryItem';
|
|
240
260
|
relation_type: string;
|
|
241
|
-
metadata?: unknown
|
|
261
|
+
metadata?: Record<string, unknown>;
|
|
242
262
|
}
|
|
243
263
|
export interface SearchResponse {
|
|
244
264
|
/**
|
|
@@ -280,17 +300,23 @@ export declare namespace SearchResponse {
|
|
|
280
300
|
content: string;
|
|
281
301
|
type: string;
|
|
282
302
|
user_id: string;
|
|
283
|
-
context?:
|
|
303
|
+
context?: Array<MemoryAPI.ContextItem> | null;
|
|
284
304
|
conversation_id?: string;
|
|
285
305
|
created_at?: string | null;
|
|
286
306
|
current_step?: string | null;
|
|
307
|
+
customMetadata?: Record<string, unknown> | null;
|
|
308
|
+
external_user_id?: string | null;
|
|
309
|
+
external_user_read_access?: Array<string> | null;
|
|
310
|
+
external_user_write_access?: Array<string> | null;
|
|
287
311
|
file_url?: string | null;
|
|
288
312
|
filename?: string | null;
|
|
289
313
|
hierarchical_structures?: string;
|
|
290
314
|
location?: string | null;
|
|
291
|
-
metadata?: string | unknown | null;
|
|
315
|
+
metadata?: string | Record<string, unknown> | null;
|
|
292
316
|
page?: string | null;
|
|
293
317
|
page_number?: number | null;
|
|
318
|
+
role_read_access?: Array<string> | null;
|
|
319
|
+
role_write_access?: Array<string> | null;
|
|
294
320
|
source_document_id?: string | null;
|
|
295
321
|
source_message_id?: string | null;
|
|
296
322
|
source_type?: string;
|
|
@@ -301,7 +327,11 @@ export declare namespace SearchResponse {
|
|
|
301
327
|
topics?: Array<string>;
|
|
302
328
|
total_pages?: number | null;
|
|
303
329
|
updated_at?: string | null;
|
|
330
|
+
user_read_access?: Array<string> | null;
|
|
331
|
+
user_write_access?: Array<string> | null;
|
|
304
332
|
workspace_id?: string | null;
|
|
333
|
+
workspace_read_access?: Array<string> | null;
|
|
334
|
+
workspace_write_access?: Array<string> | null;
|
|
305
335
|
[k: string]: unknown;
|
|
306
336
|
}
|
|
307
337
|
/**
|
|
@@ -329,6 +359,8 @@ export declare namespace SearchResponse {
|
|
|
329
359
|
conversationId?: string | null;
|
|
330
360
|
createdAt?: string | null;
|
|
331
361
|
emoji_tags?: Array<string> | null;
|
|
362
|
+
external_user_read_access?: Array<string> | null;
|
|
363
|
+
external_user_write_access?: Array<string> | null;
|
|
332
364
|
hierarchical_structures?: string | null;
|
|
333
365
|
pageId?: string | null;
|
|
334
366
|
role_read_access?: Array<string> | null;
|
|
@@ -354,6 +386,8 @@ export declare namespace SearchResponse {
|
|
|
354
386
|
role: string;
|
|
355
387
|
conversationId?: string | null;
|
|
356
388
|
createdAt?: string | null;
|
|
389
|
+
external_user_read_access?: Array<string> | null;
|
|
390
|
+
external_user_write_access?: Array<string> | null;
|
|
357
391
|
pageId?: string | null;
|
|
358
392
|
role_read_access?: Array<string> | null;
|
|
359
393
|
role_write_access?: Array<string> | null;
|
|
@@ -376,6 +410,8 @@ export declare namespace SearchResponse {
|
|
|
376
410
|
name: string;
|
|
377
411
|
conversationId?: string | null;
|
|
378
412
|
createdAt?: string | null;
|
|
413
|
+
external_user_read_access?: Array<string> | null;
|
|
414
|
+
external_user_write_access?: Array<string> | null;
|
|
379
415
|
pageId?: string | null;
|
|
380
416
|
role_read_access?: Array<string> | null;
|
|
381
417
|
role_write_access?: Array<string> | null;
|
|
@@ -399,6 +435,8 @@ export declare namespace SearchResponse {
|
|
|
399
435
|
type: string;
|
|
400
436
|
conversationId?: string | null;
|
|
401
437
|
createdAt?: string | null;
|
|
438
|
+
external_user_read_access?: Array<string> | null;
|
|
439
|
+
external_user_write_access?: Array<string> | null;
|
|
402
440
|
pageId?: string | null;
|
|
403
441
|
role_read_access?: Array<string> | null;
|
|
404
442
|
role_write_access?: Array<string> | null;
|
|
@@ -423,6 +461,12 @@ export declare namespace SearchResponse {
|
|
|
423
461
|
type: 'task' | 'subtask' | 'bug' | 'feature_request' | 'epic' | 'support_ticket';
|
|
424
462
|
conversationId?: string | null;
|
|
425
463
|
createdAt?: string | null;
|
|
464
|
+
/**
|
|
465
|
+
* Due date for the task in ISO 8601 format
|
|
466
|
+
*/
|
|
467
|
+
date?: string | null;
|
|
468
|
+
external_user_read_access?: Array<string> | null;
|
|
469
|
+
external_user_write_access?: Array<string> | null;
|
|
426
470
|
pageId?: string | null;
|
|
427
471
|
role_read_access?: Array<string> | null;
|
|
428
472
|
role_write_access?: Array<string> | null;
|
|
@@ -447,6 +491,8 @@ export declare namespace SearchResponse {
|
|
|
447
491
|
type: 'customer_insight' | 'product_insight' | 'market_insight' | 'competitive_insight' | 'technical_insight' | 'other';
|
|
448
492
|
conversationId?: string | null;
|
|
449
493
|
createdAt?: string | null;
|
|
494
|
+
external_user_read_access?: Array<string> | null;
|
|
495
|
+
external_user_write_access?: Array<string> | null;
|
|
450
496
|
pageId?: string | null;
|
|
451
497
|
role_read_access?: Array<string> | null;
|
|
452
498
|
role_write_access?: Array<string> | null;
|
|
@@ -476,6 +522,8 @@ export declare namespace SearchResponse {
|
|
|
476
522
|
type: string;
|
|
477
523
|
conversationId?: string | null;
|
|
478
524
|
createdAt?: string | null;
|
|
525
|
+
external_user_read_access?: Array<string> | null;
|
|
526
|
+
external_user_write_access?: Array<string> | null;
|
|
479
527
|
pageId?: string | null;
|
|
480
528
|
role_read_access?: Array<string> | null;
|
|
481
529
|
role_write_access?: Array<string> | null;
|
|
@@ -503,6 +551,8 @@ export declare namespace SearchResponse {
|
|
|
503
551
|
value: number;
|
|
504
552
|
conversationId?: string | null;
|
|
505
553
|
createdAt?: string | null;
|
|
554
|
+
external_user_read_access?: Array<string> | null;
|
|
555
|
+
external_user_write_access?: Array<string> | null;
|
|
506
556
|
pageId?: string | null;
|
|
507
557
|
role_read_access?: Array<string> | null;
|
|
508
558
|
role_write_access?: Array<string> | null;
|
|
@@ -526,6 +576,8 @@ export declare namespace SearchResponse {
|
|
|
526
576
|
name: string;
|
|
527
577
|
conversationId?: string | null;
|
|
528
578
|
createdAt?: string | null;
|
|
579
|
+
external_user_read_access?: Array<string> | null;
|
|
580
|
+
external_user_write_access?: Array<string> | null;
|
|
529
581
|
pageId?: string | null;
|
|
530
582
|
role_read_access?: Array<string> | null;
|
|
531
583
|
role_write_access?: Array<string> | null;
|
|
@@ -585,6 +637,10 @@ export declare namespace MemoryUpdateResponse {
|
|
|
585
637
|
updatedAt: string;
|
|
586
638
|
content?: string | null;
|
|
587
639
|
memoryChunkIds?: Array<string> | null;
|
|
640
|
+
/**
|
|
641
|
+
* Metadata for memory request
|
|
642
|
+
*/
|
|
643
|
+
metadata?: MemoryAPI.MemoryMetadata | null;
|
|
588
644
|
}
|
|
589
645
|
/**
|
|
590
646
|
* Status of update operation for each system
|
|
@@ -695,6 +751,10 @@ export interface MemoryAddParams {
|
|
|
695
751
|
* Body param: The content of the memory item you want to add to memory
|
|
696
752
|
*/
|
|
697
753
|
content: string;
|
|
754
|
+
/**
|
|
755
|
+
* Body param: Valid memory types
|
|
756
|
+
*/
|
|
757
|
+
type: MemoryType;
|
|
698
758
|
/**
|
|
699
759
|
* Query param: If True, skips adding background tasks for processing
|
|
700
760
|
*/
|
|
@@ -712,10 +772,6 @@ export interface MemoryAddParams {
|
|
|
712
772
|
* Body param: Array of relationships that we can use in Graph DB (neo4J)
|
|
713
773
|
*/
|
|
714
774
|
relationships_json?: Array<RelationshipItem> | null;
|
|
715
|
-
/**
|
|
716
|
-
* Body param: Content type of the memory item
|
|
717
|
-
*/
|
|
718
|
-
type?: MemoryType;
|
|
719
775
|
}
|
|
720
776
|
export interface MemoryAddBatchParams {
|
|
721
777
|
/**
|
|
@@ -730,6 +786,16 @@ export interface MemoryAddBatchParams {
|
|
|
730
786
|
* Body param: Number of items to process in parallel
|
|
731
787
|
*/
|
|
732
788
|
batch_size?: number | null;
|
|
789
|
+
/**
|
|
790
|
+
* Body param: External user ID for all memories in the batch. If provided and
|
|
791
|
+
* user_id is not, will be resolved to internal user ID.
|
|
792
|
+
*/
|
|
793
|
+
external_user_id?: string | null;
|
|
794
|
+
/**
|
|
795
|
+
* Body param: Internal user ID for all memories in the batch. If not provided,
|
|
796
|
+
* developer's user ID will be used.
|
|
797
|
+
*/
|
|
798
|
+
user_id?: string | null;
|
|
733
799
|
}
|
|
734
800
|
export interface MemorySearchParams {
|
|
735
801
|
/**
|
|
@@ -748,6 +814,16 @@ export interface MemorySearchParams {
|
|
|
748
814
|
* Query param: Maximum number of neo nodes to return
|
|
749
815
|
*/
|
|
750
816
|
max_nodes?: number;
|
|
817
|
+
/**
|
|
818
|
+
* Body param: Optional external user ID to filter search results by a specific
|
|
819
|
+
* external user. If both user_id and external_user_id are provided, user_id takes
|
|
820
|
+
* precedence.
|
|
821
|
+
*/
|
|
822
|
+
external_user_id?: string | null;
|
|
823
|
+
/**
|
|
824
|
+
* Body param: Metadata for memory request
|
|
825
|
+
*/
|
|
826
|
+
metadata?: MemoryMetadata | null;
|
|
751
827
|
/**
|
|
752
828
|
* Body param: Whether to enable additional ranking of search results. Default is
|
|
753
829
|
* false because results are already ranked when using an LLM for search
|
|
@@ -756,8 +832,9 @@ export interface MemorySearchParams {
|
|
|
756
832
|
*/
|
|
757
833
|
rank_results?: boolean;
|
|
758
834
|
/**
|
|
759
|
-
* Body param: Optional user ID to filter search results by a specific
|
|
760
|
-
* provided, results are not filtered by user.
|
|
835
|
+
* Body param: Optional internal user ID to filter search results by a specific
|
|
836
|
+
* user. If not provided, results are not filtered by user. If both user_id and
|
|
837
|
+
* external_user_id are provided, user_id takes precedence.
|
|
761
838
|
*/
|
|
762
839
|
user_id?: string | null;
|
|
763
840
|
/**
|