instill-sdk 0.0.1

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 (226) hide show
  1. package/README.md +369 -0
  2. package/dist/chunk-2VZRNT6D.mjs +0 -0
  3. package/dist/chunk-3VVR3XHW.mjs +56 -0
  4. package/dist/chunk-42SCMPQP.mjs +0 -0
  5. package/dist/chunk-4KLHN5HK.mjs +0 -0
  6. package/dist/chunk-4TKUHGUZ.mjs +244 -0
  7. package/dist/chunk-4VWYH26Q.mjs +145 -0
  8. package/dist/chunk-6M57XUNI.mjs +64 -0
  9. package/dist/chunk-6NTCWRRC.mjs +0 -0
  10. package/dist/chunk-6ZXT6X3H.mjs +0 -0
  11. package/dist/chunk-73EPIL2R.mjs +0 -0
  12. package/dist/chunk-7KV3Y36U.mjs +17 -0
  13. package/dist/chunk-D5OKZ665.mjs +32 -0
  14. package/dist/chunk-DXEIDDIA.mjs +32 -0
  15. package/dist/chunk-EBWGEVUX.mjs +33 -0
  16. package/dist/chunk-ECC5KF6S.mjs +150 -0
  17. package/dist/chunk-EHG2FVLQ.mjs +0 -0
  18. package/dist/chunk-EXJ4UK7Q.mjs +49 -0
  19. package/dist/chunk-FAXYADOP.mjs +0 -0
  20. package/dist/chunk-FNCXOA62.mjs +0 -0
  21. package/dist/chunk-GPM5FDRS.mjs +154 -0
  22. package/dist/chunk-IB43VC55.mjs +41 -0
  23. package/dist/chunk-IPW3WQCQ.mjs +35 -0
  24. package/dist/chunk-IWAQMUMR.mjs +42 -0
  25. package/dist/chunk-JONZWFL5.mjs +168 -0
  26. package/dist/chunk-JTTE7IZY.mjs +14 -0
  27. package/dist/chunk-JY37AKV6.mjs +0 -0
  28. package/dist/chunk-KCKTAMXW.mjs +0 -0
  29. package/dist/chunk-KHFNAMT4.mjs +160 -0
  30. package/dist/chunk-NRP5M7FG.mjs +128 -0
  31. package/dist/chunk-QLWRKSUE.mjs +104 -0
  32. package/dist/chunk-QV7PYP7E.mjs +0 -0
  33. package/dist/chunk-QZOKJQTL.mjs +102 -0
  34. package/dist/chunk-RVRM4NPL.mjs +29 -0
  35. package/dist/chunk-VASX6R4R.mjs +0 -0
  36. package/dist/chunk-VIPORJ6H.mjs +77 -0
  37. package/dist/chunk-WBQAMGXK.mjs +0 -0
  38. package/dist/chunk-WL54JNC6.mjs +64 -0
  39. package/dist/chunk-WLPBUHMI.mjs +0 -0
  40. package/dist/chunk-YT6ZGA4J.mjs +46 -0
  41. package/dist/chunk-YXNMG2RZ.mjs +98 -0
  42. package/dist/chunk-ZRC43MN3.mjs +111 -0
  43. package/dist/chunk-magic-string.3a794426-OWTMMGNR.mjs +1253 -0
  44. package/dist/connector/ConnectorClient.d.ts +54 -0
  45. package/dist/connector/ConnectorClient.js +457 -0
  46. package/dist/connector/ConnectorClient.mjs +16 -0
  47. package/dist/connector/action.d.ts +13 -0
  48. package/dist/connector/action.js +72 -0
  49. package/dist/connector/action.mjs +11 -0
  50. package/dist/connector/index.d.ts +2 -0
  51. package/dist/connector/index.js +37 -0
  52. package/dist/connector/index.mjs +13 -0
  53. package/dist/connector/mutation.d.ts +19 -0
  54. package/dist/connector/mutation.js +91 -0
  55. package/dist/connector/mutation.mjs +13 -0
  56. package/dist/connector/queries.d.ts +34 -0
  57. package/dist/connector/queries.js +227 -0
  58. package/dist/connector/queries.mjs +23 -0
  59. package/dist/connector/types.d.ts +102 -0
  60. package/dist/connector/types.js +18 -0
  61. package/dist/connector/types.mjs +1 -0
  62. package/dist/helper/axiosInstance.d.ts +3 -0
  63. package/dist/helper/axiosInstance.js +44 -0
  64. package/dist/helper/axiosInstance.mjs +7 -0
  65. package/dist/helper/config.d.ts +1 -0
  66. package/dist/helper/config.js +53 -0
  67. package/dist/helper/config.mjs +7 -0
  68. package/dist/helper/createClient.d.ts +2 -0
  69. package/dist/helper/createClient.js +90 -0
  70. package/dist/helper/createClient.mjs +8 -0
  71. package/dist/helper/getInstillApiErrorMessage.d.ts +2 -0
  72. package/dist/helper/getInstillApiErrorMessage.js +41 -0
  73. package/dist/helper/getInstillApiErrorMessage.mjs +7 -0
  74. package/dist/helper/getQueryString.d.ts +7 -0
  75. package/dist/helper/getQueryString.js +57 -0
  76. package/dist/helper/getQueryString.mjs +7 -0
  77. package/dist/helper/getQueryString.test.d.ts +1 -0
  78. package/dist/helper/getQueryString.test.js +15769 -0
  79. package/dist/helper/getQueryString.test.mjs +14458 -0
  80. package/dist/helper/index.d.ts +5 -0
  81. package/dist/helper/index.js +145 -0
  82. package/dist/helper/index.mjs +21 -0
  83. package/dist/index.d.ts +24 -0
  84. package/dist/index.js +1978 -0
  85. package/dist/index.mjs +87 -0
  86. package/dist/metric/MetricClient.d.ts +21 -0
  87. package/dist/metric/MetricClient.js +215 -0
  88. package/dist/metric/MetricClient.mjs +14 -0
  89. package/dist/metric/index.d.ts +1 -0
  90. package/dist/metric/index.js +18 -0
  91. package/dist/metric/index.mjs +3 -0
  92. package/dist/metric/pipeline/index.d.ts +1 -0
  93. package/dist/metric/pipeline/index.js +18 -0
  94. package/dist/metric/pipeline/index.mjs +2 -0
  95. package/dist/metric/pipeline/queries.d.ts +21 -0
  96. package/dist/metric/pipeline/queries.js +168 -0
  97. package/dist/metric/pipeline/queries.mjs +17 -0
  98. package/dist/metric/pipeline/types.d.ts +63 -0
  99. package/dist/metric/pipeline/types.js +18 -0
  100. package/dist/metric/pipeline/types.mjs +1 -0
  101. package/dist/mgmt/AuthClient.d.ts +35 -0
  102. package/dist/mgmt/AuthClient.js +308 -0
  103. package/dist/mgmt/AuthClient.mjs +16 -0
  104. package/dist/mgmt/action.d.ts +8 -0
  105. package/dist/mgmt/action.js +61 -0
  106. package/dist/mgmt/action.mjs +11 -0
  107. package/dist/mgmt/index.d.ts +2 -0
  108. package/dist/mgmt/index.js +37 -0
  109. package/dist/mgmt/index.mjs +13 -0
  110. package/dist/mgmt/mutation.d.ts +18 -0
  111. package/dist/mgmt/mutation.js +83 -0
  112. package/dist/mgmt/mutation.mjs +13 -0
  113. package/dist/mgmt/queries.d.ts +17 -0
  114. package/dist/mgmt/queries.js +148 -0
  115. package/dist/mgmt/queries.mjs +19 -0
  116. package/dist/mgmt/types.d.ts +62 -0
  117. package/dist/mgmt/types.js +18 -0
  118. package/dist/mgmt/types.mjs +1 -0
  119. package/dist/model/ModelClient.d.ts +48 -0
  120. package/dist/model/ModelClient.js +466 -0
  121. package/dist/model/ModelClient.mjs +16 -0
  122. package/dist/model/action.d.ts +9 -0
  123. package/dist/model/action.js +57 -0
  124. package/dist/model/action.mjs +9 -0
  125. package/dist/model/index.d.ts +2 -0
  126. package/dist/model/index.js +37 -0
  127. package/dist/model/index.mjs +13 -0
  128. package/dist/model/mutation.d.ts +15 -0
  129. package/dist/model/mutation.js +128 -0
  130. package/dist/model/mutation.mjs +11 -0
  131. package/dist/model/queries.d.ts +35 -0
  132. package/dist/model/queries.js +234 -0
  133. package/dist/model/queries.mjs +25 -0
  134. package/dist/model/types.d.ts +141 -0
  135. package/dist/model/types.js +18 -0
  136. package/dist/model/types.mjs +1 -0
  137. package/dist/operation/OperationClient.d.ts +11 -0
  138. package/dist/operation/OperationClient.js +106 -0
  139. package/dist/operation/OperationClient.mjs +8 -0
  140. package/dist/operation/index.d.ts +2 -0
  141. package/dist/operation/index.js +31 -0
  142. package/dist/operation/index.mjs +5 -0
  143. package/dist/operation/queries.d.ts +9 -0
  144. package/dist/operation/queries.js +67 -0
  145. package/dist/operation/queries.mjs +9 -0
  146. package/dist/operation/types.d.ts +9 -0
  147. package/dist/operation/types.js +18 -0
  148. package/dist/operation/types.mjs +1 -0
  149. package/dist/pipeline/PipelineClient.d.ts +80 -0
  150. package/dist/pipeline/PipelineClient.js +639 -0
  151. package/dist/pipeline/PipelineClient.mjs +16 -0
  152. package/dist/pipeline/action.d.ts +34 -0
  153. package/dist/pipeline/action.js +157 -0
  154. package/dist/pipeline/action.mjs +17 -0
  155. package/dist/pipeline/index.d.ts +2 -0
  156. package/dist/pipeline/index.js +37 -0
  157. package/dist/pipeline/index.mjs +13 -0
  158. package/dist/pipeline/mutation.d.ts +33 -0
  159. package/dist/pipeline/mutation.js +134 -0
  160. package/dist/pipeline/mutation.mjs +19 -0
  161. package/dist/pipeline/queries.d.ts +32 -0
  162. package/dist/pipeline/queries.js +223 -0
  163. package/dist/pipeline/queries.mjs +23 -0
  164. package/dist/pipeline/types.d.ts +204 -0
  165. package/dist/pipeline/types.js +18 -0
  166. package/dist/pipeline/types.mjs +1 -0
  167. package/dist/protogen-ts/base/metric/v1alpha/metric.ts +4522 -0
  168. package/dist/protogen-ts/base/metric/v1alpha/metric_service.ts +314 -0
  169. package/dist/protogen-ts/base/mgmt/v1alpha/metric.ts +2486 -0
  170. package/dist/protogen-ts/base/mgmt/v1alpha/mgmt.ts +3787 -0
  171. package/dist/protogen-ts/base/mgmt/v1alpha/mgmt_private_service.ts +107 -0
  172. package/dist/protogen-ts/base/mgmt/v1alpha/mgmt_public_service.ts +326 -0
  173. package/dist/protogen-ts/base/usage/v1alpha/usage.ts +2185 -0
  174. package/dist/protogen-ts/base/usage/v1alpha/usage_service.ts +81 -0
  175. package/dist/protogen-ts/common/healthcheck/v1alpha/healthcheck.ts +188 -0
  176. package/dist/protogen-ts/common/task/v1alpha/task.ts +109 -0
  177. package/dist/protogen-ts/google/api/annotations.ts +3 -0
  178. package/dist/protogen-ts/google/api/client.ts +2073 -0
  179. package/dist/protogen-ts/google/api/field_behavior.ts +119 -0
  180. package/dist/protogen-ts/google/api/http.ts +745 -0
  181. package/dist/protogen-ts/google/api/launch_stage.ts +115 -0
  182. package/dist/protogen-ts/google/api/resource.ts +529 -0
  183. package/dist/protogen-ts/google/longrunning/operations.ts +890 -0
  184. package/dist/protogen-ts/google/protobuf/any.ts +259 -0
  185. package/dist/protogen-ts/google/protobuf/descriptor.ts +4831 -0
  186. package/dist/protogen-ts/google/protobuf/duration.ts +203 -0
  187. package/dist/protogen-ts/google/protobuf/empty.ts +70 -0
  188. package/dist/protogen-ts/google/protobuf/field_mask.ts +289 -0
  189. package/dist/protogen-ts/google/protobuf/struct.ts +543 -0
  190. package/dist/protogen-ts/google/protobuf/timestamp.ts +232 -0
  191. package/dist/protogen-ts/google/rpc/status.ts +138 -0
  192. package/dist/protogen-ts/model/controller/v1alpha/controller.ts +823 -0
  193. package/dist/protogen-ts/model/controller/v1alpha/controller_service.ts +95 -0
  194. package/dist/protogen-ts/model/model/v1alpha/common.ts +135 -0
  195. package/dist/protogen-ts/model/model/v1alpha/model.ts +5682 -0
  196. package/dist/protogen-ts/model/model/v1alpha/model_definition.ts +775 -0
  197. package/dist/protogen-ts/model/model/v1alpha/model_private_service.ts +87 -0
  198. package/dist/protogen-ts/model/model/v1alpha/model_public_service.ts +383 -0
  199. package/dist/protogen-ts/model/model/v1alpha/task_classification.ts +326 -0
  200. package/dist/protogen-ts/model/model/v1alpha/task_detection.ts +411 -0
  201. package/dist/protogen-ts/model/model/v1alpha/task_instance_segmentation.ts +435 -0
  202. package/dist/protogen-ts/model/model/v1alpha/task_keypoint.ts +510 -0
  203. package/dist/protogen-ts/model/model/v1alpha/task_ocr.ts +406 -0
  204. package/dist/protogen-ts/model/model/v1alpha/task_semantic_segmentation.ts +396 -0
  205. package/dist/protogen-ts/model/model/v1alpha/task_text_generation.ts +247 -0
  206. package/dist/protogen-ts/model/model/v1alpha/task_text_to_image.ts +221 -0
  207. package/dist/protogen-ts/model/model/v1alpha/task_unspecified.ts +142 -0
  208. package/dist/protogen-ts/protoc-gen-openapiv2/options/annotations.ts +3 -0
  209. package/dist/protogen-ts/protoc-gen-openapiv2/options/openapiv2.ts +5095 -0
  210. package/dist/protogen-ts/vdp/connector/v1alpha/connector.ts +3637 -0
  211. package/dist/protogen-ts/vdp/connector/v1alpha/connector_definition.ts +1043 -0
  212. package/dist/protogen-ts/vdp/connector/v1alpha/connector_private_service.ts +92 -0
  213. package/dist/protogen-ts/vdp/connector/v1alpha/connector_public_service.ts +310 -0
  214. package/dist/protogen-ts/vdp/connector/v1alpha/spec.ts +126 -0
  215. package/dist/protogen-ts/vdp/controller/v1alpha/controller.ts +853 -0
  216. package/dist/protogen-ts/vdp/controller/v1alpha/controller_service.ts +95 -0
  217. package/dist/protogen-ts/vdp/pipeline/v1alpha/common.ts +498 -0
  218. package/dist/protogen-ts/vdp/pipeline/v1alpha/operator_definition.ts +948 -0
  219. package/dist/protogen-ts/vdp/pipeline/v1alpha/pipeline.ts +6006 -0
  220. package/dist/protogen-ts/vdp/pipeline/v1alpha/pipeline_private_service.ts +83 -0
  221. package/dist/protogen-ts/vdp/pipeline/v1alpha/pipeline_public_service.ts +413 -0
  222. package/dist/tsconfig.tsbuildinfo +1 -0
  223. package/dist/types.d.ts +23 -0
  224. package/dist/types.js +18 -0
  225. package/dist/types.mjs +1 -0
  226. package/package.json +50 -0
@@ -0,0 +1,396 @@
1
+ /* eslint-disable */
2
+ import * as _m0 from "protobufjs/minimal";
3
+
4
+ export const protobufPackage = "model.model.v1alpha";
5
+
6
+ /** SemanticSegmentationStuff corresponding to a semantic segmentation stuff */
7
+ export interface SemanticSegmentationStuff {
8
+ /** RLE segmentation mask */
9
+ rle: string;
10
+ /** Stuff category */
11
+ category: string;
12
+ }
13
+
14
+ /** SemanticSegmentationInput represents the input of semantic segmentation task */
15
+ export interface SemanticSegmentationInput {
16
+ /** Image type URL */
17
+ imageUrl?:
18
+ | string
19
+ | undefined;
20
+ /** Image type base64 */
21
+ imageBase64?: string | undefined;
22
+ }
23
+
24
+ /**
25
+ * SemanticSegmentationInputStream represents the input of semantic segmentation
26
+ * task when using stream method
27
+ */
28
+ export interface SemanticSegmentationInputStream {
29
+ /** The list of file length for each uploaded binary file */
30
+ fileLengths: number[];
31
+ /** Content of images in bytes */
32
+ content: Uint8Array;
33
+ }
34
+
35
+ /**
36
+ * SemanticSegmentationOutput represents the output of semantic segmentation
37
+ * task
38
+ */
39
+ export interface SemanticSegmentationOutput {
40
+ /** A list of semantic segmentation stuffs */
41
+ stuffs: SemanticSegmentationStuff[];
42
+ }
43
+
44
+ function createBaseSemanticSegmentationStuff(): SemanticSegmentationStuff {
45
+ return { rle: "", category: "" };
46
+ }
47
+
48
+ export const SemanticSegmentationStuff = {
49
+ encode(message: SemanticSegmentationStuff, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
50
+ if (message.rle !== "") {
51
+ writer.uint32(10).string(message.rle);
52
+ }
53
+ if (message.category !== "") {
54
+ writer.uint32(18).string(message.category);
55
+ }
56
+ return writer;
57
+ },
58
+
59
+ decode(input: _m0.Reader | Uint8Array, length?: number): SemanticSegmentationStuff {
60
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
61
+ let end = length === undefined ? reader.len : reader.pos + length;
62
+ const message = createBaseSemanticSegmentationStuff();
63
+ while (reader.pos < end) {
64
+ const tag = reader.uint32();
65
+ switch (tag >>> 3) {
66
+ case 1:
67
+ if (tag !== 10) {
68
+ break;
69
+ }
70
+
71
+ message.rle = reader.string();
72
+ continue;
73
+ case 2:
74
+ if (tag !== 18) {
75
+ break;
76
+ }
77
+
78
+ message.category = reader.string();
79
+ continue;
80
+ }
81
+ if ((tag & 7) === 4 || tag === 0) {
82
+ break;
83
+ }
84
+ reader.skipType(tag & 7);
85
+ }
86
+ return message;
87
+ },
88
+
89
+ fromJSON(object: any): SemanticSegmentationStuff {
90
+ return {
91
+ rle: isSet(object.rle) ? String(object.rle) : "",
92
+ category: isSet(object.category) ? String(object.category) : "",
93
+ };
94
+ },
95
+
96
+ toJSON(message: SemanticSegmentationStuff): unknown {
97
+ const obj: any = {};
98
+ if (message.rle !== "") {
99
+ obj.rle = message.rle;
100
+ }
101
+ if (message.category !== "") {
102
+ obj.category = message.category;
103
+ }
104
+ return obj;
105
+ },
106
+
107
+ create<I extends Exact<DeepPartial<SemanticSegmentationStuff>, I>>(base?: I): SemanticSegmentationStuff {
108
+ return SemanticSegmentationStuff.fromPartial(base ?? ({} as any));
109
+ },
110
+ fromPartial<I extends Exact<DeepPartial<SemanticSegmentationStuff>, I>>(object: I): SemanticSegmentationStuff {
111
+ const message = createBaseSemanticSegmentationStuff();
112
+ message.rle = object.rle ?? "";
113
+ message.category = object.category ?? "";
114
+ return message;
115
+ },
116
+ };
117
+
118
+ function createBaseSemanticSegmentationInput(): SemanticSegmentationInput {
119
+ return { imageUrl: undefined, imageBase64: undefined };
120
+ }
121
+
122
+ export const SemanticSegmentationInput = {
123
+ encode(message: SemanticSegmentationInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
124
+ if (message.imageUrl !== undefined) {
125
+ writer.uint32(10).string(message.imageUrl);
126
+ }
127
+ if (message.imageBase64 !== undefined) {
128
+ writer.uint32(18).string(message.imageBase64);
129
+ }
130
+ return writer;
131
+ },
132
+
133
+ decode(input: _m0.Reader | Uint8Array, length?: number): SemanticSegmentationInput {
134
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
135
+ let end = length === undefined ? reader.len : reader.pos + length;
136
+ const message = createBaseSemanticSegmentationInput();
137
+ while (reader.pos < end) {
138
+ const tag = reader.uint32();
139
+ switch (tag >>> 3) {
140
+ case 1:
141
+ if (tag !== 10) {
142
+ break;
143
+ }
144
+
145
+ message.imageUrl = reader.string();
146
+ continue;
147
+ case 2:
148
+ if (tag !== 18) {
149
+ break;
150
+ }
151
+
152
+ message.imageBase64 = reader.string();
153
+ continue;
154
+ }
155
+ if ((tag & 7) === 4 || tag === 0) {
156
+ break;
157
+ }
158
+ reader.skipType(tag & 7);
159
+ }
160
+ return message;
161
+ },
162
+
163
+ fromJSON(object: any): SemanticSegmentationInput {
164
+ return {
165
+ imageUrl: isSet(object.imageUrl) ? String(object.imageUrl) : undefined,
166
+ imageBase64: isSet(object.imageBase64) ? String(object.imageBase64) : undefined,
167
+ };
168
+ },
169
+
170
+ toJSON(message: SemanticSegmentationInput): unknown {
171
+ const obj: any = {};
172
+ if (message.imageUrl !== undefined) {
173
+ obj.imageUrl = message.imageUrl;
174
+ }
175
+ if (message.imageBase64 !== undefined) {
176
+ obj.imageBase64 = message.imageBase64;
177
+ }
178
+ return obj;
179
+ },
180
+
181
+ create<I extends Exact<DeepPartial<SemanticSegmentationInput>, I>>(base?: I): SemanticSegmentationInput {
182
+ return SemanticSegmentationInput.fromPartial(base ?? ({} as any));
183
+ },
184
+ fromPartial<I extends Exact<DeepPartial<SemanticSegmentationInput>, I>>(object: I): SemanticSegmentationInput {
185
+ const message = createBaseSemanticSegmentationInput();
186
+ message.imageUrl = object.imageUrl ?? undefined;
187
+ message.imageBase64 = object.imageBase64 ?? undefined;
188
+ return message;
189
+ },
190
+ };
191
+
192
+ function createBaseSemanticSegmentationInputStream(): SemanticSegmentationInputStream {
193
+ return { fileLengths: [], content: new Uint8Array(0) };
194
+ }
195
+
196
+ export const SemanticSegmentationInputStream = {
197
+ encode(message: SemanticSegmentationInputStream, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
198
+ writer.uint32(10).fork();
199
+ for (const v of message.fileLengths) {
200
+ writer.uint32(v);
201
+ }
202
+ writer.ldelim();
203
+ if (message.content.length !== 0) {
204
+ writer.uint32(18).bytes(message.content);
205
+ }
206
+ return writer;
207
+ },
208
+
209
+ decode(input: _m0.Reader | Uint8Array, length?: number): SemanticSegmentationInputStream {
210
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
211
+ let end = length === undefined ? reader.len : reader.pos + length;
212
+ const message = createBaseSemanticSegmentationInputStream();
213
+ while (reader.pos < end) {
214
+ const tag = reader.uint32();
215
+ switch (tag >>> 3) {
216
+ case 1:
217
+ if (tag === 8) {
218
+ message.fileLengths.push(reader.uint32());
219
+
220
+ continue;
221
+ }
222
+
223
+ if (tag === 10) {
224
+ const end2 = reader.uint32() + reader.pos;
225
+ while (reader.pos < end2) {
226
+ message.fileLengths.push(reader.uint32());
227
+ }
228
+
229
+ continue;
230
+ }
231
+
232
+ break;
233
+ case 2:
234
+ if (tag !== 18) {
235
+ break;
236
+ }
237
+
238
+ message.content = reader.bytes();
239
+ continue;
240
+ }
241
+ if ((tag & 7) === 4 || tag === 0) {
242
+ break;
243
+ }
244
+ reader.skipType(tag & 7);
245
+ }
246
+ return message;
247
+ },
248
+
249
+ fromJSON(object: any): SemanticSegmentationInputStream {
250
+ return {
251
+ fileLengths: Array.isArray(object?.fileLengths) ? object.fileLengths.map((e: any) => Number(e)) : [],
252
+ content: isSet(object.content) ? bytesFromBase64(object.content) : new Uint8Array(0),
253
+ };
254
+ },
255
+
256
+ toJSON(message: SemanticSegmentationInputStream): unknown {
257
+ const obj: any = {};
258
+ if (message.fileLengths?.length) {
259
+ obj.fileLengths = message.fileLengths.map((e) => Math.round(e));
260
+ }
261
+ if (message.content.length !== 0) {
262
+ obj.content = base64FromBytes(message.content);
263
+ }
264
+ return obj;
265
+ },
266
+
267
+ create<I extends Exact<DeepPartial<SemanticSegmentationInputStream>, I>>(base?: I): SemanticSegmentationInputStream {
268
+ return SemanticSegmentationInputStream.fromPartial(base ?? ({} as any));
269
+ },
270
+ fromPartial<I extends Exact<DeepPartial<SemanticSegmentationInputStream>, I>>(
271
+ object: I,
272
+ ): SemanticSegmentationInputStream {
273
+ const message = createBaseSemanticSegmentationInputStream();
274
+ message.fileLengths = object.fileLengths?.map((e) => e) || [];
275
+ message.content = object.content ?? new Uint8Array(0);
276
+ return message;
277
+ },
278
+ };
279
+
280
+ function createBaseSemanticSegmentationOutput(): SemanticSegmentationOutput {
281
+ return { stuffs: [] };
282
+ }
283
+
284
+ export const SemanticSegmentationOutput = {
285
+ encode(message: SemanticSegmentationOutput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
286
+ for (const v of message.stuffs) {
287
+ SemanticSegmentationStuff.encode(v!, writer.uint32(10).fork()).ldelim();
288
+ }
289
+ return writer;
290
+ },
291
+
292
+ decode(input: _m0.Reader | Uint8Array, length?: number): SemanticSegmentationOutput {
293
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
294
+ let end = length === undefined ? reader.len : reader.pos + length;
295
+ const message = createBaseSemanticSegmentationOutput();
296
+ while (reader.pos < end) {
297
+ const tag = reader.uint32();
298
+ switch (tag >>> 3) {
299
+ case 1:
300
+ if (tag !== 10) {
301
+ break;
302
+ }
303
+
304
+ message.stuffs.push(SemanticSegmentationStuff.decode(reader, reader.uint32()));
305
+ continue;
306
+ }
307
+ if ((tag & 7) === 4 || tag === 0) {
308
+ break;
309
+ }
310
+ reader.skipType(tag & 7);
311
+ }
312
+ return message;
313
+ },
314
+
315
+ fromJSON(object: any): SemanticSegmentationOutput {
316
+ return {
317
+ stuffs: Array.isArray(object?.stuffs) ? object.stuffs.map((e: any) => SemanticSegmentationStuff.fromJSON(e)) : [],
318
+ };
319
+ },
320
+
321
+ toJSON(message: SemanticSegmentationOutput): unknown {
322
+ const obj: any = {};
323
+ if (message.stuffs?.length) {
324
+ obj.stuffs = message.stuffs.map((e) => SemanticSegmentationStuff.toJSON(e));
325
+ }
326
+ return obj;
327
+ },
328
+
329
+ create<I extends Exact<DeepPartial<SemanticSegmentationOutput>, I>>(base?: I): SemanticSegmentationOutput {
330
+ return SemanticSegmentationOutput.fromPartial(base ?? ({} as any));
331
+ },
332
+ fromPartial<I extends Exact<DeepPartial<SemanticSegmentationOutput>, I>>(object: I): SemanticSegmentationOutput {
333
+ const message = createBaseSemanticSegmentationOutput();
334
+ message.stuffs = object.stuffs?.map((e) => SemanticSegmentationStuff.fromPartial(e)) || [];
335
+ return message;
336
+ },
337
+ };
338
+
339
+ declare const self: any | undefined;
340
+ declare const window: any | undefined;
341
+ declare const global: any | undefined;
342
+ const tsProtoGlobalThis: any = (() => {
343
+ if (typeof globalThis !== "undefined") {
344
+ return globalThis;
345
+ }
346
+ if (typeof self !== "undefined") {
347
+ return self;
348
+ }
349
+ if (typeof window !== "undefined") {
350
+ return window;
351
+ }
352
+ if (typeof global !== "undefined") {
353
+ return global;
354
+ }
355
+ throw "Unable to locate global object";
356
+ })();
357
+
358
+ function bytesFromBase64(b64: string): Uint8Array {
359
+ if (tsProtoGlobalThis.Buffer) {
360
+ return Uint8Array.from(tsProtoGlobalThis.Buffer.from(b64, "base64"));
361
+ } else {
362
+ const bin = tsProtoGlobalThis.atob(b64);
363
+ const arr = new Uint8Array(bin.length);
364
+ for (let i = 0; i < bin.length; ++i) {
365
+ arr[i] = bin.charCodeAt(i);
366
+ }
367
+ return arr;
368
+ }
369
+ }
370
+
371
+ function base64FromBytes(arr: Uint8Array): string {
372
+ if (tsProtoGlobalThis.Buffer) {
373
+ return tsProtoGlobalThis.Buffer.from(arr).toString("base64");
374
+ } else {
375
+ const bin: string[] = [];
376
+ arr.forEach((byte) => {
377
+ bin.push(String.fromCharCode(byte));
378
+ });
379
+ return tsProtoGlobalThis.btoa(bin.join(""));
380
+ }
381
+ }
382
+
383
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
384
+
385
+ export type DeepPartial<T> = T extends Builtin ? T
386
+ : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
387
+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
388
+ : Partial<T>;
389
+
390
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
391
+ export type Exact<P, I extends P> = P extends Builtin ? P
392
+ : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
393
+
394
+ function isSet(value: any): boolean {
395
+ return value !== null && value !== undefined;
396
+ }
@@ -0,0 +1,247 @@
1
+ /* eslint-disable */
2
+ import * as _m0 from "protobufjs/minimal";
3
+
4
+ export const protobufPackage = "model.model.v1alpha";
5
+
6
+ /** TextGenerationInput represents the input of text generation task */
7
+ export interface TextGenerationInput {
8
+ /** The prompt text */
9
+ prompt: string;
10
+ /** The maximum number of tokens for model to generate */
11
+ outputLen?:
12
+ | number
13
+ | undefined;
14
+ /** The words not to avoid being generated by the model */
15
+ badWordsList?:
16
+ | string
17
+ | undefined;
18
+ /** The trigger words to stop generation */
19
+ stopWordsList?:
20
+ | string
21
+ | undefined;
22
+ /** Top k for sampling */
23
+ topk?:
24
+ | number
25
+ | undefined;
26
+ /** The seed */
27
+ seed?: number | undefined;
28
+ }
29
+
30
+ /** TextGenerationOutput represents the output of text generation task */
31
+ export interface TextGenerationOutput {
32
+ /** The text generated by the model */
33
+ text: string;
34
+ }
35
+
36
+ function createBaseTextGenerationInput(): TextGenerationInput {
37
+ return {
38
+ prompt: "",
39
+ outputLen: undefined,
40
+ badWordsList: undefined,
41
+ stopWordsList: undefined,
42
+ topk: undefined,
43
+ seed: undefined,
44
+ };
45
+ }
46
+
47
+ export const TextGenerationInput = {
48
+ encode(message: TextGenerationInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
49
+ if (message.prompt !== "") {
50
+ writer.uint32(10).string(message.prompt);
51
+ }
52
+ if (message.outputLen !== undefined) {
53
+ writer.uint32(16).int32(message.outputLen);
54
+ }
55
+ if (message.badWordsList !== undefined) {
56
+ writer.uint32(26).string(message.badWordsList);
57
+ }
58
+ if (message.stopWordsList !== undefined) {
59
+ writer.uint32(34).string(message.stopWordsList);
60
+ }
61
+ if (message.topk !== undefined) {
62
+ writer.uint32(40).int32(message.topk);
63
+ }
64
+ if (message.seed !== undefined) {
65
+ writer.uint32(48).int32(message.seed);
66
+ }
67
+ return writer;
68
+ },
69
+
70
+ decode(input: _m0.Reader | Uint8Array, length?: number): TextGenerationInput {
71
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
72
+ let end = length === undefined ? reader.len : reader.pos + length;
73
+ const message = createBaseTextGenerationInput();
74
+ while (reader.pos < end) {
75
+ const tag = reader.uint32();
76
+ switch (tag >>> 3) {
77
+ case 1:
78
+ if (tag !== 10) {
79
+ break;
80
+ }
81
+
82
+ message.prompt = reader.string();
83
+ continue;
84
+ case 2:
85
+ if (tag !== 16) {
86
+ break;
87
+ }
88
+
89
+ message.outputLen = reader.int32();
90
+ continue;
91
+ case 3:
92
+ if (tag !== 26) {
93
+ break;
94
+ }
95
+
96
+ message.badWordsList = reader.string();
97
+ continue;
98
+ case 4:
99
+ if (tag !== 34) {
100
+ break;
101
+ }
102
+
103
+ message.stopWordsList = reader.string();
104
+ continue;
105
+ case 5:
106
+ if (tag !== 40) {
107
+ break;
108
+ }
109
+
110
+ message.topk = reader.int32();
111
+ continue;
112
+ case 6:
113
+ if (tag !== 48) {
114
+ break;
115
+ }
116
+
117
+ message.seed = reader.int32();
118
+ continue;
119
+ }
120
+ if ((tag & 7) === 4 || tag === 0) {
121
+ break;
122
+ }
123
+ reader.skipType(tag & 7);
124
+ }
125
+ return message;
126
+ },
127
+
128
+ fromJSON(object: any): TextGenerationInput {
129
+ return {
130
+ prompt: isSet(object.prompt) ? String(object.prompt) : "",
131
+ outputLen: isSet(object.outputLen) ? Number(object.outputLen) : undefined,
132
+ badWordsList: isSet(object.badWordsList) ? String(object.badWordsList) : undefined,
133
+ stopWordsList: isSet(object.stopWordsList) ? String(object.stopWordsList) : undefined,
134
+ topk: isSet(object.topk) ? Number(object.topk) : undefined,
135
+ seed: isSet(object.seed) ? Number(object.seed) : undefined,
136
+ };
137
+ },
138
+
139
+ toJSON(message: TextGenerationInput): unknown {
140
+ const obj: any = {};
141
+ if (message.prompt !== "") {
142
+ obj.prompt = message.prompt;
143
+ }
144
+ if (message.outputLen !== undefined) {
145
+ obj.outputLen = Math.round(message.outputLen);
146
+ }
147
+ if (message.badWordsList !== undefined) {
148
+ obj.badWordsList = message.badWordsList;
149
+ }
150
+ if (message.stopWordsList !== undefined) {
151
+ obj.stopWordsList = message.stopWordsList;
152
+ }
153
+ if (message.topk !== undefined) {
154
+ obj.topk = Math.round(message.topk);
155
+ }
156
+ if (message.seed !== undefined) {
157
+ obj.seed = Math.round(message.seed);
158
+ }
159
+ return obj;
160
+ },
161
+
162
+ create<I extends Exact<DeepPartial<TextGenerationInput>, I>>(base?: I): TextGenerationInput {
163
+ return TextGenerationInput.fromPartial(base ?? ({} as any));
164
+ },
165
+ fromPartial<I extends Exact<DeepPartial<TextGenerationInput>, I>>(object: I): TextGenerationInput {
166
+ const message = createBaseTextGenerationInput();
167
+ message.prompt = object.prompt ?? "";
168
+ message.outputLen = object.outputLen ?? undefined;
169
+ message.badWordsList = object.badWordsList ?? undefined;
170
+ message.stopWordsList = object.stopWordsList ?? undefined;
171
+ message.topk = object.topk ?? undefined;
172
+ message.seed = object.seed ?? undefined;
173
+ return message;
174
+ },
175
+ };
176
+
177
+ function createBaseTextGenerationOutput(): TextGenerationOutput {
178
+ return { text: "" };
179
+ }
180
+
181
+ export const TextGenerationOutput = {
182
+ encode(message: TextGenerationOutput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
183
+ if (message.text !== "") {
184
+ writer.uint32(10).string(message.text);
185
+ }
186
+ return writer;
187
+ },
188
+
189
+ decode(input: _m0.Reader | Uint8Array, length?: number): TextGenerationOutput {
190
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
191
+ let end = length === undefined ? reader.len : reader.pos + length;
192
+ const message = createBaseTextGenerationOutput();
193
+ while (reader.pos < end) {
194
+ const tag = reader.uint32();
195
+ switch (tag >>> 3) {
196
+ case 1:
197
+ if (tag !== 10) {
198
+ break;
199
+ }
200
+
201
+ message.text = reader.string();
202
+ continue;
203
+ }
204
+ if ((tag & 7) === 4 || tag === 0) {
205
+ break;
206
+ }
207
+ reader.skipType(tag & 7);
208
+ }
209
+ return message;
210
+ },
211
+
212
+ fromJSON(object: any): TextGenerationOutput {
213
+ return { text: isSet(object.text) ? String(object.text) : "" };
214
+ },
215
+
216
+ toJSON(message: TextGenerationOutput): unknown {
217
+ const obj: any = {};
218
+ if (message.text !== "") {
219
+ obj.text = message.text;
220
+ }
221
+ return obj;
222
+ },
223
+
224
+ create<I extends Exact<DeepPartial<TextGenerationOutput>, I>>(base?: I): TextGenerationOutput {
225
+ return TextGenerationOutput.fromPartial(base ?? ({} as any));
226
+ },
227
+ fromPartial<I extends Exact<DeepPartial<TextGenerationOutput>, I>>(object: I): TextGenerationOutput {
228
+ const message = createBaseTextGenerationOutput();
229
+ message.text = object.text ?? "";
230
+ return message;
231
+ },
232
+ };
233
+
234
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
235
+
236
+ export type DeepPartial<T> = T extends Builtin ? T
237
+ : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
238
+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
239
+ : Partial<T>;
240
+
241
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
242
+ export type Exact<P, I extends P> = P extends Builtin ? P
243
+ : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
244
+
245
+ function isSet(value: any): boolean {
246
+ return value !== null && value !== undefined;
247
+ }