@studyfetch/sdk 1.25.0 → 1.26.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 +10 -0
- package/package.json +1 -1
- package/resources/v1/assignment-grader.d.mts +34 -1
- package/resources/v1/assignment-grader.d.mts.map +1 -1
- package/resources/v1/assignment-grader.d.ts +34 -1
- package/resources/v1/assignment-grader.d.ts.map +1 -1
- package/resources/v1/assignment-grader.js +15 -0
- package/resources/v1/assignment-grader.js.map +1 -1
- package/resources/v1/assignment-grader.mjs +15 -0
- package/resources/v1/assignment-grader.mjs.map +1 -1
- package/resources/v1/chat/chat.d.mts +62 -1
- package/resources/v1/chat/chat.d.mts.map +1 -1
- package/resources/v1/chat/chat.d.ts +62 -1
- package/resources/v1/chat/chat.d.ts.map +1 -1
- package/resources/v1/chat/chat.js.map +1 -1
- package/resources/v1/chat/chat.mjs.map +1 -1
- package/resources/v1/chat/index.d.mts +1 -1
- package/resources/v1/chat/index.d.mts.map +1 -1
- package/resources/v1/chat/index.d.ts +1 -1
- package/resources/v1/chat/index.d.ts.map +1 -1
- package/resources/v1/chat/index.js.map +1 -1
- package/resources/v1/chat/index.mjs +1 -1
- package/resources/v1/chat/index.mjs.map +1 -1
- package/resources/v1/components.d.mts +62 -4
- package/resources/v1/components.d.mts.map +1 -1
- package/resources/v1/components.d.ts +62 -4
- package/resources/v1/components.d.ts.map +1 -1
- package/resources/v1/data-analyst/data-analyst.d.mts +156 -0
- package/resources/v1/data-analyst/data-analyst.d.mts.map +1 -0
- package/resources/v1/data-analyst/data-analyst.d.ts +156 -0
- package/resources/v1/data-analyst/data-analyst.d.ts.map +1 -0
- package/resources/v1/data-analyst/data-analyst.js +99 -0
- package/resources/v1/data-analyst/data-analyst.js.map +1 -0
- package/resources/v1/data-analyst/data-analyst.mjs +94 -0
- package/resources/v1/data-analyst/data-analyst.mjs.map +1 -0
- package/resources/v1/data-analyst/index.d.mts +4 -0
- package/resources/v1/data-analyst/index.d.mts.map +1 -0
- package/resources/v1/data-analyst/index.d.ts +4 -0
- package/resources/v1/data-analyst/index.d.ts.map +1 -0
- package/resources/v1/data-analyst/index.js +11 -0
- package/resources/v1/data-analyst/index.js.map +1 -0
- package/resources/v1/data-analyst/index.mjs +5 -0
- package/resources/v1/data-analyst/index.mjs.map +1 -0
- package/resources/v1/data-analyst/sessions.d.mts +28 -0
- package/resources/v1/data-analyst/sessions.d.mts.map +1 -0
- package/resources/v1/data-analyst/sessions.d.ts +28 -0
- package/resources/v1/data-analyst/sessions.d.ts.map +1 -0
- package/resources/v1/data-analyst/sessions.js +38 -0
- package/resources/v1/data-analyst/sessions.js.map +1 -0
- package/resources/v1/data-analyst/sessions.mjs +34 -0
- package/resources/v1/data-analyst/sessions.mjs.map +1 -0
- package/resources/v1/data-analyst/test.d.mts +20 -0
- package/resources/v1/data-analyst/test.d.mts.map +1 -0
- package/resources/v1/data-analyst/test.d.ts +20 -0
- package/resources/v1/data-analyst/test.d.ts.map +1 -0
- package/resources/v1/data-analyst/test.js +34 -0
- package/resources/v1/data-analyst/test.js.map +1 -0
- package/resources/v1/data-analyst/test.mjs +30 -0
- package/resources/v1/data-analyst/test.mjs.map +1 -0
- package/resources/v1/data-analyst.d.mts +2 -0
- package/resources/v1/data-analyst.d.mts.map +1 -0
- package/resources/v1/data-analyst.d.ts +2 -0
- package/resources/v1/data-analyst.d.ts.map +1 -0
- package/resources/v1/data-analyst.js +6 -0
- package/resources/v1/data-analyst.js.map +1 -0
- package/resources/v1/data-analyst.mjs +3 -0
- package/resources/v1/data-analyst.mjs.map +1 -0
- package/resources/v1/index.d.mts +3 -2
- package/resources/v1/index.d.mts.map +1 -1
- package/resources/v1/index.d.ts +3 -2
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js +15 -13
- package/resources/v1/index.js.map +1 -1
- package/resources/v1/index.mjs +1 -0
- package/resources/v1/index.mjs.map +1 -1
- package/resources/v1/materials/index.d.mts +2 -2
- package/resources/v1/materials/index.d.mts.map +1 -1
- package/resources/v1/materials/index.d.ts +2 -2
- package/resources/v1/materials/index.d.ts.map +1 -1
- package/resources/v1/materials/index.js.map +1 -1
- package/resources/v1/materials/index.mjs.map +1 -1
- package/resources/v1/materials/materials.d.mts +59 -27
- package/resources/v1/materials/materials.d.mts.map +1 -1
- package/resources/v1/materials/materials.d.ts +59 -27
- package/resources/v1/materials/materials.d.ts.map +1 -1
- package/resources/v1/materials/materials.js +17 -0
- package/resources/v1/materials/materials.js.map +1 -1
- package/resources/v1/materials/materials.mjs +17 -0
- package/resources/v1/materials/materials.mjs.map +1 -1
- package/resources/v1/materials/upload.d.mts +84 -1
- package/resources/v1/materials/upload.d.mts.map +1 -1
- package/resources/v1/materials/upload.d.ts +84 -1
- package/resources/v1/materials/upload.d.ts.map +1 -1
- package/resources/v1/materials/upload.js +32 -0
- package/resources/v1/materials/upload.js.map +1 -1
- package/resources/v1/materials/upload.mjs +32 -0
- package/resources/v1/materials/upload.mjs.map +1 -1
- package/resources/v1/usage/analyst.d.mts +51 -6
- package/resources/v1/usage/analyst.d.mts.map +1 -1
- package/resources/v1/usage/analyst.d.ts +51 -6
- package/resources/v1/usage/analyst.d.ts.map +1 -1
- package/resources/v1/usage/analyst.js +8 -9
- package/resources/v1/usage/analyst.js.map +1 -1
- package/resources/v1/usage/analyst.mjs +8 -9
- package/resources/v1/usage/analyst.mjs.map +1 -1
- package/resources/v1/usage/index.d.mts +1 -1
- package/resources/v1/usage/index.d.mts.map +1 -1
- package/resources/v1/usage/index.d.ts +1 -1
- package/resources/v1/usage/index.d.ts.map +1 -1
- package/resources/v1/usage/index.js.map +1 -1
- package/resources/v1/usage/index.mjs +1 -1
- package/resources/v1/usage/index.mjs.map +1 -1
- package/resources/v1/usage/usage.d.mts +2 -2
- package/resources/v1/usage/usage.d.mts.map +1 -1
- package/resources/v1/usage/usage.d.ts +2 -2
- package/resources/v1/usage/usage.d.ts.map +1 -1
- package/resources/v1/usage/usage.js.map +1 -1
- package/resources/v1/usage/usage.mjs +1 -1
- package/resources/v1/usage/usage.mjs.map +1 -1
- package/resources/v1/v1.d.mts +19 -4
- package/resources/v1/v1.d.mts.map +1 -1
- package/resources/v1/v1.d.ts +19 -4
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js +19 -0
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs +20 -1
- package/resources/v1/v1.mjs.map +1 -1
- package/src/resources/v1/assignment-grader.ts +47 -1
- package/src/resources/v1/chat/chat.ts +74 -0
- package/src/resources/v1/chat/index.ts +7 -1
- package/src/resources/v1/components.ts +76 -0
- package/src/resources/v1/data-analyst/data-analyst.ts +233 -0
- package/src/resources/v1/data-analyst/index.ts +10 -0
- package/src/resources/v1/data-analyst/sessions.ts +46 -0
- package/src/resources/v1/data-analyst/test.ts +34 -0
- package/src/resources/v1/data-analyst.ts +3 -0
- package/src/resources/v1/index.ts +9 -0
- package/src/resources/v1/materials/index.ts +5 -0
- package/src/resources/v1/materials/materials.ts +76 -28
- package/src/resources/v1/materials/upload.ts +114 -0
- package/src/resources/v1/usage/analyst.ts +80 -10
- package/src/resources/v1/usage/index.ts +7 -1
- package/src/resources/v1/usage/usage.ts +14 -2
- package/src/resources/v1/v1.ts +46 -1
- 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
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import * as SessionsAPI from './sessions';
|
|
5
|
+
import { SessionRetrieveParams, Sessions } from './sessions';
|
|
6
|
+
import * as TestAPI from './test';
|
|
7
|
+
import { Test } from './test';
|
|
8
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
9
|
+
import { buildHeaders } from '../../../internal/headers';
|
|
10
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
11
|
+
import { path } from '../../../internal/utils/path';
|
|
12
|
+
|
|
13
|
+
export class DataAnalyst extends APIResource {
|
|
14
|
+
sessions: SessionsAPI.Sessions = new SessionsAPI.Sessions(this._client);
|
|
15
|
+
test: TestAPI.Test = new TestAPI.Test(this._client);
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* await client.v1.dataAnalyst.getHistory();
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
getHistory(options?: RequestOptions): APIPromise<void> {
|
|
24
|
+
return this._client.post('/api/v1/data-analyst/history', {
|
|
25
|
+
...options,
|
|
26
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* await client.v1.dataAnalyst.retrieveSession('sessionId', {
|
|
34
|
+
* userId: 'userId',
|
|
35
|
+
* });
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
retrieveSession(
|
|
39
|
+
sessionID: string,
|
|
40
|
+
query: DataAnalystRetrieveSessionParams,
|
|
41
|
+
options?: RequestOptions,
|
|
42
|
+
): APIPromise<void> {
|
|
43
|
+
return this._client.get(path`/api/v1/data-analyst/session/${sessionID}`, {
|
|
44
|
+
query,
|
|
45
|
+
...options,
|
|
46
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* @example
|
|
52
|
+
* ```ts
|
|
53
|
+
* await client.v1.dataAnalyst.sendFollowups();
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
sendFollowups(options?: RequestOptions): APIPromise<void> {
|
|
57
|
+
return this._client.post('/api/v1/data-analyst/followups', {
|
|
58
|
+
...options,
|
|
59
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* @example
|
|
65
|
+
* ```ts
|
|
66
|
+
* await client.v1.dataAnalyst.sendMessage({
|
|
67
|
+
* componentId: 'componentId',
|
|
68
|
+
* message: {},
|
|
69
|
+
* 'x-component-id': 'x-component-id',
|
|
70
|
+
* });
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
sendMessage(params: DataAnalystSendMessageParams, options?: RequestOptions): APIPromise<void> {
|
|
74
|
+
const { 'x-component-id': xComponentID, ...body } = params;
|
|
75
|
+
return this._client.post('/api/v1/data-analyst/message', {
|
|
76
|
+
body,
|
|
77
|
+
...options,
|
|
78
|
+
headers: buildHeaders([{ Accept: '*/*', 'x-component-id': xComponentID }, options?.headers]),
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Stream chat responses
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* ```ts
|
|
87
|
+
* await client.v1.dataAnalyst.stream();
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
stream(params: DataAnalystStreamParams, options?: RequestOptions): APIPromise<void> {
|
|
91
|
+
const { 'x-component-id': xComponentID, ...body } = params;
|
|
92
|
+
return this._client.post('/api/v1/data-analyst/stream', {
|
|
93
|
+
body,
|
|
94
|
+
...options,
|
|
95
|
+
headers: buildHeaders([
|
|
96
|
+
{ Accept: '*/*', ...(xComponentID != null ? { 'x-component-id': xComponentID } : undefined) },
|
|
97
|
+
options?.headers,
|
|
98
|
+
]),
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export interface DataAnalystRetrieveSessionParams {
|
|
104
|
+
userId: string;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export interface DataAnalystSendMessageParams {
|
|
108
|
+
/**
|
|
109
|
+
* Body param: Component ID for context
|
|
110
|
+
*/
|
|
111
|
+
componentId: string;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Body param: Chat message content
|
|
115
|
+
*/
|
|
116
|
+
message: DataAnalystSendMessageParams.Message;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Header param:
|
|
120
|
+
*/
|
|
121
|
+
'x-component-id': string;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Body param: Additional context data
|
|
125
|
+
*/
|
|
126
|
+
context?: unknown;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Body param: Group IDs for collaboration
|
|
130
|
+
*/
|
|
131
|
+
groupIds?: Array<string>;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Body param: Session ID for conversation continuity
|
|
135
|
+
*/
|
|
136
|
+
sessionId?: string;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Body param: User ID for tracking
|
|
140
|
+
*/
|
|
141
|
+
userId?: string;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export namespace DataAnalystSendMessageParams {
|
|
145
|
+
/**
|
|
146
|
+
* Chat message content
|
|
147
|
+
*/
|
|
148
|
+
export interface Message {
|
|
149
|
+
/**
|
|
150
|
+
* Images attached to the message
|
|
151
|
+
*/
|
|
152
|
+
images?: Array<Message.Image>;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Text content of the message
|
|
156
|
+
*/
|
|
157
|
+
text?: string;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export namespace Message {
|
|
161
|
+
export interface Image {
|
|
162
|
+
/**
|
|
163
|
+
* Base64 encoded image data
|
|
164
|
+
*/
|
|
165
|
+
base64?: string;
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Caption for the image
|
|
169
|
+
*/
|
|
170
|
+
caption?: string;
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* MIME type of the image
|
|
174
|
+
*/
|
|
175
|
+
mimeType?: string;
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* URL of the image
|
|
179
|
+
*/
|
|
180
|
+
url?: string;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export interface DataAnalystStreamParams {
|
|
186
|
+
/**
|
|
187
|
+
* Body param:
|
|
188
|
+
*/
|
|
189
|
+
context?: unknown;
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Body param:
|
|
193
|
+
*/
|
|
194
|
+
groupId?: string;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Body param:
|
|
198
|
+
*/
|
|
199
|
+
messages?: Array<DataAnalystStreamParams.Message>;
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Body param:
|
|
203
|
+
*/
|
|
204
|
+
userId?: string;
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Header param: Component ID for context
|
|
208
|
+
*/
|
|
209
|
+
'x-component-id'?: string;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export namespace DataAnalystStreamParams {
|
|
213
|
+
export interface Message {
|
|
214
|
+
content?: string;
|
|
215
|
+
|
|
216
|
+
role?: 'user' | 'assistant' | 'system';
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
DataAnalyst.Sessions = Sessions;
|
|
221
|
+
DataAnalyst.Test = Test;
|
|
222
|
+
|
|
223
|
+
export declare namespace DataAnalyst {
|
|
224
|
+
export {
|
|
225
|
+
type DataAnalystRetrieveSessionParams as DataAnalystRetrieveSessionParams,
|
|
226
|
+
type DataAnalystSendMessageParams as DataAnalystSendMessageParams,
|
|
227
|
+
type DataAnalystStreamParams as DataAnalystStreamParams,
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
export { Sessions as Sessions, type SessionRetrieveParams as SessionRetrieveParams };
|
|
231
|
+
|
|
232
|
+
export { Test as Test };
|
|
233
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export {
|
|
4
|
+
DataAnalyst,
|
|
5
|
+
type DataAnalystRetrieveSessionParams,
|
|
6
|
+
type DataAnalystSendMessageParams,
|
|
7
|
+
type DataAnalystStreamParams,
|
|
8
|
+
} from './data-analyst';
|
|
9
|
+
export { Sessions, type SessionRetrieveParams } from './sessions';
|
|
10
|
+
export { Test } from './test';
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
5
|
+
import { buildHeaders } from '../../../internal/headers';
|
|
6
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
7
|
+
import { path } from '../../../internal/utils/path';
|
|
8
|
+
|
|
9
|
+
export class Sessions extends APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* await client.v1.dataAnalyst.sessions.create();
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
create(options?: RequestOptions): APIPromise<void> {
|
|
17
|
+
return this._client.post('/api/v1/data-analyst/sessions/create', {
|
|
18
|
+
...options,
|
|
19
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* await client.v1.dataAnalyst.sessions.retrieve('userId', {
|
|
27
|
+
* limit: 'limit',
|
|
28
|
+
* });
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
retrieve(userID: string, query: SessionRetrieveParams, options?: RequestOptions): APIPromise<void> {
|
|
32
|
+
return this._client.get(path`/api/v1/data-analyst/sessions/${userID}`, {
|
|
33
|
+
query,
|
|
34
|
+
...options,
|
|
35
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface SessionRetrieveParams {
|
|
41
|
+
limit: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export declare namespace Sessions {
|
|
45
|
+
export { type SessionRetrieveParams as SessionRetrieveParams };
|
|
46
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
5
|
+
import { buildHeaders } from '../../../internal/headers';
|
|
6
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
7
|
+
|
|
8
|
+
export class Test extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* await client.v1.dataAnalyst.test.uploadImage();
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
uploadImage(options?: RequestOptions): APIPromise<void> {
|
|
16
|
+
return this._client.post('/api/v1/data-analyst/test/image', {
|
|
17
|
+
...options,
|
|
18
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* await client.v1.dataAnalyst.test.uploadImageCitation();
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
uploadImageCitation(options?: RequestOptions): APIPromise<void> {
|
|
29
|
+
return this._client.post('/api/v1/data-analyst/test/image-citation', {
|
|
30
|
+
...options,
|
|
31
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -13,6 +13,7 @@ export {
|
|
|
13
13
|
} from './audio-recaps/index';
|
|
14
14
|
export {
|
|
15
15
|
Chat,
|
|
16
|
+
type Interaction,
|
|
16
17
|
type ChatGetSessionParams,
|
|
17
18
|
type ChatSendMessageParams,
|
|
18
19
|
type ChatStreamParams,
|
|
@@ -27,6 +28,12 @@ export {
|
|
|
27
28
|
type ComponentListParams,
|
|
28
29
|
type ComponentGenerateEmbedParams,
|
|
29
30
|
} from './components';
|
|
31
|
+
export {
|
|
32
|
+
DataAnalyst,
|
|
33
|
+
type DataAnalystRetrieveSessionParams,
|
|
34
|
+
type DataAnalystSendMessageParams,
|
|
35
|
+
type DataAnalystStreamParams,
|
|
36
|
+
} from './data-analyst/index';
|
|
30
37
|
export { Embed, type EmbedGetThemeParams, type EmbedVerifyParams } from './embed/index';
|
|
31
38
|
export { Explainers, type ExplainerCreateParams, type ExplainerHandleWebhookParams } from './explainers';
|
|
32
39
|
export {
|
|
@@ -43,6 +50,7 @@ export {
|
|
|
43
50
|
export { Folders, type FolderCreateParams, type FolderUpdateParams, type FolderListParams } from './folders';
|
|
44
51
|
export {
|
|
45
52
|
Materials,
|
|
53
|
+
type Content,
|
|
46
54
|
type Material,
|
|
47
55
|
type MaterialListResponse,
|
|
48
56
|
type MaterialBatchCreateResponse,
|
|
@@ -52,6 +60,7 @@ export {
|
|
|
52
60
|
type MaterialCreateParams,
|
|
53
61
|
type MaterialListParams,
|
|
54
62
|
type MaterialBatchCreateParams,
|
|
63
|
+
type MaterialCreateAndProcessParams,
|
|
55
64
|
type MaterialGetDownloadURLParams,
|
|
56
65
|
type MaterialMoveParams,
|
|
57
66
|
type MaterialRenameParams,
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
export { Bulk, type BulkMoveResponse, type BulkMoveParams } from './bulk';
|
|
4
4
|
export {
|
|
5
5
|
Materials,
|
|
6
|
+
type Content,
|
|
6
7
|
type Material,
|
|
7
8
|
type MaterialListResponse,
|
|
8
9
|
type MaterialBatchCreateResponse,
|
|
@@ -12,6 +13,7 @@ export {
|
|
|
12
13
|
type MaterialCreateParams,
|
|
13
14
|
type MaterialListParams,
|
|
14
15
|
type MaterialBatchCreateParams,
|
|
16
|
+
type MaterialCreateAndProcessParams,
|
|
15
17
|
type MaterialGetDownloadURLParams,
|
|
16
18
|
type MaterialMoveParams,
|
|
17
19
|
type MaterialRenameParams,
|
|
@@ -26,9 +28,12 @@ export {
|
|
|
26
28
|
} from './test';
|
|
27
29
|
export {
|
|
28
30
|
Upload,
|
|
31
|
+
type Complete,
|
|
29
32
|
type UploadCreatePresignedURLResponse,
|
|
30
33
|
type UploadCompleteUploadParams,
|
|
31
34
|
type UploadCreatePresignedURLParams,
|
|
32
35
|
type UploadUploadFileParams,
|
|
36
|
+
type UploadUploadFileAndProcessParams,
|
|
33
37
|
type UploadUploadFromURLParams,
|
|
38
|
+
type UploadUploadURLAndProcessParams,
|
|
34
39
|
} from './upload';
|
|
@@ -13,12 +13,15 @@ import {
|
|
|
13
13
|
} from './test';
|
|
14
14
|
import * as UploadAPI from './upload';
|
|
15
15
|
import {
|
|
16
|
+
Complete,
|
|
16
17
|
Upload,
|
|
17
18
|
UploadCompleteUploadParams,
|
|
18
19
|
UploadCreatePresignedURLParams,
|
|
19
20
|
UploadCreatePresignedURLResponse,
|
|
21
|
+
UploadUploadFileAndProcessParams,
|
|
20
22
|
UploadUploadFileParams,
|
|
21
23
|
UploadUploadFromURLParams,
|
|
24
|
+
UploadUploadURLAndProcessParams,
|
|
22
25
|
} from './upload';
|
|
23
26
|
import { APIPromise } from '../../../core/api-promise';
|
|
24
27
|
import { buildHeaders } from '../../../internal/headers';
|
|
@@ -110,6 +113,24 @@ export class Materials extends APIResource {
|
|
|
110
113
|
return this._client.post('/api/v1/materials/batch', { body, ...options });
|
|
111
114
|
}
|
|
112
115
|
|
|
116
|
+
/**
|
|
117
|
+
* Creates a material and waits for processing to finish before returning. Useful
|
|
118
|
+
* for synchronous API usage.
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* ```ts
|
|
122
|
+
* const material = await client.v1.materials.createAndProcess(
|
|
123
|
+
* {
|
|
124
|
+
* content: { type: 'text' },
|
|
125
|
+
* name: 'Chapter 1 - Introduction',
|
|
126
|
+
* },
|
|
127
|
+
* );
|
|
128
|
+
* ```
|
|
129
|
+
*/
|
|
130
|
+
createAndProcess(body: MaterialCreateAndProcessParams, options?: RequestOptions): APIPromise<Material> {
|
|
131
|
+
return this._client.post('/api/v1/materials/upload-and-process', { body, ...options });
|
|
132
|
+
}
|
|
133
|
+
|
|
113
134
|
/**
|
|
114
135
|
* Get debug information for a material including extracted content
|
|
115
136
|
*
|
|
@@ -195,6 +216,28 @@ export class Materials extends APIResource {
|
|
|
195
216
|
}
|
|
196
217
|
}
|
|
197
218
|
|
|
219
|
+
export interface Content {
|
|
220
|
+
/**
|
|
221
|
+
* Type of content
|
|
222
|
+
*/
|
|
223
|
+
type: 'text' | 'pdf' | 'video' | 'audio' | 'url';
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* URL to fetch content from
|
|
227
|
+
*/
|
|
228
|
+
sourceUrl?: string;
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Text content (for text type)
|
|
232
|
+
*/
|
|
233
|
+
text?: string;
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* URL to the content (for url type)
|
|
237
|
+
*/
|
|
238
|
+
url?: string;
|
|
239
|
+
}
|
|
240
|
+
|
|
198
241
|
export interface Material {
|
|
199
242
|
/**
|
|
200
243
|
* Material ID
|
|
@@ -441,7 +484,7 @@ export interface MaterialCreateParams {
|
|
|
441
484
|
/**
|
|
442
485
|
* Content details
|
|
443
486
|
*/
|
|
444
|
-
content:
|
|
487
|
+
content: Content;
|
|
445
488
|
|
|
446
489
|
/**
|
|
447
490
|
* Name of the material
|
|
@@ -454,33 +497,6 @@ export interface MaterialCreateParams {
|
|
|
454
497
|
folderId?: string;
|
|
455
498
|
}
|
|
456
499
|
|
|
457
|
-
export namespace MaterialCreateParams {
|
|
458
|
-
/**
|
|
459
|
-
* Content details
|
|
460
|
-
*/
|
|
461
|
-
export interface Content {
|
|
462
|
-
/**
|
|
463
|
-
* Type of content
|
|
464
|
-
*/
|
|
465
|
-
type: 'text' | 'pdf' | 'video' | 'audio' | 'url';
|
|
466
|
-
|
|
467
|
-
/**
|
|
468
|
-
* URL to fetch content from
|
|
469
|
-
*/
|
|
470
|
-
sourceUrl?: string;
|
|
471
|
-
|
|
472
|
-
/**
|
|
473
|
-
* Text content (for text type)
|
|
474
|
-
*/
|
|
475
|
-
text?: string;
|
|
476
|
-
|
|
477
|
-
/**
|
|
478
|
-
* URL to the content (for url type)
|
|
479
|
-
*/
|
|
480
|
-
url?: string;
|
|
481
|
-
}
|
|
482
|
-
}
|
|
483
|
-
|
|
484
500
|
export interface MaterialListParams {
|
|
485
501
|
/**
|
|
486
502
|
* Filter by folder ID
|
|
@@ -519,6 +535,33 @@ export namespace MaterialBatchCreateParams {
|
|
|
519
535
|
}
|
|
520
536
|
}
|
|
521
537
|
|
|
538
|
+
export interface MaterialCreateAndProcessParams {
|
|
539
|
+
/**
|
|
540
|
+
* Content details
|
|
541
|
+
*/
|
|
542
|
+
content: Content;
|
|
543
|
+
|
|
544
|
+
/**
|
|
545
|
+
* Name of the material
|
|
546
|
+
*/
|
|
547
|
+
name: string;
|
|
548
|
+
|
|
549
|
+
/**
|
|
550
|
+
* Folder ID to place the material in
|
|
551
|
+
*/
|
|
552
|
+
folderId?: string;
|
|
553
|
+
|
|
554
|
+
/**
|
|
555
|
+
* Polling interval in milliseconds (default: 2 seconds)
|
|
556
|
+
*/
|
|
557
|
+
pollIntervalMs?: number;
|
|
558
|
+
|
|
559
|
+
/**
|
|
560
|
+
* Maximum time to wait for processing in milliseconds (default: 5 minutes)
|
|
561
|
+
*/
|
|
562
|
+
timeoutMs?: number;
|
|
563
|
+
}
|
|
564
|
+
|
|
522
565
|
export interface MaterialGetDownloadURLParams {
|
|
523
566
|
/**
|
|
524
567
|
* URL expiration time in seconds (default: 3600)
|
|
@@ -568,6 +611,7 @@ Materials.Test = Test;
|
|
|
568
611
|
|
|
569
612
|
export declare namespace Materials {
|
|
570
613
|
export {
|
|
614
|
+
type Content as Content,
|
|
571
615
|
type Material as Material,
|
|
572
616
|
type MaterialListResponse as MaterialListResponse,
|
|
573
617
|
type MaterialBatchCreateResponse as MaterialBatchCreateResponse,
|
|
@@ -577,6 +621,7 @@ export declare namespace Materials {
|
|
|
577
621
|
type MaterialCreateParams as MaterialCreateParams,
|
|
578
622
|
type MaterialListParams as MaterialListParams,
|
|
579
623
|
type MaterialBatchCreateParams as MaterialBatchCreateParams,
|
|
624
|
+
type MaterialCreateAndProcessParams as MaterialCreateAndProcessParams,
|
|
580
625
|
type MaterialGetDownloadURLParams as MaterialGetDownloadURLParams,
|
|
581
626
|
type MaterialMoveParams as MaterialMoveParams,
|
|
582
627
|
type MaterialRenameParams as MaterialRenameParams,
|
|
@@ -585,11 +630,14 @@ export declare namespace Materials {
|
|
|
585
630
|
|
|
586
631
|
export {
|
|
587
632
|
Upload as Upload,
|
|
633
|
+
type Complete as Complete,
|
|
588
634
|
type UploadCreatePresignedURLResponse as UploadCreatePresignedURLResponse,
|
|
589
635
|
type UploadCompleteUploadParams as UploadCompleteUploadParams,
|
|
590
636
|
type UploadCreatePresignedURLParams as UploadCreatePresignedURLParams,
|
|
591
637
|
type UploadUploadFileParams as UploadUploadFileParams,
|
|
638
|
+
type UploadUploadFileAndProcessParams as UploadUploadFileAndProcessParams,
|
|
592
639
|
type UploadUploadFromURLParams as UploadUploadFromURLParams,
|
|
640
|
+
type UploadUploadURLAndProcessParams as UploadUploadURLAndProcessParams,
|
|
593
641
|
};
|
|
594
642
|
|
|
595
643
|
export { Bulk as Bulk, type BulkMoveResponse as BulkMoveResponse, type BulkMoveParams as BulkMoveParams };
|