@amaster.ai/client 1.1.52 → 1.1.54-beta.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/dist/index.cjs +403 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +202 -3
- package/dist/index.d.ts +202 -3
- package/dist/index.js +403 -0
- package/dist/index.js.map +1 -1
- package/package.json +11 -11
- package/types/index.d.ts +36 -0
- package/types/knowledge.d.ts +235 -0
package/dist/index.d.cts
CHANGED
|
@@ -6,6 +6,8 @@ import { BpmClient } from '@amaster.ai/bpm-client';
|
|
|
6
6
|
export { ActivityInstanceTree, CamundaVariable, HistoryActivityInstance, HistoryProcessInstance, HistoryTask, ProcessInstance, ProcessVariable, Task, TaskFormSchema, TaskQueryParams, UserOperationLog } from '@amaster.ai/bpm-client';
|
|
7
7
|
import { WorkflowClient } from '@amaster.ai/workflow-client';
|
|
8
8
|
export { WorkflowAsyncRunDetailResponse, WorkflowAsyncRunResponse, WorkflowAsyncRunStatus, WorkflowCallbackConfig, WorkflowFile, WorkflowInputValue, WorkflowNodeUsage, WorkflowRunDetailOptions, WorkflowRunRequest, WorkflowRunResponse, WorkflowRunUsage, WorkflowUsageSummary } from '@amaster.ai/workflow-client';
|
|
9
|
+
import { ClientResult, MiniProgramRuntime, HttpClient } from '@amaster.ai/http-client';
|
|
10
|
+
export { ClientError, ClientResult, HttpClient, RequestConfig } from '@amaster.ai/http-client';
|
|
9
11
|
import { ASRClientConfig, ASRClient, ASRHttpClientConfig, ASRHttpClient } from '@amaster.ai/asr-client';
|
|
10
12
|
export { ASRClient, ASRClientConfig, ASRHttpClient, ASRHttpClientConfig, ASRLanguage } from '@amaster.ai/asr-client';
|
|
11
13
|
import { CopilotClient } from '@amaster.ai/copilot-client';
|
|
@@ -16,8 +18,195 @@ import { TTSClientConfig, TTSClient } from '@amaster.ai/tts-client';
|
|
|
16
18
|
export { TTSClient, TTSClientConfig, TTSRuntime, TTSSnapshot, TTSSpeakController, TTSSpeakControllerOptions, TTSSpeakOptions, TTSStorageAdapter, createTTSSpeakController, preprocessTTSContent, splitTextIntoFragments } from '@amaster.ai/tts-client';
|
|
17
19
|
import { S3Client } from '@amaster.ai/s3-client';
|
|
18
20
|
export { S3Client, S3Metadata, S3UploadOptions, S3UploadProgress, S3UploadProgressPhase, UploadRes } from '@amaster.ai/s3-client';
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
|
|
22
|
+
type KnowledgeDocumentStatus = "completed" | "indexing" | "error" | "paused";
|
|
23
|
+
type KnowledgeDocumentListStatus = KnowledgeDocumentStatus | "all";
|
|
24
|
+
type KnowledgeRoles = string | string[];
|
|
25
|
+
type KnowledgeDatasetIdResponse = {
|
|
26
|
+
dataset_id: string;
|
|
27
|
+
tenant_id?: string;
|
|
28
|
+
workspace_id?: string;
|
|
29
|
+
};
|
|
30
|
+
type KnowledgeDocument = {
|
|
31
|
+
id: string;
|
|
32
|
+
name: string;
|
|
33
|
+
data_source_type?: string;
|
|
34
|
+
doc_type?: string | null;
|
|
35
|
+
doc_form?: string | null;
|
|
36
|
+
indexing_status?: string;
|
|
37
|
+
display_status?: string;
|
|
38
|
+
enabled?: boolean;
|
|
39
|
+
archived?: boolean;
|
|
40
|
+
word_count?: number;
|
|
41
|
+
hit_count?: number;
|
|
42
|
+
position?: number;
|
|
43
|
+
created_at?: number;
|
|
44
|
+
updated_at?: number;
|
|
45
|
+
completed_segments?: number;
|
|
46
|
+
total_segments?: number;
|
|
47
|
+
[key: string]: unknown;
|
|
48
|
+
};
|
|
49
|
+
type KnowledgeDocumentListResponse = {
|
|
50
|
+
data: KnowledgeDocument[];
|
|
51
|
+
total: number;
|
|
52
|
+
page: number;
|
|
53
|
+
limit: number;
|
|
54
|
+
has_more: boolean;
|
|
55
|
+
};
|
|
56
|
+
type KnowledgeChildChunk = {
|
|
57
|
+
id: string;
|
|
58
|
+
segment_id: string;
|
|
59
|
+
content: string;
|
|
60
|
+
position: number;
|
|
61
|
+
word_count?: number;
|
|
62
|
+
type?: string;
|
|
63
|
+
created_at?: number;
|
|
64
|
+
updated_at?: number;
|
|
65
|
+
};
|
|
66
|
+
type KnowledgeSegmentAttachment = {
|
|
67
|
+
id: string;
|
|
68
|
+
name: string;
|
|
69
|
+
size?: number;
|
|
70
|
+
extension?: string;
|
|
71
|
+
mime_type?: string;
|
|
72
|
+
source_url?: string;
|
|
73
|
+
};
|
|
74
|
+
type KnowledgeSegment = {
|
|
75
|
+
id: string;
|
|
76
|
+
position: number;
|
|
77
|
+
document_id: string;
|
|
78
|
+
content: string;
|
|
79
|
+
answer?: string | null;
|
|
80
|
+
word_count?: number;
|
|
81
|
+
tokens?: number;
|
|
82
|
+
keywords?: string[];
|
|
83
|
+
hit_count?: number;
|
|
84
|
+
enabled?: boolean;
|
|
85
|
+
status?: string;
|
|
86
|
+
created_at?: number;
|
|
87
|
+
updated_at?: number;
|
|
88
|
+
indexing_at?: number | null;
|
|
89
|
+
completed_at?: number | null;
|
|
90
|
+
error?: string | null;
|
|
91
|
+
child_chunks?: KnowledgeChildChunk[];
|
|
92
|
+
attachments?: KnowledgeSegmentAttachment[];
|
|
93
|
+
};
|
|
94
|
+
type KnowledgeSegmentListResponse = {
|
|
95
|
+
data: KnowledgeSegment[];
|
|
96
|
+
total: number;
|
|
97
|
+
total_pages: number;
|
|
98
|
+
page: number;
|
|
99
|
+
limit: number;
|
|
100
|
+
has_more: boolean;
|
|
101
|
+
};
|
|
102
|
+
type KnowledgeIndexingStatus = {
|
|
103
|
+
id: string;
|
|
104
|
+
name?: string;
|
|
105
|
+
indexing_status?: string;
|
|
106
|
+
processing_started_at?: number | null;
|
|
107
|
+
parsing_completed_at?: number | null;
|
|
108
|
+
cleaning_completed_at?: number | null;
|
|
109
|
+
splitting_completed_at?: number | null;
|
|
110
|
+
completed_at?: number | null;
|
|
111
|
+
paused_at?: number | null;
|
|
112
|
+
stopped_at?: number | null;
|
|
113
|
+
completed_segments?: number;
|
|
114
|
+
total_segments?: number;
|
|
115
|
+
error?: string | null;
|
|
116
|
+
[key: string]: unknown;
|
|
117
|
+
};
|
|
118
|
+
type KnowledgeIndexingStatusResponse = {
|
|
119
|
+
data: KnowledgeIndexingStatus[];
|
|
120
|
+
};
|
|
121
|
+
type KnowledgeUploadResponse = {
|
|
122
|
+
document: KnowledgeDocument;
|
|
123
|
+
batch: string;
|
|
124
|
+
};
|
|
125
|
+
type KnowledgeMetadataField = {
|
|
126
|
+
id: string;
|
|
127
|
+
name: string;
|
|
128
|
+
type?: "string" | "number" | "time" | string;
|
|
129
|
+
value: unknown;
|
|
130
|
+
};
|
|
131
|
+
type KnowledgeMetadataOperation = {
|
|
132
|
+
document_id: string;
|
|
133
|
+
metadata_list: KnowledgeMetadataField[];
|
|
134
|
+
partial_update?: boolean;
|
|
135
|
+
};
|
|
136
|
+
type KnowledgeMetadataUpdateRequest = {
|
|
137
|
+
operation_data: KnowledgeMetadataOperation[];
|
|
138
|
+
};
|
|
139
|
+
type KnowledgeResolveOptions = {
|
|
140
|
+
datasetId: string;
|
|
141
|
+
orgCode?: string;
|
|
142
|
+
refresh?: boolean;
|
|
143
|
+
workspaceId?: string;
|
|
144
|
+
tenantId?: string;
|
|
145
|
+
} | {
|
|
146
|
+
datasetId?: string;
|
|
147
|
+
orgCode: string;
|
|
148
|
+
refresh?: boolean;
|
|
149
|
+
workspaceId?: string;
|
|
150
|
+
tenantId?: string;
|
|
151
|
+
};
|
|
152
|
+
type KnowledgeGetDatasetIdOptions = {
|
|
153
|
+
orgCode: string;
|
|
154
|
+
refresh?: boolean;
|
|
155
|
+
};
|
|
156
|
+
type KnowledgeListDocumentsOptions = KnowledgeResolveOptions & {
|
|
157
|
+
page?: number;
|
|
158
|
+
limit?: number;
|
|
159
|
+
keyword?: string;
|
|
160
|
+
status?: KnowledgeDocumentListStatus;
|
|
161
|
+
sort?: string;
|
|
162
|
+
fetch?: boolean | string;
|
|
163
|
+
appCode?: string;
|
|
164
|
+
roles?: KnowledgeRoles;
|
|
165
|
+
};
|
|
166
|
+
type KnowledgeGetDocumentOptions = KnowledgeResolveOptions & {
|
|
167
|
+
documentId: string;
|
|
168
|
+
appCode?: string;
|
|
169
|
+
roles?: KnowledgeRoles;
|
|
170
|
+
};
|
|
171
|
+
type KnowledgeListSegmentsOptions = KnowledgeGetDocumentOptions & {
|
|
172
|
+
page?: number;
|
|
173
|
+
limit?: number;
|
|
174
|
+
keyword?: string;
|
|
175
|
+
enabled?: boolean | "all";
|
|
176
|
+
status?: string;
|
|
177
|
+
hitCountGte?: number;
|
|
178
|
+
};
|
|
179
|
+
type KnowledgeUploadDocumentOptions = KnowledgeResolveOptions & {
|
|
180
|
+
file: File | Blob;
|
|
181
|
+
fileName?: string;
|
|
182
|
+
appCode?: string;
|
|
183
|
+
config?: Record<string, unknown>;
|
|
184
|
+
};
|
|
185
|
+
type KnowledgeIndexingStatusOptions = KnowledgeResolveOptions & {
|
|
186
|
+
batch: string;
|
|
187
|
+
};
|
|
188
|
+
type KnowledgeWaitForIndexingOptions = KnowledgeIndexingStatusOptions & {
|
|
189
|
+
intervalMs?: number;
|
|
190
|
+
timeoutMs?: number;
|
|
191
|
+
};
|
|
192
|
+
type KnowledgeDeleteDocumentOptions = KnowledgeResolveOptions & {
|
|
193
|
+
documentId: string;
|
|
194
|
+
appCode?: string;
|
|
195
|
+
};
|
|
196
|
+
type KnowledgeUpdateDocumentsMetadataOptions = KnowledgeResolveOptions & KnowledgeMetadataUpdateRequest;
|
|
197
|
+
type KnowledgeClient = {
|
|
198
|
+
getDatasetId(options: KnowledgeGetDatasetIdOptions): Promise<ClientResult<KnowledgeDatasetIdResponse>>;
|
|
199
|
+
listDocuments(options: KnowledgeListDocumentsOptions): Promise<ClientResult<KnowledgeDocumentListResponse>>;
|
|
200
|
+
getDocument(options: KnowledgeGetDocumentOptions): Promise<ClientResult<KnowledgeDocument>>;
|
|
201
|
+
listSegments(options: KnowledgeListSegmentsOptions): Promise<ClientResult<KnowledgeSegmentListResponse>>;
|
|
202
|
+
uploadDocument(options: KnowledgeUploadDocumentOptions): Promise<ClientResult<KnowledgeUploadResponse>>;
|
|
203
|
+
getIndexingStatus(options: KnowledgeIndexingStatusOptions): Promise<ClientResult<KnowledgeIndexingStatusResponse>>;
|
|
204
|
+
waitForIndexing(options: KnowledgeWaitForIndexingOptions): Promise<ClientResult<KnowledgeIndexingStatusResponse>>;
|
|
205
|
+
deleteDocument(options: KnowledgeDeleteDocumentOptions): Promise<ClientResult<null>>;
|
|
206
|
+
updateDocumentsMetadata(options: KnowledgeUpdateDocumentsMetadataOptions): Promise<ClientResult<{
|
|
207
|
+
result: string;
|
|
208
|
+
}>>;
|
|
209
|
+
};
|
|
21
210
|
|
|
22
211
|
/**
|
|
23
212
|
* Amaster Client Configuration Options
|
|
@@ -173,6 +362,16 @@ interface AmasterClient {
|
|
|
173
362
|
* ```
|
|
174
363
|
*/
|
|
175
364
|
workflow: WorkflowClient;
|
|
365
|
+
/**
|
|
366
|
+
* Knowledge base document management module
|
|
367
|
+
*
|
|
368
|
+
* @example
|
|
369
|
+
* ```typescript
|
|
370
|
+
* await client.knowledge.listDocuments({ orgCode: 'org-123', appCode: 'demo-app' });
|
|
371
|
+
* await client.knowledge.uploadDocument({ orgCode: 'org-123', appCode: 'demo-app', file });
|
|
372
|
+
* ```
|
|
373
|
+
*/
|
|
374
|
+
knowledge: KnowledgeClient;
|
|
176
375
|
/**
|
|
177
376
|
* ASR (Automatic Speech Recognition) module - WebSocket-based real-time speech recognition
|
|
178
377
|
*
|
|
@@ -437,4 +636,4 @@ interface AmasterClient {
|
|
|
437
636
|
*/
|
|
438
637
|
declare function createClient(options?: AmasterClientOptions): AmasterClient;
|
|
439
638
|
|
|
440
|
-
export { type AmasterClient, type AmasterClientOptions, createClient };
|
|
639
|
+
export { type AmasterClient, type AmasterClientOptions, type KnowledgeChildChunk, type KnowledgeClient, type KnowledgeDatasetIdResponse, type KnowledgeDeleteDocumentOptions, type KnowledgeDocument, type KnowledgeDocumentListResponse, type KnowledgeDocumentListStatus, type KnowledgeDocumentStatus, type KnowledgeGetDatasetIdOptions, type KnowledgeGetDocumentOptions, type KnowledgeIndexingStatus, type KnowledgeIndexingStatusOptions, type KnowledgeIndexingStatusResponse, type KnowledgeListDocumentsOptions, type KnowledgeListSegmentsOptions, type KnowledgeMetadataField, type KnowledgeMetadataOperation, type KnowledgeMetadataUpdateRequest, type KnowledgeResolveOptions, type KnowledgeRoles, type KnowledgeSegment, type KnowledgeSegmentAttachment, type KnowledgeSegmentListResponse, type KnowledgeUpdateDocumentsMetadataOptions, type KnowledgeUploadDocumentOptions, type KnowledgeUploadResponse, type KnowledgeWaitForIndexingOptions, createClient };
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ import { BpmClient } from '@amaster.ai/bpm-client';
|
|
|
6
6
|
export { ActivityInstanceTree, CamundaVariable, HistoryActivityInstance, HistoryProcessInstance, HistoryTask, ProcessInstance, ProcessVariable, Task, TaskFormSchema, TaskQueryParams, UserOperationLog } from '@amaster.ai/bpm-client';
|
|
7
7
|
import { WorkflowClient } from '@amaster.ai/workflow-client';
|
|
8
8
|
export { WorkflowAsyncRunDetailResponse, WorkflowAsyncRunResponse, WorkflowAsyncRunStatus, WorkflowCallbackConfig, WorkflowFile, WorkflowInputValue, WorkflowNodeUsage, WorkflowRunDetailOptions, WorkflowRunRequest, WorkflowRunResponse, WorkflowRunUsage, WorkflowUsageSummary } from '@amaster.ai/workflow-client';
|
|
9
|
+
import { ClientResult, MiniProgramRuntime, HttpClient } from '@amaster.ai/http-client';
|
|
10
|
+
export { ClientError, ClientResult, HttpClient, RequestConfig } from '@amaster.ai/http-client';
|
|
9
11
|
import { ASRClientConfig, ASRClient, ASRHttpClientConfig, ASRHttpClient } from '@amaster.ai/asr-client';
|
|
10
12
|
export { ASRClient, ASRClientConfig, ASRHttpClient, ASRHttpClientConfig, ASRLanguage } from '@amaster.ai/asr-client';
|
|
11
13
|
import { CopilotClient } from '@amaster.ai/copilot-client';
|
|
@@ -16,8 +18,195 @@ import { TTSClientConfig, TTSClient } from '@amaster.ai/tts-client';
|
|
|
16
18
|
export { TTSClient, TTSClientConfig, TTSRuntime, TTSSnapshot, TTSSpeakController, TTSSpeakControllerOptions, TTSSpeakOptions, TTSStorageAdapter, createTTSSpeakController, preprocessTTSContent, splitTextIntoFragments } from '@amaster.ai/tts-client';
|
|
17
19
|
import { S3Client } from '@amaster.ai/s3-client';
|
|
18
20
|
export { S3Client, S3Metadata, S3UploadOptions, S3UploadProgress, S3UploadProgressPhase, UploadRes } from '@amaster.ai/s3-client';
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
|
|
22
|
+
type KnowledgeDocumentStatus = "completed" | "indexing" | "error" | "paused";
|
|
23
|
+
type KnowledgeDocumentListStatus = KnowledgeDocumentStatus | "all";
|
|
24
|
+
type KnowledgeRoles = string | string[];
|
|
25
|
+
type KnowledgeDatasetIdResponse = {
|
|
26
|
+
dataset_id: string;
|
|
27
|
+
tenant_id?: string;
|
|
28
|
+
workspace_id?: string;
|
|
29
|
+
};
|
|
30
|
+
type KnowledgeDocument = {
|
|
31
|
+
id: string;
|
|
32
|
+
name: string;
|
|
33
|
+
data_source_type?: string;
|
|
34
|
+
doc_type?: string | null;
|
|
35
|
+
doc_form?: string | null;
|
|
36
|
+
indexing_status?: string;
|
|
37
|
+
display_status?: string;
|
|
38
|
+
enabled?: boolean;
|
|
39
|
+
archived?: boolean;
|
|
40
|
+
word_count?: number;
|
|
41
|
+
hit_count?: number;
|
|
42
|
+
position?: number;
|
|
43
|
+
created_at?: number;
|
|
44
|
+
updated_at?: number;
|
|
45
|
+
completed_segments?: number;
|
|
46
|
+
total_segments?: number;
|
|
47
|
+
[key: string]: unknown;
|
|
48
|
+
};
|
|
49
|
+
type KnowledgeDocumentListResponse = {
|
|
50
|
+
data: KnowledgeDocument[];
|
|
51
|
+
total: number;
|
|
52
|
+
page: number;
|
|
53
|
+
limit: number;
|
|
54
|
+
has_more: boolean;
|
|
55
|
+
};
|
|
56
|
+
type KnowledgeChildChunk = {
|
|
57
|
+
id: string;
|
|
58
|
+
segment_id: string;
|
|
59
|
+
content: string;
|
|
60
|
+
position: number;
|
|
61
|
+
word_count?: number;
|
|
62
|
+
type?: string;
|
|
63
|
+
created_at?: number;
|
|
64
|
+
updated_at?: number;
|
|
65
|
+
};
|
|
66
|
+
type KnowledgeSegmentAttachment = {
|
|
67
|
+
id: string;
|
|
68
|
+
name: string;
|
|
69
|
+
size?: number;
|
|
70
|
+
extension?: string;
|
|
71
|
+
mime_type?: string;
|
|
72
|
+
source_url?: string;
|
|
73
|
+
};
|
|
74
|
+
type KnowledgeSegment = {
|
|
75
|
+
id: string;
|
|
76
|
+
position: number;
|
|
77
|
+
document_id: string;
|
|
78
|
+
content: string;
|
|
79
|
+
answer?: string | null;
|
|
80
|
+
word_count?: number;
|
|
81
|
+
tokens?: number;
|
|
82
|
+
keywords?: string[];
|
|
83
|
+
hit_count?: number;
|
|
84
|
+
enabled?: boolean;
|
|
85
|
+
status?: string;
|
|
86
|
+
created_at?: number;
|
|
87
|
+
updated_at?: number;
|
|
88
|
+
indexing_at?: number | null;
|
|
89
|
+
completed_at?: number | null;
|
|
90
|
+
error?: string | null;
|
|
91
|
+
child_chunks?: KnowledgeChildChunk[];
|
|
92
|
+
attachments?: KnowledgeSegmentAttachment[];
|
|
93
|
+
};
|
|
94
|
+
type KnowledgeSegmentListResponse = {
|
|
95
|
+
data: KnowledgeSegment[];
|
|
96
|
+
total: number;
|
|
97
|
+
total_pages: number;
|
|
98
|
+
page: number;
|
|
99
|
+
limit: number;
|
|
100
|
+
has_more: boolean;
|
|
101
|
+
};
|
|
102
|
+
type KnowledgeIndexingStatus = {
|
|
103
|
+
id: string;
|
|
104
|
+
name?: string;
|
|
105
|
+
indexing_status?: string;
|
|
106
|
+
processing_started_at?: number | null;
|
|
107
|
+
parsing_completed_at?: number | null;
|
|
108
|
+
cleaning_completed_at?: number | null;
|
|
109
|
+
splitting_completed_at?: number | null;
|
|
110
|
+
completed_at?: number | null;
|
|
111
|
+
paused_at?: number | null;
|
|
112
|
+
stopped_at?: number | null;
|
|
113
|
+
completed_segments?: number;
|
|
114
|
+
total_segments?: number;
|
|
115
|
+
error?: string | null;
|
|
116
|
+
[key: string]: unknown;
|
|
117
|
+
};
|
|
118
|
+
type KnowledgeIndexingStatusResponse = {
|
|
119
|
+
data: KnowledgeIndexingStatus[];
|
|
120
|
+
};
|
|
121
|
+
type KnowledgeUploadResponse = {
|
|
122
|
+
document: KnowledgeDocument;
|
|
123
|
+
batch: string;
|
|
124
|
+
};
|
|
125
|
+
type KnowledgeMetadataField = {
|
|
126
|
+
id: string;
|
|
127
|
+
name: string;
|
|
128
|
+
type?: "string" | "number" | "time" | string;
|
|
129
|
+
value: unknown;
|
|
130
|
+
};
|
|
131
|
+
type KnowledgeMetadataOperation = {
|
|
132
|
+
document_id: string;
|
|
133
|
+
metadata_list: KnowledgeMetadataField[];
|
|
134
|
+
partial_update?: boolean;
|
|
135
|
+
};
|
|
136
|
+
type KnowledgeMetadataUpdateRequest = {
|
|
137
|
+
operation_data: KnowledgeMetadataOperation[];
|
|
138
|
+
};
|
|
139
|
+
type KnowledgeResolveOptions = {
|
|
140
|
+
datasetId: string;
|
|
141
|
+
orgCode?: string;
|
|
142
|
+
refresh?: boolean;
|
|
143
|
+
workspaceId?: string;
|
|
144
|
+
tenantId?: string;
|
|
145
|
+
} | {
|
|
146
|
+
datasetId?: string;
|
|
147
|
+
orgCode: string;
|
|
148
|
+
refresh?: boolean;
|
|
149
|
+
workspaceId?: string;
|
|
150
|
+
tenantId?: string;
|
|
151
|
+
};
|
|
152
|
+
type KnowledgeGetDatasetIdOptions = {
|
|
153
|
+
orgCode: string;
|
|
154
|
+
refresh?: boolean;
|
|
155
|
+
};
|
|
156
|
+
type KnowledgeListDocumentsOptions = KnowledgeResolveOptions & {
|
|
157
|
+
page?: number;
|
|
158
|
+
limit?: number;
|
|
159
|
+
keyword?: string;
|
|
160
|
+
status?: KnowledgeDocumentListStatus;
|
|
161
|
+
sort?: string;
|
|
162
|
+
fetch?: boolean | string;
|
|
163
|
+
appCode?: string;
|
|
164
|
+
roles?: KnowledgeRoles;
|
|
165
|
+
};
|
|
166
|
+
type KnowledgeGetDocumentOptions = KnowledgeResolveOptions & {
|
|
167
|
+
documentId: string;
|
|
168
|
+
appCode?: string;
|
|
169
|
+
roles?: KnowledgeRoles;
|
|
170
|
+
};
|
|
171
|
+
type KnowledgeListSegmentsOptions = KnowledgeGetDocumentOptions & {
|
|
172
|
+
page?: number;
|
|
173
|
+
limit?: number;
|
|
174
|
+
keyword?: string;
|
|
175
|
+
enabled?: boolean | "all";
|
|
176
|
+
status?: string;
|
|
177
|
+
hitCountGte?: number;
|
|
178
|
+
};
|
|
179
|
+
type KnowledgeUploadDocumentOptions = KnowledgeResolveOptions & {
|
|
180
|
+
file: File | Blob;
|
|
181
|
+
fileName?: string;
|
|
182
|
+
appCode?: string;
|
|
183
|
+
config?: Record<string, unknown>;
|
|
184
|
+
};
|
|
185
|
+
type KnowledgeIndexingStatusOptions = KnowledgeResolveOptions & {
|
|
186
|
+
batch: string;
|
|
187
|
+
};
|
|
188
|
+
type KnowledgeWaitForIndexingOptions = KnowledgeIndexingStatusOptions & {
|
|
189
|
+
intervalMs?: number;
|
|
190
|
+
timeoutMs?: number;
|
|
191
|
+
};
|
|
192
|
+
type KnowledgeDeleteDocumentOptions = KnowledgeResolveOptions & {
|
|
193
|
+
documentId: string;
|
|
194
|
+
appCode?: string;
|
|
195
|
+
};
|
|
196
|
+
type KnowledgeUpdateDocumentsMetadataOptions = KnowledgeResolveOptions & KnowledgeMetadataUpdateRequest;
|
|
197
|
+
type KnowledgeClient = {
|
|
198
|
+
getDatasetId(options: KnowledgeGetDatasetIdOptions): Promise<ClientResult<KnowledgeDatasetIdResponse>>;
|
|
199
|
+
listDocuments(options: KnowledgeListDocumentsOptions): Promise<ClientResult<KnowledgeDocumentListResponse>>;
|
|
200
|
+
getDocument(options: KnowledgeGetDocumentOptions): Promise<ClientResult<KnowledgeDocument>>;
|
|
201
|
+
listSegments(options: KnowledgeListSegmentsOptions): Promise<ClientResult<KnowledgeSegmentListResponse>>;
|
|
202
|
+
uploadDocument(options: KnowledgeUploadDocumentOptions): Promise<ClientResult<KnowledgeUploadResponse>>;
|
|
203
|
+
getIndexingStatus(options: KnowledgeIndexingStatusOptions): Promise<ClientResult<KnowledgeIndexingStatusResponse>>;
|
|
204
|
+
waitForIndexing(options: KnowledgeWaitForIndexingOptions): Promise<ClientResult<KnowledgeIndexingStatusResponse>>;
|
|
205
|
+
deleteDocument(options: KnowledgeDeleteDocumentOptions): Promise<ClientResult<null>>;
|
|
206
|
+
updateDocumentsMetadata(options: KnowledgeUpdateDocumentsMetadataOptions): Promise<ClientResult<{
|
|
207
|
+
result: string;
|
|
208
|
+
}>>;
|
|
209
|
+
};
|
|
21
210
|
|
|
22
211
|
/**
|
|
23
212
|
* Amaster Client Configuration Options
|
|
@@ -173,6 +362,16 @@ interface AmasterClient {
|
|
|
173
362
|
* ```
|
|
174
363
|
*/
|
|
175
364
|
workflow: WorkflowClient;
|
|
365
|
+
/**
|
|
366
|
+
* Knowledge base document management module
|
|
367
|
+
*
|
|
368
|
+
* @example
|
|
369
|
+
* ```typescript
|
|
370
|
+
* await client.knowledge.listDocuments({ orgCode: 'org-123', appCode: 'demo-app' });
|
|
371
|
+
* await client.knowledge.uploadDocument({ orgCode: 'org-123', appCode: 'demo-app', file });
|
|
372
|
+
* ```
|
|
373
|
+
*/
|
|
374
|
+
knowledge: KnowledgeClient;
|
|
176
375
|
/**
|
|
177
376
|
* ASR (Automatic Speech Recognition) module - WebSocket-based real-time speech recognition
|
|
178
377
|
*
|
|
@@ -437,4 +636,4 @@ interface AmasterClient {
|
|
|
437
636
|
*/
|
|
438
637
|
declare function createClient(options?: AmasterClientOptions): AmasterClient;
|
|
439
638
|
|
|
440
|
-
export { type AmasterClient, type AmasterClientOptions, createClient };
|
|
639
|
+
export { type AmasterClient, type AmasterClientOptions, type KnowledgeChildChunk, type KnowledgeClient, type KnowledgeDatasetIdResponse, type KnowledgeDeleteDocumentOptions, type KnowledgeDocument, type KnowledgeDocumentListResponse, type KnowledgeDocumentListStatus, type KnowledgeDocumentStatus, type KnowledgeGetDatasetIdOptions, type KnowledgeGetDocumentOptions, type KnowledgeIndexingStatus, type KnowledgeIndexingStatusOptions, type KnowledgeIndexingStatusResponse, type KnowledgeListDocumentsOptions, type KnowledgeListSegmentsOptions, type KnowledgeMetadataField, type KnowledgeMetadataOperation, type KnowledgeMetadataUpdateRequest, type KnowledgeResolveOptions, type KnowledgeRoles, type KnowledgeSegment, type KnowledgeSegmentAttachment, type KnowledgeSegmentListResponse, type KnowledgeUpdateDocumentsMetadataOptions, type KnowledgeUploadDocumentOptions, type KnowledgeUploadResponse, type KnowledgeWaitForIndexingOptions, createClient };
|