@fencyai/js 0.1.42 → 0.1.44

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.
Files changed (107) hide show
  1. package/lib/api/createChatCompletion.d.ts +0 -4
  2. package/lib/api/createChatCompletion.js +15 -31
  3. package/lib/api/createStream.d.ts +14 -0
  4. package/lib/api/createStream.js +53 -0
  5. package/lib/api/createUpload.d.ts +16 -0
  6. package/lib/api/createUpload.js +53 -0
  7. package/lib/api/createWebsite.d.ts +16 -0
  8. package/lib/api/createWebsite.js +39 -0
  9. package/lib/index.d.ts +17 -5
  10. package/lib/index.js +10 -4
  11. package/lib/openapi/core/ApiError.d.ts +10 -0
  12. package/lib/openapi/core/ApiError.js +11 -0
  13. package/lib/openapi/core/ApiRequestOptions.d.ts +13 -0
  14. package/lib/openapi/core/ApiRequestOptions.js +1 -0
  15. package/lib/openapi/core/ApiResult.d.ts +7 -0
  16. package/lib/openapi/core/ApiResult.js +1 -0
  17. package/lib/openapi/core/CancelablePromise.d.ts +20 -0
  18. package/lib/openapi/core/CancelablePromise.js +111 -0
  19. package/lib/openapi/core/OpenAPI.d.ts +16 -0
  20. package/lib/openapi/core/OpenAPI.js +11 -0
  21. package/lib/openapi/core/request.d.ts +30 -0
  22. package/lib/openapi/core/request.js +275 -0
  23. package/lib/openapi/index.d.ts +31 -0
  24. package/lib/openapi/index.js +11 -0
  25. package/lib/openapi/models/ApiDtoType.d.ts +6 -0
  26. package/lib/openapi/models/ApiDtoType.js +11 -0
  27. package/lib/openapi/models/ChatCompletionDto.d.ts +10 -0
  28. package/lib/openapi/models/ChatCompletionDto.js +1 -0
  29. package/lib/openapi/models/ChatCompletionStreamCompletedEventDto.d.ts +9 -0
  30. package/lib/openapi/models/ChatCompletionStreamCompletedEventDto.js +1 -0
  31. package/lib/openapi/models/CreateAnthropicChatCompletionDto.d.ts +8 -0
  32. package/lib/openapi/models/CreateAnthropicChatCompletionDto.js +1 -0
  33. package/lib/openapi/models/CreateChatCompletionRequest.d.ts +10 -0
  34. package/lib/openapi/models/CreateChatCompletionRequest.js +1 -0
  35. package/lib/openapi/models/CreateChatCompletionStreamRequest.d.ts +3 -0
  36. package/lib/openapi/models/CreateChatCompletionStreamRequest.js +1 -0
  37. package/lib/openapi/models/CreateGeminiChatCompletionDto.d.ts +8 -0
  38. package/lib/openapi/models/CreateGeminiChatCompletionDto.js +1 -0
  39. package/lib/openapi/models/CreateOpenAiChatCompletionDto.d.ts +8 -0
  40. package/lib/openapi/models/CreateOpenAiChatCompletionDto.js +1 -0
  41. package/lib/openapi/models/CreateOpenAiChatCompletionMessageDto.d.ts +4 -0
  42. package/lib/openapi/models/CreateOpenAiChatCompletionMessageDto.js +1 -0
  43. package/lib/openapi/models/CreateStreamRequest.d.ts +6 -0
  44. package/lib/openapi/models/CreateStreamRequest.js +1 -0
  45. package/lib/openapi/models/CreateWebsiteRequest.d.ts +3 -0
  46. package/lib/openapi/models/CreateWebsiteRequest.js +1 -0
  47. package/lib/openapi/models/FileUploadCompletedEventDto.d.ts +11 -0
  48. package/lib/openapi/models/FileUploadCompletedEventDto.js +1 -0
  49. package/lib/openapi/models/NewChatCompletionStreamChunkEventDto.d.ts +10 -0
  50. package/lib/openapi/models/NewChatCompletionStreamChunkEventDto.js +1 -0
  51. package/lib/openapi/models/PubCreateUploadRequest.d.ts +6 -0
  52. package/lib/openapi/models/PubCreateUploadRequest.js +1 -0
  53. package/lib/openapi/models/PubUploadDto.d.ts +6 -0
  54. package/lib/openapi/models/PubUploadDto.js +1 -0
  55. package/lib/openapi/models/PubWebsiteDto.d.ts +5 -0
  56. package/lib/openapi/models/PubWebsiteDto.js +1 -0
  57. package/lib/openapi/models/S3PostRequestDto.d.ts +10 -0
  58. package/lib/openapi/models/S3PostRequestDto.js +1 -0
  59. package/lib/openapi/models/StoredChatCompletionId.d.ts +3 -0
  60. package/lib/openapi/models/StoredChatCompletionId.js +1 -0
  61. package/lib/openapi/models/StoredFileId.d.ts +3 -0
  62. package/lib/openapi/models/StoredFileId.js +1 -0
  63. package/lib/openapi/models/StoredStreamId.d.ts +3 -0
  64. package/lib/openapi/models/StoredStreamId.js +1 -0
  65. package/lib/openapi/models/StoredUploadId.d.ts +3 -0
  66. package/lib/openapi/models/StoredUploadId.js +1 -0
  67. package/lib/openapi/models/StreamDto.d.ts +6 -0
  68. package/lib/openapi/models/StreamDto.js +1 -0
  69. package/lib/openapi/models/StreamEventType.d.ts +7 -0
  70. package/lib/openapi/models/StreamEventType.js +12 -0
  71. package/lib/openapi/models/StreamNotFoundEventDto.d.ts +7 -0
  72. package/lib/openapi/models/StreamNotFoundEventDto.js +1 -0
  73. package/lib/openapi/models/StreamTimeoutEventDto.d.ts +7 -0
  74. package/lib/openapi/models/StreamTimeoutEventDto.js +1 -0
  75. package/lib/openapi/models/StreamType.d.ts +4 -0
  76. package/lib/openapi/models/StreamType.js +9 -0
  77. package/lib/openapi/services/PubService.d.ts +50 -0
  78. package/lib/openapi/services/PubService.js +71 -0
  79. package/lib/types/CreateStreamRequest.d.ts +6 -0
  80. package/lib/types/CreateStreamRequest.js +1 -0
  81. package/lib/types/CreateStreamResponse.d.ts +9 -0
  82. package/lib/types/CreateStreamResponse.js +1 -0
  83. package/lib/types/CreateUploadRequest.d.ts +6 -0
  84. package/lib/types/CreateUploadRequest.js +1 -0
  85. package/lib/types/CreateUploadResponse.d.ts +9 -0
  86. package/lib/types/CreateUploadResponse.js +1 -0
  87. package/lib/types/CreateWebsiteRequest.d.ts +3 -0
  88. package/lib/types/CreateWebsiteRequest.js +1 -0
  89. package/lib/types/CreateWebsiteResponse.d.ts +9 -0
  90. package/lib/types/CreateWebsiteResponse.js +1 -0
  91. package/lib/types/FencyFile.d.ts +8 -0
  92. package/lib/types/FencyFile.js +1 -0
  93. package/lib/types/FencyUpload.d.ts +6 -0
  94. package/lib/types/FencyUpload.js +1 -0
  95. package/lib/types/FencyWebsite.d.ts +5 -0
  96. package/lib/types/FencyWebsite.js +1 -0
  97. package/lib/types/S3PostRequest.d.ts +10 -0
  98. package/lib/types/S3PostRequest.js +1 -0
  99. package/lib/types/Stream.d.ts +5 -0
  100. package/lib/types/{ChatCompletionStream.js → Stream.js} +2 -2
  101. package/lib/types/StreamData.d.ts +31 -0
  102. package/lib/types/StreamData.js +1 -0
  103. package/lib/utils/version.js +1 -1
  104. package/package.json +5 -3
  105. package/lib/api/createChatCompletionStream.d.ts +0 -21
  106. package/lib/api/createChatCompletionStream.js +0 -46
  107. package/lib/types/ChatCompletionStream.d.ts +0 -5
@@ -0,0 +1,275 @@
1
+ /* generated using openapi-typescript-codegen -- do not edit */
2
+ /* istanbul ignore file */
3
+ /* tslint:disable */
4
+ /* eslint-disable */
5
+ import { ApiError } from './ApiError';
6
+ import { CancelablePromise } from './CancelablePromise';
7
+ export const isDefined = (value) => {
8
+ return value !== undefined && value !== null;
9
+ };
10
+ export const isString = (value) => {
11
+ return typeof value === 'string';
12
+ };
13
+ export const isStringWithValue = (value) => {
14
+ return isString(value) && value !== '';
15
+ };
16
+ export const isBlob = (value) => {
17
+ return (typeof value === 'object' &&
18
+ typeof value.type === 'string' &&
19
+ typeof value.stream === 'function' &&
20
+ typeof value.arrayBuffer === 'function' &&
21
+ typeof value.constructor === 'function' &&
22
+ typeof value.constructor.name === 'string' &&
23
+ /^(Blob|File)$/.test(value.constructor.name) &&
24
+ /^(Blob|File)$/.test(value[Symbol.toStringTag]));
25
+ };
26
+ export const isFormData = (value) => {
27
+ return value instanceof FormData;
28
+ };
29
+ export const base64 = (str) => {
30
+ try {
31
+ return btoa(str);
32
+ }
33
+ catch (err) {
34
+ // @ts-ignore
35
+ return Buffer.from(str).toString('base64');
36
+ }
37
+ };
38
+ export const getQueryString = (params) => {
39
+ const qs = [];
40
+ const append = (key, value) => {
41
+ qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`);
42
+ };
43
+ const process = (key, value) => {
44
+ if (isDefined(value)) {
45
+ if (Array.isArray(value)) {
46
+ value.forEach(v => {
47
+ process(key, v);
48
+ });
49
+ }
50
+ else if (typeof value === 'object') {
51
+ Object.entries(value).forEach(([k, v]) => {
52
+ process(`${key}[${k}]`, v);
53
+ });
54
+ }
55
+ else {
56
+ append(key, value);
57
+ }
58
+ }
59
+ };
60
+ Object.entries(params).forEach(([key, value]) => {
61
+ process(key, value);
62
+ });
63
+ if (qs.length > 0) {
64
+ return `?${qs.join('&')}`;
65
+ }
66
+ return '';
67
+ };
68
+ const getUrl = (config, options) => {
69
+ const encoder = config.ENCODE_PATH || encodeURI;
70
+ const path = options.url
71
+ .replace('{api-version}', config.VERSION)
72
+ .replace(/{(.*?)}/g, (substring, group) => {
73
+ if (options.path?.hasOwnProperty(group)) {
74
+ return encoder(String(options.path[group]));
75
+ }
76
+ return substring;
77
+ });
78
+ const url = `${config.BASE}${path}`;
79
+ if (options.query) {
80
+ return `${url}${getQueryString(options.query)}`;
81
+ }
82
+ return url;
83
+ };
84
+ export const getFormData = (options) => {
85
+ if (options.formData) {
86
+ const formData = new FormData();
87
+ const process = (key, value) => {
88
+ if (isString(value) || isBlob(value)) {
89
+ formData.append(key, value);
90
+ }
91
+ else {
92
+ formData.append(key, JSON.stringify(value));
93
+ }
94
+ };
95
+ Object.entries(options.formData)
96
+ .filter(([_, value]) => isDefined(value))
97
+ .forEach(([key, value]) => {
98
+ if (Array.isArray(value)) {
99
+ value.forEach(v => process(key, v));
100
+ }
101
+ else {
102
+ process(key, value);
103
+ }
104
+ });
105
+ return formData;
106
+ }
107
+ return undefined;
108
+ };
109
+ export const resolve = async (options, resolver) => {
110
+ if (typeof resolver === 'function') {
111
+ return resolver(options);
112
+ }
113
+ return resolver;
114
+ };
115
+ export const getHeaders = async (config, options) => {
116
+ const [token, username, password, additionalHeaders] = await Promise.all([
117
+ resolve(options, config.TOKEN),
118
+ resolve(options, config.USERNAME),
119
+ resolve(options, config.PASSWORD),
120
+ resolve(options, config.HEADERS),
121
+ ]);
122
+ const headers = Object.entries({
123
+ Accept: 'application/json',
124
+ ...additionalHeaders,
125
+ ...options.headers,
126
+ })
127
+ .filter(([_, value]) => isDefined(value))
128
+ .reduce((headers, [key, value]) => ({
129
+ ...headers,
130
+ [key]: String(value),
131
+ }), {});
132
+ if (isStringWithValue(token)) {
133
+ headers['Authorization'] = `Bearer ${token}`;
134
+ }
135
+ if (isStringWithValue(username) && isStringWithValue(password)) {
136
+ const credentials = base64(`${username}:${password}`);
137
+ headers['Authorization'] = `Basic ${credentials}`;
138
+ }
139
+ if (options.body !== undefined) {
140
+ if (options.mediaType) {
141
+ headers['Content-Type'] = options.mediaType;
142
+ }
143
+ else if (isBlob(options.body)) {
144
+ headers['Content-Type'] = options.body.type || 'application/octet-stream';
145
+ }
146
+ else if (isString(options.body)) {
147
+ headers['Content-Type'] = 'text/plain';
148
+ }
149
+ else if (!isFormData(options.body)) {
150
+ headers['Content-Type'] = 'application/json';
151
+ }
152
+ }
153
+ return new Headers(headers);
154
+ };
155
+ export const getRequestBody = (options) => {
156
+ if (options.body !== undefined) {
157
+ if (options.mediaType?.includes('/json')) {
158
+ return JSON.stringify(options.body);
159
+ }
160
+ else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) {
161
+ return options.body;
162
+ }
163
+ else {
164
+ return JSON.stringify(options.body);
165
+ }
166
+ }
167
+ return undefined;
168
+ };
169
+ export const sendRequest = async (config, options, url, body, formData, headers, onCancel) => {
170
+ const controller = new AbortController();
171
+ const request = {
172
+ headers,
173
+ body: body ?? formData,
174
+ method: options.method,
175
+ signal: controller.signal,
176
+ };
177
+ if (config.WITH_CREDENTIALS) {
178
+ request.credentials = config.CREDENTIALS;
179
+ }
180
+ onCancel(() => controller.abort());
181
+ return await fetch(url, request);
182
+ };
183
+ export const getResponseHeader = (response, responseHeader) => {
184
+ if (responseHeader) {
185
+ const content = response.headers.get(responseHeader);
186
+ if (isString(content)) {
187
+ return content;
188
+ }
189
+ }
190
+ return undefined;
191
+ };
192
+ export const getResponseBody = async (response) => {
193
+ if (response.status !== 204) {
194
+ try {
195
+ const contentType = response.headers.get('Content-Type');
196
+ if (contentType) {
197
+ const jsonTypes = ['application/json', 'application/problem+json'];
198
+ const isJSON = jsonTypes.some(type => contentType.toLowerCase().startsWith(type));
199
+ if (isJSON) {
200
+ return await response.json();
201
+ }
202
+ else {
203
+ return await response.text();
204
+ }
205
+ }
206
+ }
207
+ catch (error) {
208
+ console.error(error);
209
+ }
210
+ }
211
+ return undefined;
212
+ };
213
+ export const catchErrorCodes = (options, result) => {
214
+ const errors = {
215
+ 400: 'Bad Request',
216
+ 401: 'Unauthorized',
217
+ 403: 'Forbidden',
218
+ 404: 'Not Found',
219
+ 500: 'Internal Server Error',
220
+ 502: 'Bad Gateway',
221
+ 503: 'Service Unavailable',
222
+ ...options.errors,
223
+ };
224
+ const error = errors[result.status];
225
+ if (error) {
226
+ throw new ApiError(options, result, error);
227
+ }
228
+ if (!result.ok) {
229
+ const errorStatus = result.status ?? 'unknown';
230
+ const errorStatusText = result.statusText ?? 'unknown';
231
+ const errorBody = (() => {
232
+ try {
233
+ return JSON.stringify(result.body, null, 2);
234
+ }
235
+ catch (e) {
236
+ return undefined;
237
+ }
238
+ })();
239
+ throw new ApiError(options, result, `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}`);
240
+ }
241
+ };
242
+ /**
243
+ * Request method
244
+ * @param config The OpenAPI configuration object
245
+ * @param options The request options from the service
246
+ * @returns CancelablePromise<T>
247
+ * @throws ApiError
248
+ */
249
+ export const request = (config, options) => {
250
+ return new CancelablePromise(async (resolve, reject, onCancel) => {
251
+ try {
252
+ const url = getUrl(config, options);
253
+ const formData = getFormData(options);
254
+ const body = getRequestBody(options);
255
+ const headers = await getHeaders(config, options);
256
+ if (!onCancel.isCancelled) {
257
+ const response = await sendRequest(config, options, url, body, formData, headers, onCancel);
258
+ const responseBody = await getResponseBody(response);
259
+ const responseHeader = getResponseHeader(response, options.responseHeader);
260
+ const result = {
261
+ url,
262
+ ok: response.ok,
263
+ status: response.status,
264
+ statusText: response.statusText,
265
+ body: responseHeader ?? responseBody,
266
+ };
267
+ catchErrorCodes(options, result);
268
+ resolve(result.body);
269
+ }
270
+ }
271
+ catch (error) {
272
+ reject(error);
273
+ }
274
+ });
275
+ };
@@ -0,0 +1,31 @@
1
+ export { ApiError } from './core/ApiError';
2
+ export { CancelablePromise, CancelError } from './core/CancelablePromise';
3
+ export { OpenAPI } from './core/OpenAPI';
4
+ export type { OpenAPIConfig } from './core/OpenAPI';
5
+ export { ApiDtoType } from './models/ApiDtoType';
6
+ export type { ChatCompletionDto } from './models/ChatCompletionDto';
7
+ export type { ChatCompletionStreamCompletedEventDto } from './models/ChatCompletionStreamCompletedEventDto';
8
+ export type { CreateAnthropicChatCompletionDto } from './models/CreateAnthropicChatCompletionDto';
9
+ export type { CreateChatCompletionRequest } from './models/CreateChatCompletionRequest';
10
+ export type { CreateChatCompletionStreamRequest } from './models/CreateChatCompletionStreamRequest';
11
+ export type { CreateGeminiChatCompletionDto } from './models/CreateGeminiChatCompletionDto';
12
+ export type { CreateOpenAiChatCompletionDto } from './models/CreateOpenAiChatCompletionDto';
13
+ export type { CreateOpenAiChatCompletionMessageDto } from './models/CreateOpenAiChatCompletionMessageDto';
14
+ export type { CreateStreamRequest } from './models/CreateStreamRequest';
15
+ export type { CreateWebsiteRequest } from './models/CreateWebsiteRequest';
16
+ export type { FileUploadCompletedEventDto } from './models/FileUploadCompletedEventDto';
17
+ export type { NewChatCompletionStreamChunkEventDto } from './models/NewChatCompletionStreamChunkEventDto';
18
+ export type { PubCreateUploadRequest } from './models/PubCreateUploadRequest';
19
+ export type { PubUploadDto } from './models/PubUploadDto';
20
+ export type { PubWebsiteDto } from './models/PubWebsiteDto';
21
+ export type { S3PostRequestDto } from './models/S3PostRequestDto';
22
+ export type { StoredChatCompletionId } from './models/StoredChatCompletionId';
23
+ export type { StoredFileId } from './models/StoredFileId';
24
+ export type { StoredStreamId } from './models/StoredStreamId';
25
+ export type { StoredUploadId } from './models/StoredUploadId';
26
+ export type { StreamDto } from './models/StreamDto';
27
+ export { StreamEventType } from './models/StreamEventType';
28
+ export type { StreamNotFoundEventDto } from './models/StreamNotFoundEventDto';
29
+ export type { StreamTimeoutEventDto } from './models/StreamTimeoutEventDto';
30
+ export { StreamType } from './models/StreamType';
31
+ export { PubService } from './services/PubService';
@@ -0,0 +1,11 @@
1
+ /* generated using openapi-typescript-codegen -- do not edit */
2
+ /* istanbul ignore file */
3
+ /* tslint:disable */
4
+ /* eslint-disable */
5
+ export { ApiError } from './core/ApiError';
6
+ export { CancelablePromise, CancelError } from './core/CancelablePromise';
7
+ export { OpenAPI } from './core/OpenAPI';
8
+ export { ApiDtoType } from './models/ApiDtoType';
9
+ export { StreamEventType } from './models/StreamEventType';
10
+ export { StreamType } from './models/StreamType';
11
+ export { PubService } from './services/PubService';
@@ -0,0 +1,6 @@
1
+ export declare enum ApiDtoType {
2
+ CHAT_COMPLETION = "ChatCompletion",
3
+ STREAM = "Stream",
4
+ CHAT_COMPLETION_SESSION = "ChatCompletionSession",
5
+ USER = "User"
6
+ }
@@ -0,0 +1,11 @@
1
+ /* generated using openapi-typescript-codegen -- do not edit */
2
+ /* istanbul ignore file */
3
+ /* tslint:disable */
4
+ /* eslint-disable */
5
+ export var ApiDtoType;
6
+ (function (ApiDtoType) {
7
+ ApiDtoType["CHAT_COMPLETION"] = "ChatCompletion";
8
+ ApiDtoType["STREAM"] = "Stream";
9
+ ApiDtoType["CHAT_COMPLETION_SESSION"] = "ChatCompletionSession";
10
+ ApiDtoType["USER"] = "User";
11
+ })(ApiDtoType || (ApiDtoType = {}));
@@ -0,0 +1,10 @@
1
+ import type { ApiDtoType } from './ApiDtoType';
2
+ export type ChatCompletionDto = {
3
+ id: string;
4
+ createdAt: string;
5
+ type: ApiDtoType;
6
+ streamId?: string | null;
7
+ response?: string | null;
8
+ responseIsStructured?: boolean | null;
9
+ userId?: string | null;
10
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ import type { StoredChatCompletionId } from './StoredChatCompletionId';
2
+ import type { StoredStreamId } from './StoredStreamId';
3
+ import type { StreamEventType } from './StreamEventType';
4
+ export type ChatCompletionStreamCompletedEventDto = {
5
+ type: StreamEventType;
6
+ streamId: StoredStreamId;
7
+ chatCompletionId: StoredChatCompletionId;
8
+ timestamp: string;
9
+ };
@@ -0,0 +1,8 @@
1
+ import type { CreateOpenAiChatCompletionMessageDto } from './CreateOpenAiChatCompletionMessageDto';
2
+ export type CreateAnthropicChatCompletionDto = {
3
+ model: string;
4
+ temperature?: number | null;
5
+ topP?: number | null;
6
+ topK?: number | null;
7
+ messages: Array<CreateOpenAiChatCompletionMessageDto>;
8
+ };
@@ -0,0 +1,10 @@
1
+ import type { CreateAnthropicChatCompletionDto } from './CreateAnthropicChatCompletionDto';
2
+ import type { CreateGeminiChatCompletionDto } from './CreateGeminiChatCompletionDto';
3
+ import type { CreateOpenAiChatCompletionDto } from './CreateOpenAiChatCompletionDto';
4
+ export type CreateChatCompletionRequest = {
5
+ streamId?: string | null;
6
+ sessionClientSecret?: string | null;
7
+ openai?: CreateOpenAiChatCompletionDto;
8
+ gemini?: CreateGeminiChatCompletionDto;
9
+ anthropic?: CreateAnthropicChatCompletionDto;
10
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ export type CreateChatCompletionStreamRequest = {
2
+ clientSecret?: string | null;
3
+ };
@@ -0,0 +1,8 @@
1
+ export type CreateGeminiChatCompletionDto = {
2
+ model: string;
3
+ temperature?: number | null;
4
+ topP?: number | null;
5
+ topK?: number | null;
6
+ responseJsonSchema?: string | null;
7
+ content: string;
8
+ };
@@ -0,0 +1,8 @@
1
+ import type { CreateOpenAiChatCompletionMessageDto } from './CreateOpenAiChatCompletionMessageDto';
2
+ export type CreateOpenAiChatCompletionDto = {
3
+ model: string;
4
+ temperature?: number | null;
5
+ topP?: number | null;
6
+ responseJsonSchema?: string | null;
7
+ messages: Array<CreateOpenAiChatCompletionMessageDto>;
8
+ };
@@ -0,0 +1,4 @@
1
+ export type CreateOpenAiChatCompletionMessageDto = {
2
+ role: string;
3
+ content: string;
4
+ };
@@ -0,0 +1,6 @@
1
+ import type { CreateChatCompletionStreamRequest } from './CreateChatCompletionStreamRequest';
2
+ import type { StreamType } from './StreamType';
3
+ export type CreateStreamRequest = {
4
+ type: StreamType;
5
+ chatCompletionStream?: CreateChatCompletionStreamRequest;
6
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ export type CreateWebsiteRequest = {
2
+ url: string;
3
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ import type { StoredFileId } from './StoredFileId';
2
+ import type { StoredStreamId } from './StoredStreamId';
3
+ import type { StoredUploadId } from './StoredUploadId';
4
+ import type { StreamEventType } from './StreamEventType';
5
+ export type FileUploadCompletedEventDto = {
6
+ type: StreamEventType;
7
+ streamId: StoredStreamId;
8
+ uploadId: StoredUploadId;
9
+ fileId: StoredFileId;
10
+ timestamp: string;
11
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ import type { StoredChatCompletionId } from './StoredChatCompletionId';
2
+ import type { StoredStreamId } from './StoredStreamId';
3
+ import type { StreamEventType } from './StreamEventType';
4
+ export type NewChatCompletionStreamChunkEventDto = {
5
+ type: StreamEventType;
6
+ streamId: StoredStreamId;
7
+ chatCompletionId: StoredChatCompletionId;
8
+ timestamp: string;
9
+ content: string;
10
+ };
@@ -0,0 +1,6 @@
1
+ export type PubCreateUploadRequest = {
2
+ streamId: string;
3
+ fileName: string;
4
+ mimeType: string;
5
+ fileSize: number;
6
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { S3PostRequestDto } from './S3PostRequestDto';
2
+ export type PubUploadDto = {
3
+ id: string;
4
+ createdAt: string;
5
+ s3PostRequest: S3PostRequestDto;
6
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ export type PubWebsiteDto = {
2
+ id: string;
3
+ createdAt: string;
4
+ content: string;
5
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ export type S3PostRequestDto = {
2
+ amzDate: string;
3
+ amzSignature: string;
4
+ amzAlgorithm: string;
5
+ amzCredential: string;
6
+ policy: string;
7
+ key: string;
8
+ uploadUrl: string;
9
+ sessionToken: string;
10
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ export type StoredChatCompletionId = {
2
+ value: string;
3
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ export type StoredFileId = {
2
+ value: string;
3
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ export type StoredStreamId = {
2
+ value: string;
3
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ export type StoredUploadId = {
2
+ value: string;
3
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { ApiDtoType } from './ApiDtoType';
2
+ export type StreamDto = {
3
+ id: string;
4
+ createdAt: string;
5
+ type: ApiDtoType;
6
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ export declare enum StreamEventType {
2
+ NEW_CHAT_COMPLETION_STREAM_CHUNK = "NewChatCompletionStreamChunk",
3
+ CHAT_COMPLETION_STREAM_COMPLETED = "ChatCompletionStreamCompleted",
4
+ STREAM_TIMEOUT = "StreamTimeout",
5
+ STREAM_NOT_FOUND = "StreamNotFound",
6
+ FILE_UPLOAD_COMPLETED = "FileUploadCompleted"
7
+ }
@@ -0,0 +1,12 @@
1
+ /* generated using openapi-typescript-codegen -- do not edit */
2
+ /* istanbul ignore file */
3
+ /* tslint:disable */
4
+ /* eslint-disable */
5
+ export var StreamEventType;
6
+ (function (StreamEventType) {
7
+ StreamEventType["NEW_CHAT_COMPLETION_STREAM_CHUNK"] = "NewChatCompletionStreamChunk";
8
+ StreamEventType["CHAT_COMPLETION_STREAM_COMPLETED"] = "ChatCompletionStreamCompleted";
9
+ StreamEventType["STREAM_TIMEOUT"] = "StreamTimeout";
10
+ StreamEventType["STREAM_NOT_FOUND"] = "StreamNotFound";
11
+ StreamEventType["FILE_UPLOAD_COMPLETED"] = "FileUploadCompleted";
12
+ })(StreamEventType || (StreamEventType = {}));
@@ -0,0 +1,7 @@
1
+ import type { StoredStreamId } from './StoredStreamId';
2
+ import type { StreamEventType } from './StreamEventType';
3
+ export type StreamNotFoundEventDto = {
4
+ type: StreamEventType;
5
+ streamId: StoredStreamId;
6
+ timestamp: string;
7
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ import type { StoredStreamId } from './StoredStreamId';
2
+ import type { StreamEventType } from './StreamEventType';
3
+ export type StreamTimeoutEventDto = {
4
+ type: StreamEventType;
5
+ streamId: StoredStreamId;
6
+ timestamp: string;
7
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ export declare enum StreamType {
2
+ CHAT_COMPLETION_STREAM = "ChatCompletionStream",
3
+ FILE_UPLOAD_STREAM = "FileUploadStream"
4
+ }
@@ -0,0 +1,9 @@
1
+ /* generated using openapi-typescript-codegen -- do not edit */
2
+ /* istanbul ignore file */
3
+ /* tslint:disable */
4
+ /* eslint-disable */
5
+ export var StreamType;
6
+ (function (StreamType) {
7
+ StreamType["CHAT_COMPLETION_STREAM"] = "ChatCompletionStream";
8
+ StreamType["FILE_UPLOAD_STREAM"] = "FileUploadStream";
9
+ })(StreamType || (StreamType = {}));