honeyhive 0.3.6 → 0.3.8

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 (236) hide show
  1. package/README.md +33 -33
  2. package/dist/internal/utils/queryparams.js +3 -1
  3. package/dist/internal/utils/security.js +11 -3
  4. package/dist/sdk/models/operations/deletedatasets.d.ts +21 -0
  5. package/dist/sdk/models/operations/deletedatasets.js +79 -0
  6. package/dist/sdk/models/operations/deleteevaluationsid.d.ts +24 -0
  7. package/dist/sdk/models/operations/deleteevaluationsid.js +91 -0
  8. package/dist/sdk/models/operations/deletefinetunedmodelsid.d.ts +19 -0
  9. package/dist/sdk/models/operations/deletefinetunedmodelsid.js +63 -0
  10. package/dist/sdk/models/operations/deletemetrics.d.ts +1 -3
  11. package/dist/sdk/models/operations/deletemetrics.js +2 -10
  12. package/dist/sdk/models/operations/deletesessionsessionid.d.ts +24 -0
  13. package/dist/sdk/models/operations/deletesessionsessionid.js +91 -0
  14. package/dist/sdk/models/operations/getevaluations.d.ts +21 -0
  15. package/dist/sdk/models/operations/getevaluations.js +79 -0
  16. package/dist/sdk/models/operations/getevaluationsid.d.ts +24 -0
  17. package/dist/sdk/models/operations/getevaluationsid.js +91 -0
  18. package/dist/sdk/models/operations/getmetrics.d.ts +1 -2
  19. package/dist/sdk/models/operations/getmetrics.js +1 -5
  20. package/dist/sdk/models/operations/index.d.ts +13 -0
  21. package/dist/sdk/models/operations/index.js +13 -0
  22. package/dist/sdk/models/operations/postchat.d.ts +21 -0
  23. package/dist/sdk/models/operations/postchat.js +79 -0
  24. package/dist/sdk/models/operations/postfinetunedmodels.d.ts +32 -0
  25. package/dist/sdk/models/operations/postfinetunedmodels.js +100 -0
  26. package/dist/sdk/models/operations/postmetricscompute.d.ts +21 -0
  27. package/dist/sdk/models/operations/postmetricscompute.js +79 -0
  28. package/dist/sdk/models/operations/putdatasets.d.ts +21 -0
  29. package/dist/sdk/models/operations/putdatasets.js +79 -0
  30. package/dist/sdk/models/operations/putevaluationsid.d.ts +25 -0
  31. package/dist/sdk/models/operations/putevaluationsid.js +95 -0
  32. package/dist/sdk/models/operations/putmetrics.d.ts +21 -0
  33. package/dist/sdk/models/operations/putmetrics.js +79 -0
  34. package/dist/sdk/models/operations/putsessionsessionid.d.ts +25 -0
  35. package/dist/sdk/models/operations/putsessionsessionid.js +95 -0
  36. package/dist/sdk/models/shared/chatcompletionrequest.d.ts +37 -0
  37. package/dist/sdk/models/shared/chatcompletionrequest.js +90 -0
  38. package/dist/sdk/models/shared/chatcompletionresponse.d.ts +10 -0
  39. package/dist/sdk/models/shared/chatcompletionresponse.js +79 -0
  40. package/dist/sdk/models/shared/deleteresponse.d.ts +5 -3
  41. package/dist/sdk/models/shared/deleteresponse.js +14 -5
  42. package/dist/sdk/models/shared/evaluation.d.ts +60 -0
  43. package/dist/sdk/models/shared/evaluation.js +119 -0
  44. package/dist/sdk/models/shared/evaluationupdaterequest.d.ts +55 -0
  45. package/dist/sdk/models/shared/evaluationupdaterequest.js +105 -0
  46. package/dist/sdk/models/shared/feedbackquery.d.ts +2 -2
  47. package/dist/sdk/models/shared/generationresponse.d.ts +4 -0
  48. package/dist/sdk/models/shared/generationresponse.js +5 -0
  49. package/dist/sdk/models/shared/index.d.ts +13 -1
  50. package/dist/sdk/models/shared/index.js +13 -1
  51. package/dist/sdk/models/shared/metric.d.ts +6 -0
  52. package/dist/sdk/models/shared/metric.js +55 -0
  53. package/dist/sdk/models/shared/metriccomputerequest.d.ts +6 -0
  54. package/dist/sdk/models/shared/metriccomputerequest.js +52 -0
  55. package/dist/sdk/models/shared/metriccomputeresponse.d.ts +4 -0
  56. package/dist/sdk/models/shared/metriccomputeresponse.js +45 -0
  57. package/dist/sdk/models/shared/metriccreaterequest.d.ts +17 -0
  58. package/dist/sdk/models/shared/metriccreaterequest.js +109 -0
  59. package/dist/sdk/models/shared/metriccreateresponse.d.ts +0 -3
  60. package/dist/sdk/models/shared/metricdeleteresponse.d.ts +4 -0
  61. package/dist/sdk/models/shared/metricdeleteresponse.js +45 -0
  62. package/dist/sdk/models/shared/metricupdaterequest.d.ts +16 -0
  63. package/dist/sdk/models/shared/metricupdaterequest.js +104 -0
  64. package/dist/sdk/models/shared/metricupdateresponse.d.ts +4 -0
  65. package/dist/sdk/models/shared/metricupdateresponse.js +45 -0
  66. package/dist/sdk/models/shared/sessioneventupdate.d.ts +56 -0
  67. package/dist/sdk/models/shared/sessioneventupdate.js +135 -0
  68. package/dist/sdk/models/shared/updateresponse.d.ts +12 -0
  69. package/dist/sdk/models/shared/updateresponse.js +57 -0
  70. package/dist/sdk/sdk.d.ts +55 -3
  71. package/dist/sdk/sdk.js +1254 -402
  72. package/docs/{models → sdk/models}/operations/deletedatasetsnamerequest.md +0 -0
  73. package/docs/sdk/models/operations/deletedatasetsnameresponse.md +11 -0
  74. package/docs/sdk/models/operations/deletedatasetsresponse.md +11 -0
  75. package/docs/sdk/models/operations/deleteevaluationsidrequest.md +8 -0
  76. package/docs/sdk/models/operations/deleteevaluationsidresponse.md +11 -0
  77. package/docs/sdk/models/operations/deletefinetunedmodelsidrequest.md +8 -0
  78. package/docs/sdk/models/operations/deletefinetunedmodelsidresponse.md +10 -0
  79. package/docs/sdk/models/operations/deletemetricsrequest.md +8 -0
  80. package/docs/sdk/models/operations/deletemetricsresponse.md +11 -0
  81. package/docs/{models → sdk/models}/operations/deletepromptsidrequest.md +0 -0
  82. package/docs/sdk/models/operations/deletepromptsidresponse.md +11 -0
  83. package/docs/sdk/models/operations/deletesessionsessionidrequest.md +8 -0
  84. package/docs/sdk/models/operations/deletesessionsessionidresponse.md +11 -0
  85. package/docs/{models → sdk/models}/operations/deletetasksrequest.md +0 -0
  86. package/docs/sdk/models/operations/deletetasksresponse.md +11 -0
  87. package/docs/{models → sdk/models}/operations/getdatasetsrequest.md +0 -0
  88. package/docs/sdk/models/operations/getdatasetsresponse.md +11 -0
  89. package/docs/sdk/models/operations/getevaluationsidrequest.md +8 -0
  90. package/docs/sdk/models/operations/getevaluationsidresponse.md +11 -0
  91. package/docs/sdk/models/operations/getevaluationsresponse.md +11 -0
  92. package/docs/{models → sdk/models}/operations/getfinetunedmodelsidrequest.md +0 -0
  93. package/docs/sdk/models/operations/getfinetunedmodelsidresponse.md +11 -0
  94. package/docs/{models → sdk/models}/operations/getfinetunedmodelsrequest.md +0 -0
  95. package/docs/sdk/models/operations/getfinetunedmodelsresponse.md +11 -0
  96. package/docs/{models → sdk/models}/operations/getgenerationsrequest.md +0 -0
  97. package/docs/sdk/models/operations/getgenerationsresponse.md +11 -0
  98. package/docs/{models → sdk/models}/operations/getmetricsrequest.md +0 -1
  99. package/docs/sdk/models/operations/getmetricsresponse.md +11 -0
  100. package/docs/{models → sdk/models}/operations/getpromptsrequest.md +0 -0
  101. package/docs/sdk/models/operations/getpromptsresponse.md +11 -0
  102. package/docs/{models → sdk/models}/operations/getsessionrequest.md +0 -0
  103. package/docs/sdk/models/operations/getsessionresponse.md +11 -0
  104. package/docs/{models → sdk/models}/operations/getsessionsessionidexportrequest.md +0 -0
  105. package/docs/sdk/models/operations/getsessionsessionidexportresponse.md +11 -0
  106. package/docs/{models → sdk/models}/operations/getsessionsessionidrequest.md +0 -0
  107. package/docs/sdk/models/operations/getsessionsessionidresponse.md +11 -0
  108. package/docs/{models → sdk/models}/operations/gettasksrequest.md +0 -0
  109. package/docs/sdk/models/operations/gettasksresponse.md +11 -0
  110. package/docs/sdk/models/operations/postchatresponse.md +11 -0
  111. package/docs/sdk/models/operations/postdatasetsresponse.md +11 -0
  112. package/docs/sdk/models/operations/postevaluationsresponse.md +11 -0
  113. package/docs/sdk/models/operations/postfeedbackresponse.md +11 -0
  114. package/docs/sdk/models/operations/postfinetunedmodelsrequestbody.md +11 -0
  115. package/docs/sdk/models/operations/postfinetunedmodelsresponse.md +11 -0
  116. package/docs/sdk/models/operations/postfinetunedmodelsresponsebody.md +10 -0
  117. package/docs/sdk/models/operations/postgenerationslogresponse.md +11 -0
  118. package/docs/sdk/models/operations/postgenerationsresponse.md +11 -0
  119. package/docs/sdk/models/operations/postmetricscomputeresponse.md +11 -0
  120. package/docs/sdk/models/operations/postmetricsresponse.md +11 -0
  121. package/docs/sdk/models/operations/postpromptsresponse.md +11 -0
  122. package/docs/{models → sdk/models}/operations/postsessionsessionidendrequest.md +0 -0
  123. package/docs/sdk/models/operations/postsessionsessionidendresponse.md +11 -0
  124. package/docs/sdk/models/operations/postsessionsessionideventrequest.md +9 -0
  125. package/docs/sdk/models/operations/postsessionsessionideventresponse.md +11 -0
  126. package/docs/sdk/models/operations/postsessionsessionidfeedbackrequest.md +9 -0
  127. package/docs/sdk/models/operations/postsessionsessionidfeedbackresponse.md +11 -0
  128. package/docs/sdk/models/operations/postsessionsessionidtracesrequest.md +9 -0
  129. package/docs/sdk/models/operations/postsessionsessionidtracesresponse.md +11 -0
  130. package/docs/sdk/models/operations/postsessionstartresponse.md +11 -0
  131. package/docs/sdk/models/operations/posttasksresponse.md +11 -0
  132. package/docs/sdk/models/operations/putdatasetsresponse.md +11 -0
  133. package/docs/sdk/models/operations/putevaluationsidrequest.md +9 -0
  134. package/docs/sdk/models/operations/putevaluationsidresponse.md +11 -0
  135. package/docs/sdk/models/operations/putmetricsresponse.md +11 -0
  136. package/docs/sdk/models/operations/putpromptsidrequest.md +9 -0
  137. package/docs/sdk/models/operations/putpromptsidresponse.md +11 -0
  138. package/docs/sdk/models/operations/putsessionsessionidrequest.md +9 -0
  139. package/docs/sdk/models/operations/putsessionsessionidresponse.md +11 -0
  140. package/docs/sdk/models/operations/puttasksresponse.md +11 -0
  141. package/docs/sdk/models/shared/chatcompletionrequest.md +17 -0
  142. package/docs/sdk/models/shared/chatcompletionresponse.md +14 -0
  143. package/docs/{models → sdk/models}/shared/datasetresponse.md +0 -0
  144. package/docs/sdk/models/shared/deleteresponse.md +8 -0
  145. package/docs/sdk/models/shared/evaluation.md +22 -0
  146. package/docs/{models → sdk/models}/shared/evaluationloggingquery.md +0 -0
  147. package/docs/sdk/models/shared/evaluationupdaterequest.md +20 -0
  148. package/docs/sdk/models/shared/feedback.md +9 -0
  149. package/docs/{models → sdk/models}/shared/feedbackquery.md +2 -2
  150. package/docs/{models → sdk/models}/shared/feedbackresponse.md +0 -0
  151. package/docs/{models → sdk/models}/shared/finetunedmodelresponse.md +0 -0
  152. package/docs/{models → sdk/models}/shared/generatequery.md +0 -0
  153. package/docs/{models → sdk/models}/shared/generation.md +0 -0
  154. package/docs/sdk/models/shared/generationloggingquery.md +23 -0
  155. package/docs/{models → sdk/models}/shared/generationresponse.md +1 -0
  156. package/docs/sdk/models/shared/inputs.md +9 -0
  157. package/docs/{models → sdk/models}/shared/metadata.md +0 -0
  158. package/docs/sdk/models/shared/metric.md +10 -0
  159. package/docs/sdk/models/shared/metriccomputerequest.md +9 -0
  160. package/docs/sdk/models/shared/metriccomputeresponse.md +8 -0
  161. package/docs/sdk/models/shared/metriccreaterequest.md +19 -0
  162. package/docs/sdk/models/shared/metriccreateresponse.md +8 -0
  163. package/docs/sdk/models/shared/metricdeleteresponse.md +8 -0
  164. package/docs/{models → sdk/models}/shared/metricresponse.md +0 -0
  165. package/docs/sdk/models/shared/metricupdaterequest.md +18 -0
  166. package/docs/sdk/models/shared/metricupdaterequestthreshold.md +7 -0
  167. package/docs/sdk/models/shared/metricupdateresponse.md +8 -0
  168. package/docs/sdk/models/shared/output.md +9 -0
  169. package/docs/{models → sdk/models}/shared/promptcreationquery.md +0 -0
  170. package/docs/{models → sdk/models}/shared/promptresponse.md +0 -0
  171. package/docs/{models → sdk/models}/shared/promptupdatequery.md +0 -0
  172. package/docs/sdk/models/shared/result.md +9 -0
  173. package/docs/{models → sdk/models}/shared/security.md +0 -0
  174. package/docs/{models → sdk/models}/shared/sessionendresponse.md +0 -0
  175. package/docs/{models → sdk/models}/shared/sessioneventquery.md +0 -0
  176. package/docs/{models → sdk/models}/shared/sessioneventresponse.md +0 -0
  177. package/docs/sdk/models/shared/sessioneventupdate.md +14 -0
  178. package/docs/sdk/models/shared/sessioneventupdatemetadata.md +9 -0
  179. package/docs/{models → sdk/models}/shared/sessionfeedback.md +0 -0
  180. package/docs/{models → sdk/models}/shared/sessionstartquery.md +0 -0
  181. package/docs/{models → sdk/models}/shared/sessionstartresponse.md +0 -0
  182. package/docs/sdk/models/shared/sessiontrace.md +10 -0
  183. package/docs/{models → sdk/models}/shared/successresponse.md +0 -0
  184. package/docs/{models → sdk/models}/shared/successtraceresponse.md +0 -0
  185. package/docs/{models → sdk/models}/shared/taskcreationquery.md +4 -4
  186. package/docs/{models → sdk/models}/shared/taskresponse.md +4 -4
  187. package/docs/sdk/models/shared/taskupdatequery.md +16 -0
  188. package/docs/{models → sdk/models}/shared/taskupdateresponse.md +0 -0
  189. package/docs/sdk/models/shared/threshold.md +7 -0
  190. package/docs/{models → sdk/models}/shared/traceevent.md +0 -0
  191. package/docs/sdk/models/shared/updateresponse.md +8 -0
  192. package/docs/sdk/models/shared/updateresponseresult.md +9 -0
  193. package/docs/{models → sdk/models}/shared/uploaddataset.md +0 -0
  194. package/docs/sdk/models/shared/userproperties.md +9 -0
  195. package/docs/sdks/honeyhive/README.md +903 -295
  196. package/package.json +1 -1
  197. package/docs/models/operations/deletedatasetsnameresponse.md +0 -11
  198. package/docs/models/operations/deletemetricsrequest.md +0 -10
  199. package/docs/models/operations/deletemetricsresponse.md +0 -11
  200. package/docs/models/operations/deletepromptsidresponse.md +0 -11
  201. package/docs/models/operations/deletetasksresponse.md +0 -11
  202. package/docs/models/operations/getdatasetsresponse.md +0 -11
  203. package/docs/models/operations/getfinetunedmodelsidresponse.md +0 -11
  204. package/docs/models/operations/getfinetunedmodelsresponse.md +0 -11
  205. package/docs/models/operations/getgenerationsresponse.md +0 -11
  206. package/docs/models/operations/getmetricsresponse.md +0 -11
  207. package/docs/models/operations/getpromptsresponse.md +0 -11
  208. package/docs/models/operations/getsessionresponse.md +0 -11
  209. package/docs/models/operations/getsessionsessionidexportresponse.md +0 -11
  210. package/docs/models/operations/getsessionsessionidresponse.md +0 -11
  211. package/docs/models/operations/gettasksresponse.md +0 -11
  212. package/docs/models/operations/postdatasetsresponse.md +0 -11
  213. package/docs/models/operations/postevaluationsresponse.md +0 -11
  214. package/docs/models/operations/postfeedbackresponse.md +0 -11
  215. package/docs/models/operations/postgenerationslogresponse.md +0 -11
  216. package/docs/models/operations/postgenerationsresponse.md +0 -11
  217. package/docs/models/operations/postmetricsresponse.md +0 -11
  218. package/docs/models/operations/postpromptsresponse.md +0 -11
  219. package/docs/models/operations/postsessionsessionidendresponse.md +0 -11
  220. package/docs/models/operations/postsessionsessionideventrequest.md +0 -9
  221. package/docs/models/operations/postsessionsessionideventresponse.md +0 -11
  222. package/docs/models/operations/postsessionsessionidfeedbackrequest.md +0 -9
  223. package/docs/models/operations/postsessionsessionidfeedbackresponse.md +0 -11
  224. package/docs/models/operations/postsessionsessionidtracesrequest.md +0 -9
  225. package/docs/models/operations/postsessionsessionidtracesresponse.md +0 -11
  226. package/docs/models/operations/postsessionstartresponse.md +0 -11
  227. package/docs/models/operations/posttasksresponse.md +0 -11
  228. package/docs/models/operations/putpromptsidrequest.md +0 -9
  229. package/docs/models/operations/putpromptsidresponse.md +0 -11
  230. package/docs/models/operations/puttasksresponse.md +0 -11
  231. package/docs/models/shared/deleteresponse.md +0 -10
  232. package/docs/models/shared/generationloggingquery.md +0 -23
  233. package/docs/models/shared/metriccreateresponse.md +0 -8
  234. package/docs/models/shared/metricrequest.md +0 -12
  235. package/docs/models/shared/sessiontrace.md +0 -10
  236. package/docs/models/shared/taskupdatequery.md +0 -16
package/dist/sdk/sdk.js CHANGED
@@ -106,9 +106,9 @@ var SDKConfiguration = /** @class */ (function () {
106
106
  function SDKConfiguration(init) {
107
107
  this.language = "typescript";
108
108
  this.openapiDocVersion = "1.0.1";
109
- this.sdkVersion = "0.5.0";
110
- this.genVersion = "2.183.0";
111
- this.userAgent = "speakeasy-sdk/typescript 0.5.0 2.183.0 1.0.1 honeyhive";
109
+ this.sdkVersion = "0.5.2";
110
+ this.genVersion = "2.187.6";
111
+ this.userAgent = "speakeasy-sdk/typescript 0.5.2 2.187.6 1.0.1 honeyhive";
112
112
  Object.assign(this, init);
113
113
  }
114
114
  return SDKConfiguration;
@@ -122,7 +122,7 @@ var HoneyHive = /** @class */ (function () {
122
122
  if (!serverURL) {
123
123
  serverURL = exports.ServerList[serverIdx];
124
124
  }
125
- var defaultClient = (_b = props === null || props === void 0 ? void 0 : props.defaultClient) !== null && _b !== void 0 ? _b : axios_1.default.create({ baseURL: serverURL });
125
+ var defaultClient = (_b = props === null || props === void 0 ? void 0 : props.defaultClient) !== null && _b !== void 0 ? _b : axios_1.default.create();
126
126
  this.sdkConfiguration = new SDKConfiguration({
127
127
  defaultClient: defaultClient,
128
128
  security: new shared.Security({ bearerAuth: props === null || props === void 0 ? void 0 : props.bearerAuth }),
@@ -130,13 +130,71 @@ var HoneyHive = /** @class */ (function () {
130
130
  retryConfig: props === null || props === void 0 ? void 0 : props.retryConfig,
131
131
  });
132
132
  }
133
+ /**
134
+ * Delete all datasets
135
+ */
136
+ HoneyHive.prototype.deleteDatasets = function (config) {
137
+ var _a, _b;
138
+ return __awaiter(this, void 0, void 0, function () {
139
+ var baseURL, operationUrl, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
140
+ return __generator(this, function (_c) {
141
+ switch (_c.label) {
142
+ case 0:
143
+ baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
144
+ operationUrl = baseURL.replace(/\/$/, "") + "/datasets";
145
+ client = this.sdkConfiguration.defaultClient;
146
+ globalSecurity = this.sdkConfiguration.security;
147
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
148
+ return [4 /*yield*/, globalSecurity()];
149
+ case 1:
150
+ globalSecurity = _c.sent();
151
+ _c.label = 2;
152
+ case 2:
153
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
154
+ globalSecurity = new shared.Security(globalSecurity);
155
+ }
156
+ properties = utils.parseSecurityProperties(globalSecurity);
157
+ headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
158
+ headers["Accept"] = "application/json";
159
+ headers["user-agent"] = this.sdkConfiguration.userAgent;
160
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "delete", headers: headers, responseType: "arraybuffer" }, config))];
161
+ case 3:
162
+ httpRes = _c.sent();
163
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
164
+ if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
165
+ throw new Error("status code not found in response: ".concat(httpRes));
166
+ }
167
+ res = new operations.DeleteDatasetsResponse({
168
+ statusCode: httpRes.status,
169
+ contentType: responseContentType,
170
+ rawResponse: httpRes,
171
+ });
172
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
173
+ switch (true) {
174
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
175
+ if (utils.matchContentType(responseContentType, "application/json")) {
176
+ res.deleteResponse = utils.objectToClass(JSON.parse(decodedRes), shared.DeleteResponse);
177
+ }
178
+ else {
179
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
180
+ }
181
+ break;
182
+ case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
183
+ ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
184
+ throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
185
+ }
186
+ return [2 /*return*/, res];
187
+ }
188
+ });
189
+ });
190
+ };
133
191
  /**
134
192
  * Delete a dataset
135
193
  */
136
194
  HoneyHive.prototype.deleteDatasetsName = function (req, config) {
137
195
  var _a, _b;
138
196
  return __awaiter(this, void 0, void 0, function () {
139
- var baseURL, url, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
197
+ var baseURL, operationUrl, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
140
198
  return __generator(this, function (_c) {
141
199
  switch (_c.label) {
142
200
  case 0:
@@ -144,7 +202,7 @@ var HoneyHive = /** @class */ (function () {
144
202
  req = new operations.DeleteDatasetsNameRequest(req);
145
203
  }
146
204
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
147
- url = utils.generateURL(baseURL, "/datasets/{name}", req);
205
+ operationUrl = utils.generateURL(baseURL, "/datasets/{name}", req);
148
206
  client = this.sdkConfiguration.defaultClient;
149
207
  globalSecurity = this.sdkConfiguration.security;
150
208
  if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
@@ -160,26 +218,87 @@ var HoneyHive = /** @class */ (function () {
160
218
  headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
161
219
  headers["Accept"] = "application/json";
162
220
  headers["user-agent"] = this.sdkConfiguration.userAgent;
163
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "delete", headers: headers, responseType: "arraybuffer" }, config))];
221
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "delete", headers: headers, responseType: "arraybuffer" }, config))];
164
222
  case 3:
165
223
  httpRes = _c.sent();
166
- contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
224
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
167
225
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
168
226
  throw new Error("status code not found in response: ".concat(httpRes));
169
227
  }
170
228
  res = new operations.DeleteDatasetsNameResponse({
171
229
  statusCode: httpRes.status,
172
- contentType: contentType,
230
+ contentType: responseContentType,
231
+ rawResponse: httpRes,
232
+ });
233
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
234
+ switch (true) {
235
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
236
+ if (utils.matchContentType(responseContentType, "application/json")) {
237
+ res.deleteResponse = utils.objectToClass(JSON.parse(decodedRes), shared.DeleteResponse);
238
+ }
239
+ else {
240
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
241
+ }
242
+ break;
243
+ case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
244
+ ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
245
+ throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
246
+ }
247
+ return [2 /*return*/, res];
248
+ }
249
+ });
250
+ });
251
+ };
252
+ /**
253
+ * Delete an evaluation
254
+ */
255
+ HoneyHive.prototype.deleteEvaluationsId = function (req, config) {
256
+ var _a, _b;
257
+ return __awaiter(this, void 0, void 0, function () {
258
+ var baseURL, operationUrl, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
259
+ return __generator(this, function (_c) {
260
+ switch (_c.label) {
261
+ case 0:
262
+ if (!(req instanceof utils.SpeakeasyBase)) {
263
+ req = new operations.DeleteEvaluationsIdRequest(req);
264
+ }
265
+ baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
266
+ operationUrl = utils.generateURL(baseURL, "/evaluations/{id}", req);
267
+ client = this.sdkConfiguration.defaultClient;
268
+ globalSecurity = this.sdkConfiguration.security;
269
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
270
+ return [4 /*yield*/, globalSecurity()];
271
+ case 1:
272
+ globalSecurity = _c.sent();
273
+ _c.label = 2;
274
+ case 2:
275
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
276
+ globalSecurity = new shared.Security(globalSecurity);
277
+ }
278
+ properties = utils.parseSecurityProperties(globalSecurity);
279
+ headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
280
+ headers["Accept"] = "application/json";
281
+ headers["user-agent"] = this.sdkConfiguration.userAgent;
282
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "delete", headers: headers, responseType: "arraybuffer" }, config))];
283
+ case 3:
284
+ httpRes = _c.sent();
285
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
286
+ if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
287
+ throw new Error("status code not found in response: ".concat(httpRes));
288
+ }
289
+ res = new operations.DeleteEvaluationsIdResponse({
290
+ statusCode: httpRes.status,
291
+ contentType: responseContentType,
173
292
  rawResponse: httpRes,
174
293
  });
175
294
  decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
176
295
  switch (true) {
177
296
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
178
- if (utils.matchContentType(contentType, "application/json")) {
297
+ if (utils.matchContentType(responseContentType, "application/json")) {
179
298
  res.deleteResponse = utils.objectToClass(JSON.parse(decodedRes), shared.DeleteResponse);
180
299
  }
181
300
  else {
182
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
301
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
183
302
  }
184
303
  break;
185
304
  case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
@@ -191,13 +310,67 @@ var HoneyHive = /** @class */ (function () {
191
310
  });
192
311
  });
193
312
  };
313
+ /**
314
+ * Delete a fine-tuned model
315
+ */
316
+ HoneyHive.prototype.deleteFineTunedModelsId = function (req, config) {
317
+ var _a, _b;
318
+ return __awaiter(this, void 0, void 0, function () {
319
+ var baseURL, operationUrl, client, globalSecurity, properties, headers, httpRes, responseContentType, res;
320
+ return __generator(this, function (_c) {
321
+ switch (_c.label) {
322
+ case 0:
323
+ if (!(req instanceof utils.SpeakeasyBase)) {
324
+ req = new operations.DeleteFineTunedModelsIdRequest(req);
325
+ }
326
+ baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
327
+ operationUrl = utils.generateURL(baseURL, "/fine_tuned_models/{id}", req);
328
+ client = this.sdkConfiguration.defaultClient;
329
+ globalSecurity = this.sdkConfiguration.security;
330
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
331
+ return [4 /*yield*/, globalSecurity()];
332
+ case 1:
333
+ globalSecurity = _c.sent();
334
+ _c.label = 2;
335
+ case 2:
336
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
337
+ globalSecurity = new shared.Security(globalSecurity);
338
+ }
339
+ properties = utils.parseSecurityProperties(globalSecurity);
340
+ headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
341
+ headers["Accept"] = "*/*";
342
+ headers["user-agent"] = this.sdkConfiguration.userAgent;
343
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "delete", headers: headers, responseType: "arraybuffer" }, config))];
344
+ case 3:
345
+ httpRes = _c.sent();
346
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
347
+ if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
348
+ throw new Error("status code not found in response: ".concat(httpRes));
349
+ }
350
+ res = new operations.DeleteFineTunedModelsIdResponse({
351
+ statusCode: httpRes.status,
352
+ contentType: responseContentType,
353
+ rawResponse: httpRes,
354
+ });
355
+ switch (true) {
356
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
357
+ break;
358
+ case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
359
+ ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
360
+ throw new errors.SDKError("API error occurred", httpRes.status, httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, httpRes);
361
+ }
362
+ return [2 /*return*/, res];
363
+ }
364
+ });
365
+ });
366
+ };
194
367
  /**
195
368
  * Delete a metric
196
369
  */
197
370
  HoneyHive.prototype.deleteMetrics = function (req, config) {
198
371
  var _a, _b;
199
372
  return __awaiter(this, void 0, void 0, function () {
200
- var baseURL, url, client, globalSecurity, properties, headers, queryParams, httpRes, contentType, res, decodedRes;
373
+ var baseURL, operationUrl, client, globalSecurity, properties, headers, queryParams, httpRes, responseContentType, res, decodedRes;
201
374
  return __generator(this, function (_c) {
202
375
  switch (_c.label) {
203
376
  case 0:
@@ -205,7 +378,7 @@ var HoneyHive = /** @class */ (function () {
205
378
  req = new operations.DeleteMetricsRequest(req);
206
379
  }
207
380
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
208
- url = baseURL.replace(/\/$/, "") + "/metrics";
381
+ operationUrl = baseURL.replace(/\/$/, "") + "/metrics";
209
382
  client = this.sdkConfiguration.defaultClient;
210
383
  globalSecurity = this.sdkConfiguration.security;
211
384
  if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
@@ -222,26 +395,26 @@ var HoneyHive = /** @class */ (function () {
222
395
  queryParams = utils.serializeQueryParams(req);
223
396
  headers["Accept"] = "application/json";
224
397
  headers["user-agent"] = this.sdkConfiguration.userAgent;
225
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url + queryParams, method: "delete", headers: headers, responseType: "arraybuffer" }, config))];
398
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl + queryParams, method: "delete", headers: headers, responseType: "arraybuffer" }, config))];
226
399
  case 3:
227
400
  httpRes = _c.sent();
228
- contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
401
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
229
402
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
230
403
  throw new Error("status code not found in response: ".concat(httpRes));
231
404
  }
232
405
  res = new operations.DeleteMetricsResponse({
233
406
  statusCode: httpRes.status,
234
- contentType: contentType,
407
+ contentType: responseContentType,
235
408
  rawResponse: httpRes,
236
409
  });
237
410
  decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
238
411
  switch (true) {
239
412
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
240
- if (utils.matchContentType(contentType, "application/json")) {
241
- res.deleteResponse = utils.objectToClass(JSON.parse(decodedRes), shared.DeleteResponse);
413
+ if (utils.matchContentType(responseContentType, "application/json")) {
414
+ res.metricDeleteResponse = utils.objectToClass(JSON.parse(decodedRes), shared.MetricDeleteResponse);
242
415
  }
243
416
  else {
244
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
417
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
245
418
  }
246
419
  break;
247
420
  case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
@@ -254,12 +427,12 @@ var HoneyHive = /** @class */ (function () {
254
427
  });
255
428
  };
256
429
  /**
257
- * Delete a prompt
430
+ * Delete a prompt by name
258
431
  */
259
432
  HoneyHive.prototype.deletePromptsId = function (req, config) {
260
433
  var _a, _b;
261
434
  return __awaiter(this, void 0, void 0, function () {
262
- var baseURL, url, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
435
+ var baseURL, operationUrl, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
263
436
  return __generator(this, function (_c) {
264
437
  switch (_c.label) {
265
438
  case 0:
@@ -267,7 +440,7 @@ var HoneyHive = /** @class */ (function () {
267
440
  req = new operations.DeletePromptsIdRequest(req);
268
441
  }
269
442
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
270
- url = utils.generateURL(baseURL, "/prompts/{id}", req);
443
+ operationUrl = utils.generateURL(baseURL, "/prompts/{id}", req);
271
444
  client = this.sdkConfiguration.defaultClient;
272
445
  globalSecurity = this.sdkConfiguration.security;
273
446
  if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
@@ -283,26 +456,26 @@ var HoneyHive = /** @class */ (function () {
283
456
  headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
284
457
  headers["Accept"] = "application/json";
285
458
  headers["user-agent"] = this.sdkConfiguration.userAgent;
286
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "delete", headers: headers, responseType: "arraybuffer" }, config))];
459
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "delete", headers: headers, responseType: "arraybuffer" }, config))];
287
460
  case 3:
288
461
  httpRes = _c.sent();
289
- contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
462
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
290
463
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
291
464
  throw new Error("status code not found in response: ".concat(httpRes));
292
465
  }
293
466
  res = new operations.DeletePromptsIdResponse({
294
467
  statusCode: httpRes.status,
295
- contentType: contentType,
468
+ contentType: responseContentType,
296
469
  rawResponse: httpRes,
297
470
  });
298
471
  decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
299
472
  switch (true) {
300
473
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
301
- if (utils.matchContentType(contentType, "application/json")) {
474
+ if (utils.matchContentType(responseContentType, "application/json")) {
302
475
  res.deleteResponse = utils.objectToClass(JSON.parse(decodedRes), shared.DeleteResponse);
303
476
  }
304
477
  else {
305
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
478
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
306
479
  }
307
480
  break;
308
481
  case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
@@ -315,20 +488,20 @@ var HoneyHive = /** @class */ (function () {
315
488
  });
316
489
  };
317
490
  /**
318
- * Delete a task
491
+ * Delete a session
319
492
  */
320
- HoneyHive.prototype.deleteTasks = function (req, config) {
493
+ HoneyHive.prototype.deleteSessionSessionId = function (req, config) {
321
494
  var _a, _b;
322
495
  return __awaiter(this, void 0, void 0, function () {
323
- var baseURL, url, client, globalSecurity, properties, headers, queryParams, httpRes, contentType, res, decodedRes;
496
+ var baseURL, operationUrl, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
324
497
  return __generator(this, function (_c) {
325
498
  switch (_c.label) {
326
499
  case 0:
327
500
  if (!(req instanceof utils.SpeakeasyBase)) {
328
- req = new operations.DeleteTasksRequest(req);
501
+ req = new operations.DeleteSessionSessionIdRequest(req);
329
502
  }
330
503
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
331
- url = baseURL.replace(/\/$/, "") + "/tasks";
504
+ operationUrl = utils.generateURL(baseURL, "/session/{session_id}", req);
332
505
  client = this.sdkConfiguration.defaultClient;
333
506
  globalSecurity = this.sdkConfiguration.security;
334
507
  if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
@@ -342,29 +515,28 @@ var HoneyHive = /** @class */ (function () {
342
515
  }
343
516
  properties = utils.parseSecurityProperties(globalSecurity);
344
517
  headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
345
- queryParams = utils.serializeQueryParams(req);
346
518
  headers["Accept"] = "application/json";
347
519
  headers["user-agent"] = this.sdkConfiguration.userAgent;
348
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url + queryParams, method: "delete", headers: headers, responseType: "arraybuffer" }, config))];
520
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "delete", headers: headers, responseType: "arraybuffer" }, config))];
349
521
  case 3:
350
522
  httpRes = _c.sent();
351
- contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
523
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
352
524
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
353
525
  throw new Error("status code not found in response: ".concat(httpRes));
354
526
  }
355
- res = new operations.DeleteTasksResponse({
527
+ res = new operations.DeleteSessionSessionIdResponse({
356
528
  statusCode: httpRes.status,
357
- contentType: contentType,
529
+ contentType: responseContentType,
358
530
  rawResponse: httpRes,
359
531
  });
360
532
  decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
361
533
  switch (true) {
362
534
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
363
- if (utils.matchContentType(contentType, "application/json")) {
364
- res.deleteResponse = utils.objectToClass(JSON.parse(decodedRes), shared.DeleteResponse);
535
+ if (utils.matchContentType(responseContentType, "application/json")) {
536
+ res.successResponse = utils.objectToClass(JSON.parse(decodedRes), shared.SuccessResponse);
365
537
  }
366
538
  else {
367
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
539
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
368
540
  }
369
541
  break;
370
542
  case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
@@ -377,20 +549,20 @@ var HoneyHive = /** @class */ (function () {
377
549
  });
378
550
  };
379
551
  /**
380
- * Get datasets
552
+ * Delete a task
381
553
  */
382
- HoneyHive.prototype.getDatasets = function (req, config) {
554
+ HoneyHive.prototype.deleteTasks = function (req, config) {
383
555
  var _a, _b;
384
556
  return __awaiter(this, void 0, void 0, function () {
385
- var baseURL, url, client, globalSecurity, properties, headers, queryParams, httpRes, contentType, res, decodedRes, resFieldDepth;
557
+ var baseURL, operationUrl, client, globalSecurity, properties, headers, queryParams, httpRes, responseContentType, res, decodedRes;
386
558
  return __generator(this, function (_c) {
387
559
  switch (_c.label) {
388
560
  case 0:
389
561
  if (!(req instanceof utils.SpeakeasyBase)) {
390
- req = new operations.GetDatasetsRequest(req);
562
+ req = new operations.DeleteTasksRequest(req);
391
563
  }
392
564
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
393
- url = baseURL.replace(/\/$/, "") + "/datasets";
565
+ operationUrl = baseURL.replace(/\/$/, "") + "/tasks";
394
566
  client = this.sdkConfiguration.defaultClient;
395
567
  globalSecurity = this.sdkConfiguration.security;
396
568
  if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
@@ -407,28 +579,26 @@ var HoneyHive = /** @class */ (function () {
407
579
  queryParams = utils.serializeQueryParams(req);
408
580
  headers["Accept"] = "application/json";
409
581
  headers["user-agent"] = this.sdkConfiguration.userAgent;
410
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
582
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl + queryParams, method: "delete", headers: headers, responseType: "arraybuffer" }, config))];
411
583
  case 3:
412
584
  httpRes = _c.sent();
413
- contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
585
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
414
586
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
415
587
  throw new Error("status code not found in response: ".concat(httpRes));
416
588
  }
417
- res = new operations.GetDatasetsResponse({
589
+ res = new operations.DeleteTasksResponse({
418
590
  statusCode: httpRes.status,
419
- contentType: contentType,
591
+ contentType: responseContentType,
420
592
  rawResponse: httpRes,
421
593
  });
422
594
  decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
423
595
  switch (true) {
424
596
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
425
- if (utils.matchContentType(contentType, "application/json")) {
426
- res.classes = [];
427
- resFieldDepth = utils.getResFieldDepth(res);
428
- res.classes = utils.objectToClass(JSON.parse(decodedRes), shared.DatasetResponse, resFieldDepth);
597
+ if (utils.matchContentType(responseContentType, "application/json")) {
598
+ res.deleteResponse = utils.objectToClass(JSON.parse(decodedRes), shared.DeleteResponse);
429
599
  }
430
600
  else {
431
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
601
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
432
602
  }
433
603
  break;
434
604
  case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
@@ -441,20 +611,20 @@ var HoneyHive = /** @class */ (function () {
441
611
  });
442
612
  };
443
613
  /**
444
- * Get all fine-tuned models
614
+ * Get datasets
445
615
  */
446
- HoneyHive.prototype.getFineTunedModels = function (req, config) {
616
+ HoneyHive.prototype.getDatasets = function (req, config) {
447
617
  var _a, _b;
448
618
  return __awaiter(this, void 0, void 0, function () {
449
- var baseURL, url, client, globalSecurity, properties, headers, queryParams, httpRes, contentType, res, decodedRes, resFieldDepth;
619
+ var baseURL, operationUrl, client, globalSecurity, properties, headers, queryParams, httpRes, responseContentType, res, decodedRes, resFieldDepth;
450
620
  return __generator(this, function (_c) {
451
621
  switch (_c.label) {
452
622
  case 0:
453
623
  if (!(req instanceof utils.SpeakeasyBase)) {
454
- req = new operations.GetFineTunedModelsRequest(req);
624
+ req = new operations.GetDatasetsRequest(req);
455
625
  }
456
626
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
457
- url = baseURL.replace(/\/$/, "") + "/fine_tuned_models";
627
+ operationUrl = baseURL.replace(/\/$/, "") + "/datasets";
458
628
  client = this.sdkConfiguration.defaultClient;
459
629
  globalSecurity = this.sdkConfiguration.security;
460
630
  if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
@@ -471,28 +641,28 @@ var HoneyHive = /** @class */ (function () {
471
641
  queryParams = utils.serializeQueryParams(req);
472
642
  headers["Accept"] = "application/json";
473
643
  headers["user-agent"] = this.sdkConfiguration.userAgent;
474
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
644
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
475
645
  case 3:
476
646
  httpRes = _c.sent();
477
- contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
647
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
478
648
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
479
649
  throw new Error("status code not found in response: ".concat(httpRes));
480
650
  }
481
- res = new operations.GetFineTunedModelsResponse({
651
+ res = new operations.GetDatasetsResponse({
482
652
  statusCode: httpRes.status,
483
- contentType: contentType,
653
+ contentType: responseContentType,
484
654
  rawResponse: httpRes,
485
655
  });
486
656
  decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
487
657
  switch (true) {
488
658
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
489
- if (utils.matchContentType(contentType, "application/json")) {
659
+ if (utils.matchContentType(responseContentType, "application/json")) {
490
660
  res.classes = [];
491
661
  resFieldDepth = utils.getResFieldDepth(res);
492
- res.classes = utils.objectToClass(JSON.parse(decodedRes), shared.FineTunedModelResponse, resFieldDepth);
662
+ res.classes = utils.objectToClass(JSON.parse(decodedRes), shared.DatasetResponse, resFieldDepth);
493
663
  }
494
664
  else {
495
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
665
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
496
666
  }
497
667
  break;
498
668
  case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
@@ -505,20 +675,17 @@ var HoneyHive = /** @class */ (function () {
505
675
  });
506
676
  };
507
677
  /**
508
- * Get a fine-tuned model
678
+ * Get all evaluations
509
679
  */
510
- HoneyHive.prototype.getFineTunedModelsId = function (req, config) {
680
+ HoneyHive.prototype.getEvaluations = function (config) {
511
681
  var _a, _b;
512
682
  return __awaiter(this, void 0, void 0, function () {
513
- var baseURL, url, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
683
+ var baseURL, operationUrl, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes, resFieldDepth;
514
684
  return __generator(this, function (_c) {
515
685
  switch (_c.label) {
516
686
  case 0:
517
- if (!(req instanceof utils.SpeakeasyBase)) {
518
- req = new operations.GetFineTunedModelsIdRequest(req);
519
- }
520
687
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
521
- url = utils.generateURL(baseURL, "/fine_tuned_models/{id}", req);
688
+ operationUrl = baseURL.replace(/\/$/, "") + "/evaluations";
522
689
  client = this.sdkConfiguration.defaultClient;
523
690
  globalSecurity = this.sdkConfiguration.security;
524
691
  if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
@@ -534,26 +701,28 @@ var HoneyHive = /** @class */ (function () {
534
701
  headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
535
702
  headers["Accept"] = "application/json";
536
703
  headers["user-agent"] = this.sdkConfiguration.userAgent;
537
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
704
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
538
705
  case 3:
539
706
  httpRes = _c.sent();
540
- contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
707
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
541
708
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
542
709
  throw new Error("status code not found in response: ".concat(httpRes));
543
710
  }
544
- res = new operations.GetFineTunedModelsIdResponse({
711
+ res = new operations.GetEvaluationsResponse({
545
712
  statusCode: httpRes.status,
546
- contentType: contentType,
713
+ contentType: responseContentType,
547
714
  rawResponse: httpRes,
548
715
  });
549
716
  decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
550
717
  switch (true) {
551
718
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
552
- if (utils.matchContentType(contentType, "application/json")) {
553
- res.fineTunedModelResponse = utils.objectToClass(JSON.parse(decodedRes), shared.FineTunedModelResponse);
719
+ if (utils.matchContentType(responseContentType, "application/json")) {
720
+ res.classes = [];
721
+ resFieldDepth = utils.getResFieldDepth(res);
722
+ res.classes = utils.objectToClass(JSON.parse(decodedRes), shared.Evaluation, resFieldDepth);
554
723
  }
555
724
  else {
556
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
725
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
557
726
  }
558
727
  break;
559
728
  case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
@@ -566,20 +735,20 @@ var HoneyHive = /** @class */ (function () {
566
735
  });
567
736
  };
568
737
  /**
569
- * Get all generations
738
+ * Get an evaluation
570
739
  */
571
- HoneyHive.prototype.getGenerations = function (req, config) {
740
+ HoneyHive.prototype.getEvaluationsId = function (req, config) {
572
741
  var _a, _b;
573
742
  return __awaiter(this, void 0, void 0, function () {
574
- var baseURL, url, client, globalSecurity, properties, headers, queryParams, httpRes, contentType, res, decodedRes, resFieldDepth;
743
+ var baseURL, operationUrl, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
575
744
  return __generator(this, function (_c) {
576
745
  switch (_c.label) {
577
746
  case 0:
578
747
  if (!(req instanceof utils.SpeakeasyBase)) {
579
- req = new operations.GetGenerationsRequest(req);
748
+ req = new operations.GetEvaluationsIdRequest(req);
580
749
  }
581
750
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
582
- url = baseURL.replace(/\/$/, "") + "/generations";
751
+ operationUrl = utils.generateURL(baseURL, "/evaluations/{id}", req);
583
752
  client = this.sdkConfiguration.defaultClient;
584
753
  globalSecurity = this.sdkConfiguration.security;
585
754
  if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
@@ -593,31 +762,28 @@ var HoneyHive = /** @class */ (function () {
593
762
  }
594
763
  properties = utils.parseSecurityProperties(globalSecurity);
595
764
  headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
596
- queryParams = utils.serializeQueryParams(req);
597
765
  headers["Accept"] = "application/json";
598
766
  headers["user-agent"] = this.sdkConfiguration.userAgent;
599
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
767
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
600
768
  case 3:
601
769
  httpRes = _c.sent();
602
- contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
770
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
603
771
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
604
772
  throw new Error("status code not found in response: ".concat(httpRes));
605
773
  }
606
- res = new operations.GetGenerationsResponse({
774
+ res = new operations.GetEvaluationsIdResponse({
607
775
  statusCode: httpRes.status,
608
- contentType: contentType,
776
+ contentType: responseContentType,
609
777
  rawResponse: httpRes,
610
778
  });
611
779
  decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
612
780
  switch (true) {
613
781
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
614
- if (utils.matchContentType(contentType, "application/json")) {
615
- res.classes = [];
616
- resFieldDepth = utils.getResFieldDepth(res);
617
- res.classes = utils.objectToClass(JSON.parse(decodedRes), shared.Generation, resFieldDepth);
782
+ if (utils.matchContentType(responseContentType, "application/json")) {
783
+ res.evaluation = utils.objectToClass(JSON.parse(decodedRes), shared.Evaluation);
618
784
  }
619
785
  else {
620
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
786
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
621
787
  }
622
788
  break;
623
789
  case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
@@ -630,20 +796,20 @@ var HoneyHive = /** @class */ (function () {
630
796
  });
631
797
  };
632
798
  /**
633
- * Get all metrics
799
+ * Get all fine-tuned models
634
800
  */
635
- HoneyHive.prototype.getMetrics = function (req, config) {
801
+ HoneyHive.prototype.getFineTunedModels = function (req, config) {
636
802
  var _a, _b;
637
803
  return __awaiter(this, void 0, void 0, function () {
638
- var baseURL, url, client, globalSecurity, properties, headers, queryParams, httpRes, contentType, res, decodedRes, resFieldDepth;
804
+ var baseURL, operationUrl, client, globalSecurity, properties, headers, queryParams, httpRes, responseContentType, res, decodedRes, resFieldDepth;
639
805
  return __generator(this, function (_c) {
640
806
  switch (_c.label) {
641
807
  case 0:
642
808
  if (!(req instanceof utils.SpeakeasyBase)) {
643
- req = new operations.GetMetricsRequest(req);
809
+ req = new operations.GetFineTunedModelsRequest(req);
644
810
  }
645
811
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
646
- url = baseURL.replace(/\/$/, "") + "/metrics";
812
+ operationUrl = baseURL.replace(/\/$/, "") + "/fine_tuned_models";
647
813
  client = this.sdkConfiguration.defaultClient;
648
814
  globalSecurity = this.sdkConfiguration.security;
649
815
  if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
@@ -660,28 +826,28 @@ var HoneyHive = /** @class */ (function () {
660
826
  queryParams = utils.serializeQueryParams(req);
661
827
  headers["Accept"] = "application/json";
662
828
  headers["user-agent"] = this.sdkConfiguration.userAgent;
663
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
829
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
664
830
  case 3:
665
831
  httpRes = _c.sent();
666
- contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
832
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
667
833
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
668
834
  throw new Error("status code not found in response: ".concat(httpRes));
669
835
  }
670
- res = new operations.GetMetricsResponse({
836
+ res = new operations.GetFineTunedModelsResponse({
671
837
  statusCode: httpRes.status,
672
- contentType: contentType,
838
+ contentType: responseContentType,
673
839
  rawResponse: httpRes,
674
840
  });
675
841
  decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
676
842
  switch (true) {
677
843
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
678
- if (utils.matchContentType(contentType, "application/json")) {
844
+ if (utils.matchContentType(responseContentType, "application/json")) {
679
845
  res.classes = [];
680
846
  resFieldDepth = utils.getResFieldDepth(res);
681
- res.classes = utils.objectToClass(JSON.parse(decodedRes), shared.MetricResponse, resFieldDepth);
847
+ res.classes = utils.objectToClass(JSON.parse(decodedRes), shared.FineTunedModelResponse, resFieldDepth);
682
848
  }
683
849
  else {
684
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
850
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
685
851
  }
686
852
  break;
687
853
  case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
@@ -694,20 +860,20 @@ var HoneyHive = /** @class */ (function () {
694
860
  });
695
861
  };
696
862
  /**
697
- * Get all prompts
863
+ * Get a fine-tuned model
698
864
  */
699
- HoneyHive.prototype.getPrompts = function (req, config) {
865
+ HoneyHive.prototype.getFineTunedModelsId = function (req, config) {
700
866
  var _a, _b;
701
867
  return __awaiter(this, void 0, void 0, function () {
702
- var baseURL, url, client, globalSecurity, properties, headers, queryParams, httpRes, contentType, res, decodedRes, resFieldDepth;
868
+ var baseURL, operationUrl, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
703
869
  return __generator(this, function (_c) {
704
870
  switch (_c.label) {
705
871
  case 0:
706
872
  if (!(req instanceof utils.SpeakeasyBase)) {
707
- req = new operations.GetPromptsRequest(req);
873
+ req = new operations.GetFineTunedModelsIdRequest(req);
708
874
  }
709
875
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
710
- url = baseURL.replace(/\/$/, "") + "/prompts";
876
+ operationUrl = utils.generateURL(baseURL, "/fine_tuned_models/{id}", req);
711
877
  client = this.sdkConfiguration.defaultClient;
712
878
  globalSecurity = this.sdkConfiguration.security;
713
879
  if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
@@ -721,31 +887,28 @@ var HoneyHive = /** @class */ (function () {
721
887
  }
722
888
  properties = utils.parseSecurityProperties(globalSecurity);
723
889
  headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
724
- queryParams = utils.serializeQueryParams(req);
725
890
  headers["Accept"] = "application/json";
726
891
  headers["user-agent"] = this.sdkConfiguration.userAgent;
727
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
892
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
728
893
  case 3:
729
894
  httpRes = _c.sent();
730
- contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
895
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
731
896
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
732
897
  throw new Error("status code not found in response: ".concat(httpRes));
733
898
  }
734
- res = new operations.GetPromptsResponse({
899
+ res = new operations.GetFineTunedModelsIdResponse({
735
900
  statusCode: httpRes.status,
736
- contentType: contentType,
901
+ contentType: responseContentType,
737
902
  rawResponse: httpRes,
738
903
  });
739
904
  decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
740
905
  switch (true) {
741
906
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
742
- if (utils.matchContentType(contentType, "application/json")) {
743
- res.classes = [];
744
- resFieldDepth = utils.getResFieldDepth(res);
745
- res.classes = utils.objectToClass(JSON.parse(decodedRes), shared.PromptResponse, resFieldDepth);
907
+ if (utils.matchContentType(responseContentType, "application/json")) {
908
+ res.fineTunedModelResponse = utils.objectToClass(JSON.parse(decodedRes), shared.FineTunedModelResponse);
746
909
  }
747
910
  else {
748
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
911
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
749
912
  }
750
913
  break;
751
914
  case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
@@ -758,20 +921,20 @@ var HoneyHive = /** @class */ (function () {
758
921
  });
759
922
  };
760
923
  /**
761
- * Get all sessions
924
+ * Get all generations
762
925
  */
763
- HoneyHive.prototype.getSession = function (req, config) {
926
+ HoneyHive.prototype.getGenerations = function (req, config) {
764
927
  var _a, _b;
765
928
  return __awaiter(this, void 0, void 0, function () {
766
- var baseURL, url, client, globalSecurity, properties, headers, queryParams, httpRes, contentType, res, decodedRes, resFieldDepth;
929
+ var baseURL, operationUrl, client, globalSecurity, properties, headers, queryParams, httpRes, responseContentType, res, decodedRes, resFieldDepth;
767
930
  return __generator(this, function (_c) {
768
931
  switch (_c.label) {
769
932
  case 0:
770
933
  if (!(req instanceof utils.SpeakeasyBase)) {
771
- req = new operations.GetSessionRequest(req);
934
+ req = new operations.GetGenerationsRequest(req);
772
935
  }
773
936
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
774
- url = baseURL.replace(/\/$/, "") + "/session";
937
+ operationUrl = baseURL.replace(/\/$/, "") + "/generations";
775
938
  client = this.sdkConfiguration.defaultClient;
776
939
  globalSecurity = this.sdkConfiguration.security;
777
940
  if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
@@ -788,28 +951,28 @@ var HoneyHive = /** @class */ (function () {
788
951
  queryParams = utils.serializeQueryParams(req);
789
952
  headers["Accept"] = "application/json";
790
953
  headers["user-agent"] = this.sdkConfiguration.userAgent;
791
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
954
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
792
955
  case 3:
793
956
  httpRes = _c.sent();
794
- contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
957
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
795
958
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
796
959
  throw new Error("status code not found in response: ".concat(httpRes));
797
960
  }
798
- res = new operations.GetSessionResponse({
961
+ res = new operations.GetGenerationsResponse({
799
962
  statusCode: httpRes.status,
800
- contentType: contentType,
963
+ contentType: responseContentType,
801
964
  rawResponse: httpRes,
802
965
  });
803
966
  decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
804
967
  switch (true) {
805
968
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
806
- if (utils.matchContentType(contentType, "application/json")) {
969
+ if (utils.matchContentType(responseContentType, "application/json")) {
807
970
  res.classes = [];
808
971
  resFieldDepth = utils.getResFieldDepth(res);
809
- res.classes = utils.objectToClass(JSON.parse(decodedRes), shared.SessionEventQuery, resFieldDepth);
972
+ res.classes = utils.objectToClass(JSON.parse(decodedRes), shared.Generation, resFieldDepth);
810
973
  }
811
974
  else {
812
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
975
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
813
976
  }
814
977
  break;
815
978
  case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
@@ -822,20 +985,20 @@ var HoneyHive = /** @class */ (function () {
822
985
  });
823
986
  };
824
987
  /**
825
- * Get a session
988
+ * Get all metrics
826
989
  */
827
- HoneyHive.prototype.getSessionSessionId = function (req, config) {
990
+ HoneyHive.prototype.getMetrics = function (req, config) {
828
991
  var _a, _b;
829
992
  return __awaiter(this, void 0, void 0, function () {
830
- var baseURL, url, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
993
+ var baseURL, operationUrl, client, globalSecurity, properties, headers, queryParams, httpRes, responseContentType, res, decodedRes, resFieldDepth;
831
994
  return __generator(this, function (_c) {
832
995
  switch (_c.label) {
833
996
  case 0:
834
997
  if (!(req instanceof utils.SpeakeasyBase)) {
835
- req = new operations.GetSessionSessionIdRequest(req);
998
+ req = new operations.GetMetricsRequest(req);
836
999
  }
837
1000
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
838
- url = utils.generateURL(baseURL, "/session/{session_id}", req);
1001
+ operationUrl = baseURL.replace(/\/$/, "") + "/metrics";
839
1002
  client = this.sdkConfiguration.defaultClient;
840
1003
  globalSecurity = this.sdkConfiguration.security;
841
1004
  if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
@@ -849,28 +1012,31 @@ var HoneyHive = /** @class */ (function () {
849
1012
  }
850
1013
  properties = utils.parseSecurityProperties(globalSecurity);
851
1014
  headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
1015
+ queryParams = utils.serializeQueryParams(req);
852
1016
  headers["Accept"] = "application/json";
853
1017
  headers["user-agent"] = this.sdkConfiguration.userAgent;
854
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
1018
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
855
1019
  case 3:
856
1020
  httpRes = _c.sent();
857
- contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
1021
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
858
1022
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
859
1023
  throw new Error("status code not found in response: ".concat(httpRes));
860
1024
  }
861
- res = new operations.GetSessionSessionIdResponse({
1025
+ res = new operations.GetMetricsResponse({
862
1026
  statusCode: httpRes.status,
863
- contentType: contentType,
1027
+ contentType: responseContentType,
864
1028
  rawResponse: httpRes,
865
1029
  });
866
1030
  decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
867
1031
  switch (true) {
868
1032
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
869
- if (utils.matchContentType(contentType, "application/json")) {
870
- res.sessionEventQuery = utils.objectToClass(JSON.parse(decodedRes), shared.SessionEventQuery);
1033
+ if (utils.matchContentType(responseContentType, "application/json")) {
1034
+ res.classes = [];
1035
+ resFieldDepth = utils.getResFieldDepth(res);
1036
+ res.classes = utils.objectToClass(JSON.parse(decodedRes), shared.Metric, resFieldDepth);
871
1037
  }
872
1038
  else {
873
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1039
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
874
1040
  }
875
1041
  break;
876
1042
  case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
@@ -883,57 +1049,744 @@ var HoneyHive = /** @class */ (function () {
883
1049
  });
884
1050
  };
885
1051
  /**
886
- * Get a session in Trace Event format
1052
+ * Get all prompts or filter by task and name
887
1053
  */
888
- HoneyHive.prototype.getSessionSessionIdExport = function (req, config) {
1054
+ HoneyHive.prototype.getPrompts = function (req, config) {
889
1055
  var _a, _b;
890
1056
  return __awaiter(this, void 0, void 0, function () {
891
- var baseURL, url, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes, resFieldDepth;
1057
+ var baseURL, operationUrl, client, globalSecurity, properties, headers, queryParams, httpRes, responseContentType, res, decodedRes, resFieldDepth;
892
1058
  return __generator(this, function (_c) {
893
1059
  switch (_c.label) {
894
1060
  case 0:
895
1061
  if (!(req instanceof utils.SpeakeasyBase)) {
896
- req = new operations.GetSessionSessionIdExportRequest(req);
1062
+ req = new operations.GetPromptsRequest(req);
1063
+ }
1064
+ baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
1065
+ operationUrl = baseURL.replace(/\/$/, "") + "/prompts";
1066
+ client = this.sdkConfiguration.defaultClient;
1067
+ globalSecurity = this.sdkConfiguration.security;
1068
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
1069
+ return [4 /*yield*/, globalSecurity()];
1070
+ case 1:
1071
+ globalSecurity = _c.sent();
1072
+ _c.label = 2;
1073
+ case 2:
1074
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
1075
+ globalSecurity = new shared.Security(globalSecurity);
1076
+ }
1077
+ properties = utils.parseSecurityProperties(globalSecurity);
1078
+ headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
1079
+ queryParams = utils.serializeQueryParams(req);
1080
+ headers["Accept"] = "application/json";
1081
+ headers["user-agent"] = this.sdkConfiguration.userAgent;
1082
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
1083
+ case 3:
1084
+ httpRes = _c.sent();
1085
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
1086
+ if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
1087
+ throw new Error("status code not found in response: ".concat(httpRes));
1088
+ }
1089
+ res = new operations.GetPromptsResponse({
1090
+ statusCode: httpRes.status,
1091
+ contentType: responseContentType,
1092
+ rawResponse: httpRes,
1093
+ });
1094
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
1095
+ switch (true) {
1096
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
1097
+ if (utils.matchContentType(responseContentType, "application/json")) {
1098
+ res.classes = [];
1099
+ resFieldDepth = utils.getResFieldDepth(res);
1100
+ res.classes = utils.objectToClass(JSON.parse(decodedRes), shared.PromptResponse, resFieldDepth);
1101
+ }
1102
+ else {
1103
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
1104
+ }
1105
+ break;
1106
+ case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
1107
+ ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
1108
+ throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
1109
+ }
1110
+ return [2 /*return*/, res];
1111
+ }
1112
+ });
1113
+ });
1114
+ };
1115
+ /**
1116
+ * Get all sessions
1117
+ */
1118
+ HoneyHive.prototype.getSession = function (req, config) {
1119
+ var _a, _b;
1120
+ return __awaiter(this, void 0, void 0, function () {
1121
+ var baseURL, operationUrl, client, globalSecurity, properties, headers, queryParams, httpRes, responseContentType, res, decodedRes, resFieldDepth;
1122
+ return __generator(this, function (_c) {
1123
+ switch (_c.label) {
1124
+ case 0:
1125
+ if (!(req instanceof utils.SpeakeasyBase)) {
1126
+ req = new operations.GetSessionRequest(req);
1127
+ }
1128
+ baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
1129
+ operationUrl = baseURL.replace(/\/$/, "") + "/session";
1130
+ client = this.sdkConfiguration.defaultClient;
1131
+ globalSecurity = this.sdkConfiguration.security;
1132
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
1133
+ return [4 /*yield*/, globalSecurity()];
1134
+ case 1:
1135
+ globalSecurity = _c.sent();
1136
+ _c.label = 2;
1137
+ case 2:
1138
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
1139
+ globalSecurity = new shared.Security(globalSecurity);
1140
+ }
1141
+ properties = utils.parseSecurityProperties(globalSecurity);
1142
+ headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
1143
+ queryParams = utils.serializeQueryParams(req);
1144
+ headers["Accept"] = "application/json";
1145
+ headers["user-agent"] = this.sdkConfiguration.userAgent;
1146
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
1147
+ case 3:
1148
+ httpRes = _c.sent();
1149
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
1150
+ if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
1151
+ throw new Error("status code not found in response: ".concat(httpRes));
1152
+ }
1153
+ res = new operations.GetSessionResponse({
1154
+ statusCode: httpRes.status,
1155
+ contentType: responseContentType,
1156
+ rawResponse: httpRes,
1157
+ });
1158
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
1159
+ switch (true) {
1160
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
1161
+ if (utils.matchContentType(responseContentType, "application/json")) {
1162
+ res.classes = [];
1163
+ resFieldDepth = utils.getResFieldDepth(res);
1164
+ res.classes = utils.objectToClass(JSON.parse(decodedRes), shared.SessionEventQuery, resFieldDepth);
1165
+ }
1166
+ else {
1167
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
1168
+ }
1169
+ break;
1170
+ case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
1171
+ ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
1172
+ throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
1173
+ }
1174
+ return [2 /*return*/, res];
1175
+ }
1176
+ });
1177
+ });
1178
+ };
1179
+ /**
1180
+ * Get a session
1181
+ */
1182
+ HoneyHive.prototype.getSessionSessionId = function (req, config) {
1183
+ var _a, _b;
1184
+ return __awaiter(this, void 0, void 0, function () {
1185
+ var baseURL, operationUrl, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
1186
+ return __generator(this, function (_c) {
1187
+ switch (_c.label) {
1188
+ case 0:
1189
+ if (!(req instanceof utils.SpeakeasyBase)) {
1190
+ req = new operations.GetSessionSessionIdRequest(req);
1191
+ }
1192
+ baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
1193
+ operationUrl = utils.generateURL(baseURL, "/session/{session_id}", req);
1194
+ client = this.sdkConfiguration.defaultClient;
1195
+ globalSecurity = this.sdkConfiguration.security;
1196
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
1197
+ return [4 /*yield*/, globalSecurity()];
1198
+ case 1:
1199
+ globalSecurity = _c.sent();
1200
+ _c.label = 2;
1201
+ case 2:
1202
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
1203
+ globalSecurity = new shared.Security(globalSecurity);
1204
+ }
1205
+ properties = utils.parseSecurityProperties(globalSecurity);
1206
+ headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
1207
+ headers["Accept"] = "application/json";
1208
+ headers["user-agent"] = this.sdkConfiguration.userAgent;
1209
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
1210
+ case 3:
1211
+ httpRes = _c.sent();
1212
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
1213
+ if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
1214
+ throw new Error("status code not found in response: ".concat(httpRes));
1215
+ }
1216
+ res = new operations.GetSessionSessionIdResponse({
1217
+ statusCode: httpRes.status,
1218
+ contentType: responseContentType,
1219
+ rawResponse: httpRes,
1220
+ });
1221
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
1222
+ switch (true) {
1223
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
1224
+ if (utils.matchContentType(responseContentType, "application/json")) {
1225
+ res.sessionEventQuery = utils.objectToClass(JSON.parse(decodedRes), shared.SessionEventQuery);
1226
+ }
1227
+ else {
1228
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
1229
+ }
1230
+ break;
1231
+ case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
1232
+ ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
1233
+ throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
1234
+ }
1235
+ return [2 /*return*/, res];
1236
+ }
1237
+ });
1238
+ });
1239
+ };
1240
+ /**
1241
+ * Get a session in Trace Event format
1242
+ */
1243
+ HoneyHive.prototype.getSessionSessionIdExport = function (req, config) {
1244
+ var _a, _b;
1245
+ return __awaiter(this, void 0, void 0, function () {
1246
+ var baseURL, operationUrl, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes, resFieldDepth;
1247
+ return __generator(this, function (_c) {
1248
+ switch (_c.label) {
1249
+ case 0:
1250
+ if (!(req instanceof utils.SpeakeasyBase)) {
1251
+ req = new operations.GetSessionSessionIdExportRequest(req);
1252
+ }
1253
+ baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
1254
+ operationUrl = utils.generateURL(baseURL, "/session/{session_id}/export", req);
1255
+ client = this.sdkConfiguration.defaultClient;
1256
+ globalSecurity = this.sdkConfiguration.security;
1257
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
1258
+ return [4 /*yield*/, globalSecurity()];
1259
+ case 1:
1260
+ globalSecurity = _c.sent();
1261
+ _c.label = 2;
1262
+ case 2:
1263
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
1264
+ globalSecurity = new shared.Security(globalSecurity);
1265
+ }
1266
+ properties = utils.parseSecurityProperties(globalSecurity);
1267
+ headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
1268
+ headers["Accept"] = "application/json";
1269
+ headers["user-agent"] = this.sdkConfiguration.userAgent;
1270
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
1271
+ case 3:
1272
+ httpRes = _c.sent();
1273
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
1274
+ if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
1275
+ throw new Error("status code not found in response: ".concat(httpRes));
1276
+ }
1277
+ res = new operations.GetSessionSessionIdExportResponse({
1278
+ statusCode: httpRes.status,
1279
+ contentType: responseContentType,
1280
+ rawResponse: httpRes,
1281
+ });
1282
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
1283
+ switch (true) {
1284
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
1285
+ if (utils.matchContentType(responseContentType, "application/json")) {
1286
+ res.traceEventTrace = [];
1287
+ resFieldDepth = utils.getResFieldDepth(res);
1288
+ res.traceEventTrace = utils.objectToClass(JSON.parse(decodedRes), shared.TraceEvent, resFieldDepth);
1289
+ }
1290
+ else {
1291
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
1292
+ }
1293
+ break;
1294
+ case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
1295
+ ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
1296
+ throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
1297
+ }
1298
+ return [2 /*return*/, res];
1299
+ }
1300
+ });
1301
+ });
1302
+ };
1303
+ /**
1304
+ * Get all tasks
1305
+ */
1306
+ HoneyHive.prototype.getTasks = function (req, config) {
1307
+ var _a, _b;
1308
+ return __awaiter(this, void 0, void 0, function () {
1309
+ var baseURL, operationUrl, client, globalSecurity, properties, headers, queryParams, httpRes, responseContentType, res, decodedRes, resFieldDepth;
1310
+ return __generator(this, function (_c) {
1311
+ switch (_c.label) {
1312
+ case 0:
1313
+ if (!(req instanceof utils.SpeakeasyBase)) {
1314
+ req = new operations.GetTasksRequest(req);
1315
+ }
1316
+ baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
1317
+ operationUrl = baseURL.replace(/\/$/, "") + "/tasks";
1318
+ client = this.sdkConfiguration.defaultClient;
1319
+ globalSecurity = this.sdkConfiguration.security;
1320
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
1321
+ return [4 /*yield*/, globalSecurity()];
1322
+ case 1:
1323
+ globalSecurity = _c.sent();
1324
+ _c.label = 2;
1325
+ case 2:
1326
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
1327
+ globalSecurity = new shared.Security(globalSecurity);
1328
+ }
1329
+ properties = utils.parseSecurityProperties(globalSecurity);
1330
+ headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
1331
+ queryParams = utils.serializeQueryParams(req);
1332
+ headers["Accept"] = "application/json";
1333
+ headers["user-agent"] = this.sdkConfiguration.userAgent;
1334
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
1335
+ case 3:
1336
+ httpRes = _c.sent();
1337
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
1338
+ if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
1339
+ throw new Error("status code not found in response: ".concat(httpRes));
1340
+ }
1341
+ res = new operations.GetTasksResponse({
1342
+ statusCode: httpRes.status,
1343
+ contentType: responseContentType,
1344
+ rawResponse: httpRes,
1345
+ });
1346
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
1347
+ switch (true) {
1348
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
1349
+ if (utils.matchContentType(responseContentType, "application/json")) {
1350
+ res.classes = [];
1351
+ resFieldDepth = utils.getResFieldDepth(res);
1352
+ res.classes = utils.objectToClass(JSON.parse(decodedRes), shared.TaskResponse, resFieldDepth);
1353
+ }
1354
+ else {
1355
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
1356
+ }
1357
+ break;
1358
+ case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
1359
+ ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
1360
+ throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
1361
+ }
1362
+ return [2 /*return*/, res];
1363
+ }
1364
+ });
1365
+ });
1366
+ };
1367
+ /**
1368
+ * Create a chat completion
1369
+ */
1370
+ HoneyHive.prototype.postChat = function (req, config) {
1371
+ var _a, _b;
1372
+ return __awaiter(this, void 0, void 0, function () {
1373
+ var baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
1374
+ var _d;
1375
+ return __generator(this, function (_e) {
1376
+ switch (_e.label) {
1377
+ case 0:
1378
+ if (!(req instanceof utils.SpeakeasyBase)) {
1379
+ req = new shared.ChatCompletionRequest(req);
1380
+ }
1381
+ baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
1382
+ operationUrl = baseURL.replace(/\/$/, "") + "/chat";
1383
+ _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
1384
+ try {
1385
+ _d = __read(utils.serializeRequestBody(req, "request", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
1386
+ }
1387
+ catch (e) {
1388
+ if (e instanceof Error) {
1389
+ throw new Error("Error serializing request body, cause: ".concat(e.message));
1390
+ }
1391
+ }
1392
+ client = this.sdkConfiguration.defaultClient;
1393
+ globalSecurity = this.sdkConfiguration.security;
1394
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
1395
+ return [4 /*yield*/, globalSecurity()];
1396
+ case 1:
1397
+ globalSecurity = _e.sent();
1398
+ _e.label = 2;
1399
+ case 2:
1400
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
1401
+ globalSecurity = new shared.Security(globalSecurity);
1402
+ }
1403
+ properties = utils.parseSecurityProperties(globalSecurity);
1404
+ headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
1405
+ headers["Accept"] = "application/json";
1406
+ headers["user-agent"] = this.sdkConfiguration.userAgent;
1407
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
1408
+ case 3:
1409
+ httpRes = _e.sent();
1410
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
1411
+ if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
1412
+ throw new Error("status code not found in response: ".concat(httpRes));
1413
+ }
1414
+ res = new operations.PostChatResponse({
1415
+ statusCode: httpRes.status,
1416
+ contentType: responseContentType,
1417
+ rawResponse: httpRes,
1418
+ });
1419
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
1420
+ switch (true) {
1421
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
1422
+ if (utils.matchContentType(responseContentType, "application/json")) {
1423
+ res.chatCompletionResponse = utils.objectToClass(JSON.parse(decodedRes), shared.ChatCompletionResponse);
1424
+ }
1425
+ else {
1426
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
1427
+ }
1428
+ break;
1429
+ case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
1430
+ ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
1431
+ throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
1432
+ }
1433
+ return [2 /*return*/, res];
1434
+ }
1435
+ });
1436
+ });
1437
+ };
1438
+ /**
1439
+ * Create a dataset
1440
+ */
1441
+ HoneyHive.prototype.postDatasets = function (req, config) {
1442
+ var _a, _b;
1443
+ return __awaiter(this, void 0, void 0, function () {
1444
+ var baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
1445
+ var _d;
1446
+ return __generator(this, function (_e) {
1447
+ switch (_e.label) {
1448
+ case 0:
1449
+ if (!(req instanceof utils.SpeakeasyBase)) {
1450
+ req = new shared.UploadDataset(req);
1451
+ }
1452
+ baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
1453
+ operationUrl = baseURL.replace(/\/$/, "") + "/datasets";
1454
+ _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
1455
+ try {
1456
+ _d = __read(utils.serializeRequestBody(req, "request", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
1457
+ }
1458
+ catch (e) {
1459
+ if (e instanceof Error) {
1460
+ throw new Error("Error serializing request body, cause: ".concat(e.message));
1461
+ }
1462
+ }
1463
+ client = this.sdkConfiguration.defaultClient;
1464
+ globalSecurity = this.sdkConfiguration.security;
1465
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
1466
+ return [4 /*yield*/, globalSecurity()];
1467
+ case 1:
1468
+ globalSecurity = _e.sent();
1469
+ _e.label = 2;
1470
+ case 2:
1471
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
1472
+ globalSecurity = new shared.Security(globalSecurity);
1473
+ }
1474
+ properties = utils.parseSecurityProperties(globalSecurity);
1475
+ headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
1476
+ if (reqBody == null)
1477
+ throw new Error("request body is required");
1478
+ headers["Accept"] = "application/json";
1479
+ headers["user-agent"] = this.sdkConfiguration.userAgent;
1480
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
1481
+ case 3:
1482
+ httpRes = _e.sent();
1483
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
1484
+ if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
1485
+ throw new Error("status code not found in response: ".concat(httpRes));
1486
+ }
1487
+ res = new operations.PostDatasetsResponse({
1488
+ statusCode: httpRes.status,
1489
+ contentType: responseContentType,
1490
+ rawResponse: httpRes,
1491
+ });
1492
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
1493
+ switch (true) {
1494
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
1495
+ if (utils.matchContentType(responseContentType, "application/json")) {
1496
+ res.datasetResponse = utils.objectToClass(JSON.parse(decodedRes), shared.DatasetResponse);
1497
+ }
1498
+ else {
1499
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
1500
+ }
1501
+ break;
1502
+ case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
1503
+ ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
1504
+ throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
1505
+ }
1506
+ return [2 /*return*/, res];
1507
+ }
1508
+ });
1509
+ });
1510
+ };
1511
+ /**
1512
+ * Log an evaluation
1513
+ */
1514
+ HoneyHive.prototype.postEvaluations = function (req, config) {
1515
+ var _a, _b;
1516
+ return __awaiter(this, void 0, void 0, function () {
1517
+ var baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
1518
+ var _d;
1519
+ return __generator(this, function (_e) {
1520
+ switch (_e.label) {
1521
+ case 0:
1522
+ if (!(req instanceof utils.SpeakeasyBase)) {
1523
+ req = new shared.EvaluationLoggingQuery(req);
1524
+ }
1525
+ baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
1526
+ operationUrl = baseURL.replace(/\/$/, "") + "/evaluations";
1527
+ _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
1528
+ try {
1529
+ _d = __read(utils.serializeRequestBody(req, "request", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
1530
+ }
1531
+ catch (e) {
1532
+ if (e instanceof Error) {
1533
+ throw new Error("Error serializing request body, cause: ".concat(e.message));
1534
+ }
1535
+ }
1536
+ client = this.sdkConfiguration.defaultClient;
1537
+ globalSecurity = this.sdkConfiguration.security;
1538
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
1539
+ return [4 /*yield*/, globalSecurity()];
1540
+ case 1:
1541
+ globalSecurity = _e.sent();
1542
+ _e.label = 2;
1543
+ case 2:
1544
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
1545
+ globalSecurity = new shared.Security(globalSecurity);
1546
+ }
1547
+ properties = utils.parseSecurityProperties(globalSecurity);
1548
+ headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
1549
+ if (reqBody == null)
1550
+ throw new Error("request body is required");
1551
+ headers["Accept"] = "application/json";
1552
+ headers["user-agent"] = this.sdkConfiguration.userAgent;
1553
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
1554
+ case 3:
1555
+ httpRes = _e.sent();
1556
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
1557
+ if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
1558
+ throw new Error("status code not found in response: ".concat(httpRes));
1559
+ }
1560
+ res = new operations.PostEvaluationsResponse({
1561
+ statusCode: httpRes.status,
1562
+ contentType: responseContentType,
1563
+ rawResponse: httpRes,
1564
+ });
1565
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
1566
+ switch (true) {
1567
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
1568
+ if (utils.matchContentType(responseContentType, "application/json")) {
1569
+ res.successResponse = utils.objectToClass(JSON.parse(decodedRes), shared.SuccessResponse);
1570
+ }
1571
+ else {
1572
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
1573
+ }
1574
+ break;
1575
+ case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
1576
+ ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
1577
+ throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
1578
+ }
1579
+ return [2 /*return*/, res];
1580
+ }
1581
+ });
1582
+ });
1583
+ };
1584
+ /**
1585
+ * Send feedback
1586
+ */
1587
+ HoneyHive.prototype.postFeedback = function (req, config) {
1588
+ var _a, _b;
1589
+ return __awaiter(this, void 0, void 0, function () {
1590
+ var baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
1591
+ var _d;
1592
+ return __generator(this, function (_e) {
1593
+ switch (_e.label) {
1594
+ case 0:
1595
+ if (!(req instanceof utils.SpeakeasyBase)) {
1596
+ req = new shared.FeedbackQuery(req);
1597
+ }
1598
+ baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
1599
+ operationUrl = baseURL.replace(/\/$/, "") + "/feedback";
1600
+ _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
1601
+ try {
1602
+ _d = __read(utils.serializeRequestBody(req, "request", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
1603
+ }
1604
+ catch (e) {
1605
+ if (e instanceof Error) {
1606
+ throw new Error("Error serializing request body, cause: ".concat(e.message));
1607
+ }
1608
+ }
1609
+ client = this.sdkConfiguration.defaultClient;
1610
+ globalSecurity = this.sdkConfiguration.security;
1611
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
1612
+ return [4 /*yield*/, globalSecurity()];
1613
+ case 1:
1614
+ globalSecurity = _e.sent();
1615
+ _e.label = 2;
1616
+ case 2:
1617
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
1618
+ globalSecurity = new shared.Security(globalSecurity);
1619
+ }
1620
+ properties = utils.parseSecurityProperties(globalSecurity);
1621
+ headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
1622
+ if (reqBody == null)
1623
+ throw new Error("request body is required");
1624
+ headers["Accept"] = "application/json";
1625
+ headers["user-agent"] = this.sdkConfiguration.userAgent;
1626
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
1627
+ case 3:
1628
+ httpRes = _e.sent();
1629
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
1630
+ if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
1631
+ throw new Error("status code not found in response: ".concat(httpRes));
1632
+ }
1633
+ res = new operations.PostFeedbackResponse({
1634
+ statusCode: httpRes.status,
1635
+ contentType: responseContentType,
1636
+ rawResponse: httpRes,
1637
+ });
1638
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
1639
+ switch (true) {
1640
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
1641
+ if (utils.matchContentType(responseContentType, "application/json")) {
1642
+ res.feedbackResponse = utils.objectToClass(JSON.parse(decodedRes), shared.FeedbackResponse);
1643
+ }
1644
+ else {
1645
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
1646
+ }
1647
+ break;
1648
+ case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
1649
+ ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
1650
+ throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
1651
+ }
1652
+ return [2 /*return*/, res];
1653
+ }
1654
+ });
1655
+ });
1656
+ };
1657
+ /**
1658
+ * Create a new fine-tuned model
1659
+ */
1660
+ HoneyHive.prototype.postFineTunedModels = function (req, config) {
1661
+ var _a, _b;
1662
+ return __awaiter(this, void 0, void 0, function () {
1663
+ var baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
1664
+ var _d;
1665
+ return __generator(this, function (_e) {
1666
+ switch (_e.label) {
1667
+ case 0:
1668
+ if (!(req instanceof utils.SpeakeasyBase)) {
1669
+ req = new operations.PostFineTunedModelsRequestBody(req);
1670
+ }
1671
+ baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
1672
+ operationUrl = baseURL.replace(/\/$/, "") + "/fine_tuned_models";
1673
+ _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
1674
+ try {
1675
+ _d = __read(utils.serializeRequestBody(req, "request", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
1676
+ }
1677
+ catch (e) {
1678
+ if (e instanceof Error) {
1679
+ throw new Error("Error serializing request body, cause: ".concat(e.message));
1680
+ }
1681
+ }
1682
+ client = this.sdkConfiguration.defaultClient;
1683
+ globalSecurity = this.sdkConfiguration.security;
1684
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
1685
+ return [4 /*yield*/, globalSecurity()];
1686
+ case 1:
1687
+ globalSecurity = _e.sent();
1688
+ _e.label = 2;
1689
+ case 2:
1690
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
1691
+ globalSecurity = new shared.Security(globalSecurity);
1692
+ }
1693
+ properties = utils.parseSecurityProperties(globalSecurity);
1694
+ headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
1695
+ headers["Accept"] = "application/json";
1696
+ headers["user-agent"] = this.sdkConfiguration.userAgent;
1697
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
1698
+ case 3:
1699
+ httpRes = _e.sent();
1700
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
1701
+ if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
1702
+ throw new Error("status code not found in response: ".concat(httpRes));
1703
+ }
1704
+ res = new operations.PostFineTunedModelsResponse({
1705
+ statusCode: httpRes.status,
1706
+ contentType: responseContentType,
1707
+ rawResponse: httpRes,
1708
+ });
1709
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
1710
+ switch (true) {
1711
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
1712
+ if (utils.matchContentType(responseContentType, "application/json")) {
1713
+ res.object = utils.objectToClass(JSON.parse(decodedRes), operations.PostFineTunedModelsResponseBody);
1714
+ }
1715
+ else {
1716
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
1717
+ }
1718
+ break;
1719
+ case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
1720
+ ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
1721
+ throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
1722
+ }
1723
+ return [2 /*return*/, res];
1724
+ }
1725
+ });
1726
+ });
1727
+ };
1728
+ /**
1729
+ * Generate a text
1730
+ */
1731
+ HoneyHive.prototype.postGenerations = function (req, config) {
1732
+ var _a, _b;
1733
+ return __awaiter(this, void 0, void 0, function () {
1734
+ var baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
1735
+ var _d;
1736
+ return __generator(this, function (_e) {
1737
+ switch (_e.label) {
1738
+ case 0:
1739
+ if (!(req instanceof utils.SpeakeasyBase)) {
1740
+ req = new shared.GenerateQuery(req);
897
1741
  }
898
1742
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
899
- url = utils.generateURL(baseURL, "/session/{session_id}/export", req);
1743
+ operationUrl = baseURL.replace(/\/$/, "") + "/generations";
1744
+ _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
1745
+ try {
1746
+ _d = __read(utils.serializeRequestBody(req, "request", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
1747
+ }
1748
+ catch (e) {
1749
+ if (e instanceof Error) {
1750
+ throw new Error("Error serializing request body, cause: ".concat(e.message));
1751
+ }
1752
+ }
900
1753
  client = this.sdkConfiguration.defaultClient;
901
1754
  globalSecurity = this.sdkConfiguration.security;
902
1755
  if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
903
1756
  return [4 /*yield*/, globalSecurity()];
904
1757
  case 1:
905
- globalSecurity = _c.sent();
906
- _c.label = 2;
1758
+ globalSecurity = _e.sent();
1759
+ _e.label = 2;
907
1760
  case 2:
908
1761
  if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
909
1762
  globalSecurity = new shared.Security(globalSecurity);
910
1763
  }
911
1764
  properties = utils.parseSecurityProperties(globalSecurity);
912
- headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
1765
+ headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
1766
+ if (reqBody == null)
1767
+ throw new Error("request body is required");
913
1768
  headers["Accept"] = "application/json";
914
1769
  headers["user-agent"] = this.sdkConfiguration.userAgent;
915
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
1770
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
916
1771
  case 3:
917
- httpRes = _c.sent();
918
- contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
1772
+ httpRes = _e.sent();
1773
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
919
1774
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
920
1775
  throw new Error("status code not found in response: ".concat(httpRes));
921
1776
  }
922
- res = new operations.GetSessionSessionIdExportResponse({
1777
+ res = new operations.PostGenerationsResponse({
923
1778
  statusCode: httpRes.status,
924
- contentType: contentType,
1779
+ contentType: responseContentType,
925
1780
  rawResponse: httpRes,
926
1781
  });
927
1782
  decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
928
1783
  switch (true) {
929
1784
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
930
- if (utils.matchContentType(contentType, "application/json")) {
931
- res.traceEventTrace = [];
932
- resFieldDepth = utils.getResFieldDepth(res);
933
- res.traceEventTrace = utils.objectToClass(JSON.parse(decodedRes), shared.TraceEvent, resFieldDepth);
1785
+ if (utils.matchContentType(responseContentType, "application/json")) {
1786
+ res.generationResponse = utils.objectToClass(JSON.parse(decodedRes), shared.GenerationResponse);
934
1787
  }
935
1788
  else {
936
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1789
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
937
1790
  }
938
1791
  break;
939
1792
  case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
@@ -946,58 +1799,67 @@ var HoneyHive = /** @class */ (function () {
946
1799
  });
947
1800
  };
948
1801
  /**
949
- * Get all tasks
1802
+ * Log a generation
950
1803
  */
951
- HoneyHive.prototype.getTasks = function (req, config) {
1804
+ HoneyHive.prototype.postGenerationsLog = function (req, config) {
952
1805
  var _a, _b;
953
1806
  return __awaiter(this, void 0, void 0, function () {
954
- var baseURL, url, client, globalSecurity, properties, headers, queryParams, httpRes, contentType, res, decodedRes, resFieldDepth;
955
- return __generator(this, function (_c) {
956
- switch (_c.label) {
1807
+ var baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
1808
+ var _d;
1809
+ return __generator(this, function (_e) {
1810
+ switch (_e.label) {
957
1811
  case 0:
958
1812
  if (!(req instanceof utils.SpeakeasyBase)) {
959
- req = new operations.GetTasksRequest(req);
1813
+ req = new shared.GenerationLoggingQuery(req);
960
1814
  }
961
1815
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
962
- url = baseURL.replace(/\/$/, "") + "/tasks";
1816
+ operationUrl = baseURL.replace(/\/$/, "") + "/generations/log";
1817
+ _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
1818
+ try {
1819
+ _d = __read(utils.serializeRequestBody(req, "request", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
1820
+ }
1821
+ catch (e) {
1822
+ if (e instanceof Error) {
1823
+ throw new Error("Error serializing request body, cause: ".concat(e.message));
1824
+ }
1825
+ }
963
1826
  client = this.sdkConfiguration.defaultClient;
964
1827
  globalSecurity = this.sdkConfiguration.security;
965
1828
  if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
966
1829
  return [4 /*yield*/, globalSecurity()];
967
1830
  case 1:
968
- globalSecurity = _c.sent();
969
- _c.label = 2;
1831
+ globalSecurity = _e.sent();
1832
+ _e.label = 2;
970
1833
  case 2:
971
1834
  if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
972
1835
  globalSecurity = new shared.Security(globalSecurity);
973
1836
  }
974
1837
  properties = utils.parseSecurityProperties(globalSecurity);
975
- headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
976
- queryParams = utils.serializeQueryParams(req);
1838
+ headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
1839
+ if (reqBody == null)
1840
+ throw new Error("request body is required");
977
1841
  headers["Accept"] = "application/json";
978
1842
  headers["user-agent"] = this.sdkConfiguration.userAgent;
979
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
1843
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
980
1844
  case 3:
981
- httpRes = _c.sent();
982
- contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
1845
+ httpRes = _e.sent();
1846
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
983
1847
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
984
1848
  throw new Error("status code not found in response: ".concat(httpRes));
985
1849
  }
986
- res = new operations.GetTasksResponse({
1850
+ res = new operations.PostGenerationsLogResponse({
987
1851
  statusCode: httpRes.status,
988
- contentType: contentType,
1852
+ contentType: responseContentType,
989
1853
  rawResponse: httpRes,
990
1854
  });
991
1855
  decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
992
1856
  switch (true) {
993
1857
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
994
- if (utils.matchContentType(contentType, "application/json")) {
995
- res.classes = [];
996
- resFieldDepth = utils.getResFieldDepth(res);
997
- res.classes = utils.objectToClass(JSON.parse(decodedRes), shared.TaskResponse, resFieldDepth);
1858
+ if (utils.matchContentType(responseContentType, "application/json")) {
1859
+ res.generationResponse = utils.objectToClass(JSON.parse(decodedRes), shared.GenerationResponse);
998
1860
  }
999
1861
  else {
1000
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1862
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
1001
1863
  }
1002
1864
  break;
1003
1865
  case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
@@ -1010,21 +1872,21 @@ var HoneyHive = /** @class */ (function () {
1010
1872
  });
1011
1873
  };
1012
1874
  /**
1013
- * Create a dataset
1875
+ * Create a metric
1014
1876
  */
1015
- HoneyHive.prototype.postDatasets = function (req, config) {
1877
+ HoneyHive.prototype.postMetrics = function (req, config) {
1016
1878
  var _a, _b;
1017
1879
  return __awaiter(this, void 0, void 0, function () {
1018
- var baseURL, url, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
1880
+ var baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
1019
1881
  var _d;
1020
1882
  return __generator(this, function (_e) {
1021
1883
  switch (_e.label) {
1022
1884
  case 0:
1023
1885
  if (!(req instanceof utils.SpeakeasyBase)) {
1024
- req = new shared.UploadDataset(req);
1886
+ req = new shared.MetricCreateRequest(req);
1025
1887
  }
1026
1888
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
1027
- url = baseURL.replace(/\/$/, "") + "/datasets";
1889
+ operationUrl = baseURL.replace(/\/$/, "") + "/metrics";
1028
1890
  _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
1029
1891
  try {
1030
1892
  _d = __read(utils.serializeRequestBody(req, "request", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
@@ -1047,30 +1909,28 @@ var HoneyHive = /** @class */ (function () {
1047
1909
  }
1048
1910
  properties = utils.parseSecurityProperties(globalSecurity);
1049
1911
  headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
1050
- if (reqBody == null)
1051
- throw new Error("request body is required");
1052
1912
  headers["Accept"] = "application/json";
1053
1913
  headers["user-agent"] = this.sdkConfiguration.userAgent;
1054
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
1914
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
1055
1915
  case 3:
1056
1916
  httpRes = _e.sent();
1057
- contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
1917
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
1058
1918
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
1059
1919
  throw new Error("status code not found in response: ".concat(httpRes));
1060
1920
  }
1061
- res = new operations.PostDatasetsResponse({
1921
+ res = new operations.PostMetricsResponse({
1062
1922
  statusCode: httpRes.status,
1063
- contentType: contentType,
1923
+ contentType: responseContentType,
1064
1924
  rawResponse: httpRes,
1065
1925
  });
1066
1926
  decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
1067
1927
  switch (true) {
1068
1928
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
1069
- if (utils.matchContentType(contentType, "application/json")) {
1070
- res.datasetResponse = utils.objectToClass(JSON.parse(decodedRes), shared.DatasetResponse);
1929
+ if (utils.matchContentType(responseContentType, "application/json")) {
1930
+ res.metricCreateResponse = utils.objectToClass(JSON.parse(decodedRes), shared.MetricCreateResponse);
1071
1931
  }
1072
1932
  else {
1073
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1933
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
1074
1934
  }
1075
1935
  break;
1076
1936
  case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
@@ -1083,21 +1943,21 @@ var HoneyHive = /** @class */ (function () {
1083
1943
  });
1084
1944
  };
1085
1945
  /**
1086
- * Log an evaluation
1946
+ * Compute metric
1087
1947
  */
1088
- HoneyHive.prototype.postEvaluations = function (req, config) {
1948
+ HoneyHive.prototype.postMetricsCompute = function (req, config) {
1089
1949
  var _a, _b;
1090
1950
  return __awaiter(this, void 0, void 0, function () {
1091
- var baseURL, url, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
1951
+ var baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
1092
1952
  var _d;
1093
1953
  return __generator(this, function (_e) {
1094
1954
  switch (_e.label) {
1095
1955
  case 0:
1096
1956
  if (!(req instanceof utils.SpeakeasyBase)) {
1097
- req = new shared.EvaluationLoggingQuery(req);
1957
+ req = new shared.MetricComputeRequest(req);
1098
1958
  }
1099
1959
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
1100
- url = baseURL.replace(/\/$/, "") + "/evaluations";
1960
+ operationUrl = baseURL.replace(/\/$/, "") + "/metrics/compute";
1101
1961
  _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
1102
1962
  try {
1103
1963
  _d = __read(utils.serializeRequestBody(req, "request", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
@@ -1120,30 +1980,28 @@ var HoneyHive = /** @class */ (function () {
1120
1980
  }
1121
1981
  properties = utils.parseSecurityProperties(globalSecurity);
1122
1982
  headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
1123
- if (reqBody == null)
1124
- throw new Error("request body is required");
1125
1983
  headers["Accept"] = "application/json";
1126
1984
  headers["user-agent"] = this.sdkConfiguration.userAgent;
1127
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
1985
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
1128
1986
  case 3:
1129
1987
  httpRes = _e.sent();
1130
- contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
1988
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
1131
1989
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
1132
1990
  throw new Error("status code not found in response: ".concat(httpRes));
1133
1991
  }
1134
- res = new operations.PostEvaluationsResponse({
1992
+ res = new operations.PostMetricsComputeResponse({
1135
1993
  statusCode: httpRes.status,
1136
- contentType: contentType,
1994
+ contentType: responseContentType,
1137
1995
  rawResponse: httpRes,
1138
1996
  });
1139
1997
  decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
1140
1998
  switch (true) {
1141
1999
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
1142
- if (utils.matchContentType(contentType, "application/json")) {
1143
- res.successResponse = utils.objectToClass(JSON.parse(decodedRes), shared.SuccessResponse);
2000
+ if (utils.matchContentType(responseContentType, "application/json")) {
2001
+ res.metricComputeResponse = utils.objectToClass(JSON.parse(decodedRes), shared.MetricComputeResponse);
1144
2002
  }
1145
2003
  else {
1146
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
2004
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
1147
2005
  }
1148
2006
  break;
1149
2007
  case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
@@ -1156,21 +2014,21 @@ var HoneyHive = /** @class */ (function () {
1156
2014
  });
1157
2015
  };
1158
2016
  /**
1159
- * Send feedback
2017
+ * Create a prompt
1160
2018
  */
1161
- HoneyHive.prototype.postFeedback = function (req, config) {
2019
+ HoneyHive.prototype.postPrompts = function (req, config) {
1162
2020
  var _a, _b;
1163
2021
  return __awaiter(this, void 0, void 0, function () {
1164
- var baseURL, url, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
2022
+ var baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
1165
2023
  var _d;
1166
2024
  return __generator(this, function (_e) {
1167
2025
  switch (_e.label) {
1168
2026
  case 0:
1169
2027
  if (!(req instanceof utils.SpeakeasyBase)) {
1170
- req = new shared.FeedbackQuery(req);
2028
+ req = new shared.PromptCreationQuery(req);
1171
2029
  }
1172
2030
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
1173
- url = baseURL.replace(/\/$/, "") + "/feedback";
2031
+ operationUrl = baseURL.replace(/\/$/, "") + "/prompts";
1174
2032
  _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
1175
2033
  try {
1176
2034
  _d = __read(utils.serializeRequestBody(req, "request", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
@@ -1197,26 +2055,26 @@ var HoneyHive = /** @class */ (function () {
1197
2055
  throw new Error("request body is required");
1198
2056
  headers["Accept"] = "application/json";
1199
2057
  headers["user-agent"] = this.sdkConfiguration.userAgent;
1200
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
2058
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
1201
2059
  case 3:
1202
2060
  httpRes = _e.sent();
1203
- contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
2061
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
1204
2062
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
1205
2063
  throw new Error("status code not found in response: ".concat(httpRes));
1206
2064
  }
1207
- res = new operations.PostFeedbackResponse({
2065
+ res = new operations.PostPromptsResponse({
1208
2066
  statusCode: httpRes.status,
1209
- contentType: contentType,
2067
+ contentType: responseContentType,
1210
2068
  rawResponse: httpRes,
1211
2069
  });
1212
2070
  decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
1213
2071
  switch (true) {
1214
2072
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
1215
- if (utils.matchContentType(contentType, "application/json")) {
1216
- res.feedbackResponse = utils.objectToClass(JSON.parse(decodedRes), shared.FeedbackResponse);
2073
+ if (utils.matchContentType(responseContentType, "application/json")) {
2074
+ res.promptResponse = utils.objectToClass(JSON.parse(decodedRes), shared.PromptResponse);
1217
2075
  }
1218
2076
  else {
1219
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
2077
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
1220
2078
  }
1221
2079
  break;
1222
2080
  case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
@@ -1229,21 +2087,21 @@ var HoneyHive = /** @class */ (function () {
1229
2087
  });
1230
2088
  };
1231
2089
  /**
1232
- * Generate a text
2090
+ * Start a session
1233
2091
  */
1234
- HoneyHive.prototype.postGenerations = function (req, config) {
2092
+ HoneyHive.prototype.postSessionStart = function (req, config) {
1235
2093
  var _a, _b;
1236
2094
  return __awaiter(this, void 0, void 0, function () {
1237
- var baseURL, url, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
2095
+ var baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
1238
2096
  var _d;
1239
2097
  return __generator(this, function (_e) {
1240
2098
  switch (_e.label) {
1241
2099
  case 0:
1242
2100
  if (!(req instanceof utils.SpeakeasyBase)) {
1243
- req = new shared.GenerateQuery(req);
2101
+ req = new shared.SessionStartQuery(req);
1244
2102
  }
1245
2103
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
1246
- url = baseURL.replace(/\/$/, "") + "/generations";
2104
+ operationUrl = baseURL.replace(/\/$/, "") + "/session/start";
1247
2105
  _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
1248
2106
  try {
1249
2107
  _d = __read(utils.serializeRequestBody(req, "request", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
@@ -1270,26 +2128,26 @@ var HoneyHive = /** @class */ (function () {
1270
2128
  throw new Error("request body is required");
1271
2129
  headers["Accept"] = "application/json";
1272
2130
  headers["user-agent"] = this.sdkConfiguration.userAgent;
1273
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
2131
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
1274
2132
  case 3:
1275
2133
  httpRes = _e.sent();
1276
- contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
2134
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
1277
2135
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
1278
2136
  throw new Error("status code not found in response: ".concat(httpRes));
1279
2137
  }
1280
- res = new operations.PostGenerationsResponse({
2138
+ res = new operations.PostSessionStartResponse({
1281
2139
  statusCode: httpRes.status,
1282
- contentType: contentType,
2140
+ contentType: responseContentType,
1283
2141
  rawResponse: httpRes,
1284
2142
  });
1285
2143
  decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
1286
2144
  switch (true) {
1287
2145
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
1288
- if (utils.matchContentType(contentType, "application/json")) {
1289
- res.generationResponse = utils.objectToClass(JSON.parse(decodedRes), shared.GenerationResponse);
2146
+ if (utils.matchContentType(responseContentType, "application/json")) {
2147
+ res.sessionStartResponse = utils.objectToClass(JSON.parse(decodedRes), shared.SessionStartResponse);
1290
2148
  }
1291
2149
  else {
1292
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
2150
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
1293
2151
  }
1294
2152
  break;
1295
2153
  case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
@@ -1302,67 +2160,55 @@ var HoneyHive = /** @class */ (function () {
1302
2160
  });
1303
2161
  };
1304
2162
  /**
1305
- * Log a generation
2163
+ * End a session
1306
2164
  */
1307
- HoneyHive.prototype.postGenerationsLog = function (req, config) {
2165
+ HoneyHive.prototype.postSessionSessionIdEnd = function (req, config) {
1308
2166
  var _a, _b;
1309
2167
  return __awaiter(this, void 0, void 0, function () {
1310
- var baseURL, url, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
1311
- var _d;
1312
- return __generator(this, function (_e) {
1313
- switch (_e.label) {
2168
+ var baseURL, operationUrl, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
2169
+ return __generator(this, function (_c) {
2170
+ switch (_c.label) {
1314
2171
  case 0:
1315
2172
  if (!(req instanceof utils.SpeakeasyBase)) {
1316
- req = new shared.GenerationLoggingQuery(req);
2173
+ req = new operations.PostSessionSessionIdEndRequest(req);
1317
2174
  }
1318
2175
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
1319
- url = baseURL.replace(/\/$/, "") + "/generations/log";
1320
- _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
1321
- try {
1322
- _d = __read(utils.serializeRequestBody(req, "request", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
1323
- }
1324
- catch (e) {
1325
- if (e instanceof Error) {
1326
- throw new Error("Error serializing request body, cause: ".concat(e.message));
1327
- }
1328
- }
2176
+ operationUrl = utils.generateURL(baseURL, "/session/{session_id}/end", req);
1329
2177
  client = this.sdkConfiguration.defaultClient;
1330
2178
  globalSecurity = this.sdkConfiguration.security;
1331
2179
  if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
1332
2180
  return [4 /*yield*/, globalSecurity()];
1333
2181
  case 1:
1334
- globalSecurity = _e.sent();
1335
- _e.label = 2;
2182
+ globalSecurity = _c.sent();
2183
+ _c.label = 2;
1336
2184
  case 2:
1337
2185
  if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
1338
2186
  globalSecurity = new shared.Security(globalSecurity);
1339
2187
  }
1340
2188
  properties = utils.parseSecurityProperties(globalSecurity);
1341
- headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
1342
- if (reqBody == null)
1343
- throw new Error("request body is required");
2189
+ headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
1344
2190
  headers["Accept"] = "application/json";
1345
2191
  headers["user-agent"] = this.sdkConfiguration.userAgent;
1346
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
2192
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "post", headers: headers, responseType: "arraybuffer" }, config))];
1347
2193
  case 3:
1348
- httpRes = _e.sent();
1349
- contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
2194
+ httpRes = _c.sent();
2195
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
1350
2196
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
1351
2197
  throw new Error("status code not found in response: ".concat(httpRes));
1352
2198
  }
1353
- res = new operations.PostGenerationsLogResponse({
2199
+ res = new operations.PostSessionSessionIdEndResponse({
1354
2200
  statusCode: httpRes.status,
1355
- contentType: contentType,
2201
+ contentType: responseContentType,
1356
2202
  rawResponse: httpRes,
1357
2203
  });
1358
2204
  decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
1359
2205
  switch (true) {
1360
2206
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
1361
- if (utils.matchContentType(contentType, "application/json")) {
1362
- res.generationResponse = utils.objectToClass(JSON.parse(decodedRes), shared.GenerationResponse);
2207
+ if (utils.matchContentType(responseContentType, "application/json")) {
2208
+ res.sessionEndResponse = utils.objectToClass(JSON.parse(decodedRes), shared.SessionEndResponse);
1363
2209
  }
1364
2210
  else {
1365
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
2211
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
1366
2212
  }
1367
2213
  break;
1368
2214
  case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
@@ -1375,24 +2221,24 @@ var HoneyHive = /** @class */ (function () {
1375
2221
  });
1376
2222
  };
1377
2223
  /**
1378
- * Create a metric
2224
+ * Log an event
1379
2225
  */
1380
- HoneyHive.prototype.postMetrics = function (req, config) {
2226
+ HoneyHive.prototype.postSessionSessionIdEvent = function (req, config) {
1381
2227
  var _a, _b;
1382
2228
  return __awaiter(this, void 0, void 0, function () {
1383
- var baseURL, url, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
2229
+ var baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
1384
2230
  var _d;
1385
2231
  return __generator(this, function (_e) {
1386
2232
  switch (_e.label) {
1387
2233
  case 0:
1388
2234
  if (!(req instanceof utils.SpeakeasyBase)) {
1389
- req = new shared.MetricRequest(req);
2235
+ req = new operations.PostSessionSessionIdEventRequest(req);
1390
2236
  }
1391
2237
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
1392
- url = baseURL.replace(/\/$/, "") + "/metrics";
2238
+ operationUrl = utils.generateURL(baseURL, "/session/{session_id}/event", req);
1393
2239
  _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
1394
2240
  try {
1395
- _d = __read(utils.serializeRequestBody(req, "request", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
2241
+ _d = __read(utils.serializeRequestBody(req, "sessionEventQuery", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
1396
2242
  }
1397
2243
  catch (e) {
1398
2244
  if (e instanceof Error) {
@@ -1416,26 +2262,26 @@ var HoneyHive = /** @class */ (function () {
1416
2262
  throw new Error("request body is required");
1417
2263
  headers["Accept"] = "application/json";
1418
2264
  headers["user-agent"] = this.sdkConfiguration.userAgent;
1419
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
2265
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
1420
2266
  case 3:
1421
2267
  httpRes = _e.sent();
1422
- contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
2268
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
1423
2269
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
1424
2270
  throw new Error("status code not found in response: ".concat(httpRes));
1425
2271
  }
1426
- res = new operations.PostMetricsResponse({
2272
+ res = new operations.PostSessionSessionIdEventResponse({
1427
2273
  statusCode: httpRes.status,
1428
- contentType: contentType,
2274
+ contentType: responseContentType,
1429
2275
  rawResponse: httpRes,
1430
2276
  });
1431
2277
  decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
1432
2278
  switch (true) {
1433
2279
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
1434
- if (utils.matchContentType(contentType, "application/json")) {
1435
- res.metricCreateResponse = utils.objectToClass(JSON.parse(decodedRes), shared.MetricCreateResponse);
2280
+ if (utils.matchContentType(responseContentType, "application/json")) {
2281
+ res.sessionEventResponse = utils.objectToClass(JSON.parse(decodedRes), shared.SessionEventResponse);
1436
2282
  }
1437
2283
  else {
1438
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
2284
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
1439
2285
  }
1440
2286
  break;
1441
2287
  case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
@@ -1448,24 +2294,24 @@ var HoneyHive = /** @class */ (function () {
1448
2294
  });
1449
2295
  };
1450
2296
  /**
1451
- * Create a prompt
2297
+ * Log session feedback
1452
2298
  */
1453
- HoneyHive.prototype.postPrompts = function (req, config) {
2299
+ HoneyHive.prototype.postSessionSessionIdFeedback = function (req, config) {
1454
2300
  var _a, _b;
1455
2301
  return __awaiter(this, void 0, void 0, function () {
1456
- var baseURL, url, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
2302
+ var baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
1457
2303
  var _d;
1458
2304
  return __generator(this, function (_e) {
1459
2305
  switch (_e.label) {
1460
2306
  case 0:
1461
2307
  if (!(req instanceof utils.SpeakeasyBase)) {
1462
- req = new shared.PromptCreationQuery(req);
2308
+ req = new operations.PostSessionSessionIdFeedbackRequest(req);
1463
2309
  }
1464
2310
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
1465
- url = baseURL.replace(/\/$/, "") + "/prompts";
2311
+ operationUrl = utils.generateURL(baseURL, "/session/{session_id}/feedback", req);
1466
2312
  _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
1467
2313
  try {
1468
- _d = __read(utils.serializeRequestBody(req, "request", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
2314
+ _d = __read(utils.serializeRequestBody(req, "sessionFeedback", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
1469
2315
  }
1470
2316
  catch (e) {
1471
2317
  if (e instanceof Error) {
@@ -1489,26 +2335,26 @@ var HoneyHive = /** @class */ (function () {
1489
2335
  throw new Error("request body is required");
1490
2336
  headers["Accept"] = "application/json";
1491
2337
  headers["user-agent"] = this.sdkConfiguration.userAgent;
1492
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
2338
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
1493
2339
  case 3:
1494
2340
  httpRes = _e.sent();
1495
- contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
2341
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
1496
2342
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
1497
2343
  throw new Error("status code not found in response: ".concat(httpRes));
1498
2344
  }
1499
- res = new operations.PostPromptsResponse({
2345
+ res = new operations.PostSessionSessionIdFeedbackResponse({
1500
2346
  statusCode: httpRes.status,
1501
- contentType: contentType,
2347
+ contentType: responseContentType,
1502
2348
  rawResponse: httpRes,
1503
2349
  });
1504
2350
  decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
1505
2351
  switch (true) {
1506
2352
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
1507
- if (utils.matchContentType(contentType, "application/json")) {
1508
- res.promptResponse = utils.objectToClass(JSON.parse(decodedRes), shared.PromptResponse);
2353
+ if (utils.matchContentType(responseContentType, "application/json")) {
2354
+ res.successResponse = utils.objectToClass(JSON.parse(decodedRes), shared.SuccessResponse);
1509
2355
  }
1510
2356
  else {
1511
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
2357
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
1512
2358
  }
1513
2359
  break;
1514
2360
  case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
@@ -1521,24 +2367,24 @@ var HoneyHive = /** @class */ (function () {
1521
2367
  });
1522
2368
  };
1523
2369
  /**
1524
- * Start a session
2370
+ * Log a trace
1525
2371
  */
1526
- HoneyHive.prototype.postSessionStart = function (req, config) {
2372
+ HoneyHive.prototype.postSessionSessionIdTraces = function (req, config) {
1527
2373
  var _a, _b;
1528
2374
  return __awaiter(this, void 0, void 0, function () {
1529
- var baseURL, url, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
2375
+ var baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
1530
2376
  var _d;
1531
2377
  return __generator(this, function (_e) {
1532
2378
  switch (_e.label) {
1533
2379
  case 0:
1534
2380
  if (!(req instanceof utils.SpeakeasyBase)) {
1535
- req = new shared.SessionStartQuery(req);
2381
+ req = new operations.PostSessionSessionIdTracesRequest(req);
1536
2382
  }
1537
2383
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
1538
- url = baseURL.replace(/\/$/, "") + "/session/start";
2384
+ operationUrl = utils.generateURL(baseURL, "/session/{session_id}/traces", req);
1539
2385
  _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
1540
2386
  try {
1541
- _d = __read(utils.serializeRequestBody(req, "request", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
2387
+ _d = __read(utils.serializeRequestBody(req, "sessionTrace", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
1542
2388
  }
1543
2389
  catch (e) {
1544
2390
  if (e instanceof Error) {
@@ -1562,26 +2408,26 @@ var HoneyHive = /** @class */ (function () {
1562
2408
  throw new Error("request body is required");
1563
2409
  headers["Accept"] = "application/json";
1564
2410
  headers["user-agent"] = this.sdkConfiguration.userAgent;
1565
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
2411
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
1566
2412
  case 3:
1567
2413
  httpRes = _e.sent();
1568
- contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
2414
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
1569
2415
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
1570
2416
  throw new Error("status code not found in response: ".concat(httpRes));
1571
2417
  }
1572
- res = new operations.PostSessionStartResponse({
2418
+ res = new operations.PostSessionSessionIdTracesResponse({
1573
2419
  statusCode: httpRes.status,
1574
- contentType: contentType,
2420
+ contentType: responseContentType,
1575
2421
  rawResponse: httpRes,
1576
2422
  });
1577
2423
  decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
1578
2424
  switch (true) {
1579
2425
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
1580
- if (utils.matchContentType(contentType, "application/json")) {
1581
- res.sessionStartResponse = utils.objectToClass(JSON.parse(decodedRes), shared.SessionStartResponse);
2426
+ if (utils.matchContentType(responseContentType, "application/json")) {
2427
+ res.successTraceResponse = utils.objectToClass(JSON.parse(decodedRes), shared.SuccessTraceResponse);
1582
2428
  }
1583
2429
  else {
1584
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
2430
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
1585
2431
  }
1586
2432
  break;
1587
2433
  case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
@@ -1594,55 +2440,67 @@ var HoneyHive = /** @class */ (function () {
1594
2440
  });
1595
2441
  };
1596
2442
  /**
1597
- * End a session
2443
+ * Create a task
1598
2444
  */
1599
- HoneyHive.prototype.postSessionSessionIdEnd = function (req, config) {
2445
+ HoneyHive.prototype.postTasks = function (req, config) {
1600
2446
  var _a, _b;
1601
2447
  return __awaiter(this, void 0, void 0, function () {
1602
- var baseURL, url, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
1603
- return __generator(this, function (_c) {
1604
- switch (_c.label) {
2448
+ var baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
2449
+ var _d;
2450
+ return __generator(this, function (_e) {
2451
+ switch (_e.label) {
1605
2452
  case 0:
1606
2453
  if (!(req instanceof utils.SpeakeasyBase)) {
1607
- req = new operations.PostSessionSessionIdEndRequest(req);
2454
+ req = new shared.TaskCreationQuery(req);
1608
2455
  }
1609
2456
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
1610
- url = utils.generateURL(baseURL, "/session/{session_id}/end", req);
2457
+ operationUrl = baseURL.replace(/\/$/, "") + "/tasks";
2458
+ _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
2459
+ try {
2460
+ _d = __read(utils.serializeRequestBody(req, "request", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
2461
+ }
2462
+ catch (e) {
2463
+ if (e instanceof Error) {
2464
+ throw new Error("Error serializing request body, cause: ".concat(e.message));
2465
+ }
2466
+ }
1611
2467
  client = this.sdkConfiguration.defaultClient;
1612
2468
  globalSecurity = this.sdkConfiguration.security;
1613
2469
  if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
1614
2470
  return [4 /*yield*/, globalSecurity()];
1615
2471
  case 1:
1616
- globalSecurity = _c.sent();
1617
- _c.label = 2;
2472
+ globalSecurity = _e.sent();
2473
+ _e.label = 2;
1618
2474
  case 2:
1619
2475
  if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
1620
2476
  globalSecurity = new shared.Security(globalSecurity);
1621
2477
  }
1622
2478
  properties = utils.parseSecurityProperties(globalSecurity);
1623
- headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
2479
+ headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
2480
+ if (reqBody == null)
2481
+ throw new Error("request body is required");
1624
2482
  headers["Accept"] = "application/json";
1625
2483
  headers["user-agent"] = this.sdkConfiguration.userAgent;
1626
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, responseType: "arraybuffer" }, config))];
2484
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
1627
2485
  case 3:
1628
- httpRes = _c.sent();
1629
- contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
2486
+ httpRes = _e.sent();
2487
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
1630
2488
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
1631
2489
  throw new Error("status code not found in response: ".concat(httpRes));
1632
2490
  }
1633
- res = new operations.PostSessionSessionIdEndResponse({
2491
+ res = new operations.PostTasksResponse({
1634
2492
  statusCode: httpRes.status,
1635
- contentType: contentType,
2493
+ contentType: responseContentType,
1636
2494
  rawResponse: httpRes,
1637
2495
  });
1638
2496
  decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
1639
2497
  switch (true) {
1640
2498
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
1641
- if (utils.matchContentType(contentType, "application/json")) {
1642
- res.sessionEndResponse = utils.objectToClass(JSON.parse(decodedRes), shared.SessionEndResponse);
2499
+ if (utils.matchContentType(responseContentType, "application/json")) {
2500
+ res.taskResponse = utils.objectToClass(JSON.parse(decodedRes), shared.TaskResponse);
1643
2501
  }
1644
2502
  else {
1645
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
2503
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
1646
2504
  }
1647
2505
  break;
1648
2506
  case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
@@ -1655,24 +2513,24 @@ var HoneyHive = /** @class */ (function () {
1655
2513
  });
1656
2514
  };
1657
2515
  /**
1658
- * Log an event
2516
+ * Update a dataset
1659
2517
  */
1660
- HoneyHive.prototype.postSessionSessionIdEvent = function (req, config) {
2518
+ HoneyHive.prototype.putDatasets = function (req, config) {
1661
2519
  var _a, _b;
1662
2520
  return __awaiter(this, void 0, void 0, function () {
1663
- var baseURL, url, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
2521
+ var baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
1664
2522
  var _d;
1665
2523
  return __generator(this, function (_e) {
1666
2524
  switch (_e.label) {
1667
2525
  case 0:
1668
2526
  if (!(req instanceof utils.SpeakeasyBase)) {
1669
- req = new operations.PostSessionSessionIdEventRequest(req);
2527
+ req = new shared.UploadDataset(req);
1670
2528
  }
1671
2529
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
1672
- url = utils.generateURL(baseURL, "/session/{session_id}/event", req);
2530
+ operationUrl = baseURL.replace(/\/$/, "") + "/datasets";
1673
2531
  _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
1674
2532
  try {
1675
- _d = __read(utils.serializeRequestBody(req, "sessionEventQuery", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
2533
+ _d = __read(utils.serializeRequestBody(req, "request", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
1676
2534
  }
1677
2535
  catch (e) {
1678
2536
  if (e instanceof Error) {
@@ -1696,26 +2554,26 @@ var HoneyHive = /** @class */ (function () {
1696
2554
  throw new Error("request body is required");
1697
2555
  headers["Accept"] = "application/json";
1698
2556
  headers["user-agent"] = this.sdkConfiguration.userAgent;
1699
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
2557
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "put", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
1700
2558
  case 3:
1701
2559
  httpRes = _e.sent();
1702
- contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
2560
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
1703
2561
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
1704
2562
  throw new Error("status code not found in response: ".concat(httpRes));
1705
2563
  }
1706
- res = new operations.PostSessionSessionIdEventResponse({
2564
+ res = new operations.PutDatasetsResponse({
1707
2565
  statusCode: httpRes.status,
1708
- contentType: contentType,
2566
+ contentType: responseContentType,
1709
2567
  rawResponse: httpRes,
1710
2568
  });
1711
2569
  decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
1712
2570
  switch (true) {
1713
2571
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
1714
- if (utils.matchContentType(contentType, "application/json")) {
1715
- res.sessionEventResponse = utils.objectToClass(JSON.parse(decodedRes), shared.SessionEventResponse);
2572
+ if (utils.matchContentType(responseContentType, "application/json")) {
2573
+ res.datasetResponse = utils.objectToClass(JSON.parse(decodedRes), shared.DatasetResponse);
1716
2574
  }
1717
2575
  else {
1718
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
2576
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
1719
2577
  }
1720
2578
  break;
1721
2579
  case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
@@ -1728,24 +2586,24 @@ var HoneyHive = /** @class */ (function () {
1728
2586
  });
1729
2587
  };
1730
2588
  /**
1731
- * Log session feedback
2589
+ * Update an evaluation
1732
2590
  */
1733
- HoneyHive.prototype.postSessionSessionIdFeedback = function (req, config) {
2591
+ HoneyHive.prototype.putEvaluationsId = function (req, config) {
1734
2592
  var _a, _b;
1735
2593
  return __awaiter(this, void 0, void 0, function () {
1736
- var baseURL, url, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
2594
+ var baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
1737
2595
  var _d;
1738
2596
  return __generator(this, function (_e) {
1739
2597
  switch (_e.label) {
1740
2598
  case 0:
1741
2599
  if (!(req instanceof utils.SpeakeasyBase)) {
1742
- req = new operations.PostSessionSessionIdFeedbackRequest(req);
2600
+ req = new operations.PutEvaluationsIdRequest(req);
1743
2601
  }
1744
2602
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
1745
- url = utils.generateURL(baseURL, "/session/{session_id}/feedback", req);
2603
+ operationUrl = utils.generateURL(baseURL, "/evaluations/{id}", req);
1746
2604
  _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
1747
2605
  try {
1748
- _d = __read(utils.serializeRequestBody(req, "sessionFeedback", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
2606
+ _d = __read(utils.serializeRequestBody(req, "evaluationUpdateRequest", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
1749
2607
  }
1750
2608
  catch (e) {
1751
2609
  if (e instanceof Error) {
@@ -1765,30 +2623,28 @@ var HoneyHive = /** @class */ (function () {
1765
2623
  }
1766
2624
  properties = utils.parseSecurityProperties(globalSecurity);
1767
2625
  headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
1768
- if (reqBody == null)
1769
- throw new Error("request body is required");
1770
2626
  headers["Accept"] = "application/json";
1771
2627
  headers["user-agent"] = this.sdkConfiguration.userAgent;
1772
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
2628
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "put", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
1773
2629
  case 3:
1774
2630
  httpRes = _e.sent();
1775
- contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
2631
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
1776
2632
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
1777
2633
  throw new Error("status code not found in response: ".concat(httpRes));
1778
2634
  }
1779
- res = new operations.PostSessionSessionIdFeedbackResponse({
2635
+ res = new operations.PutEvaluationsIdResponse({
1780
2636
  statusCode: httpRes.status,
1781
- contentType: contentType,
2637
+ contentType: responseContentType,
1782
2638
  rawResponse: httpRes,
1783
2639
  });
1784
2640
  decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
1785
2641
  switch (true) {
1786
2642
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
1787
- if (utils.matchContentType(contentType, "application/json")) {
1788
- res.successResponse = utils.objectToClass(JSON.parse(decodedRes), shared.SuccessResponse);
2643
+ if (utils.matchContentType(responseContentType, "application/json")) {
2644
+ res.updateResponse = utils.objectToClass(JSON.parse(decodedRes), shared.UpdateResponse);
1789
2645
  }
1790
2646
  else {
1791
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
2647
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
1792
2648
  }
1793
2649
  break;
1794
2650
  case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
@@ -1801,24 +2657,24 @@ var HoneyHive = /** @class */ (function () {
1801
2657
  });
1802
2658
  };
1803
2659
  /**
1804
- * Log a trace
2660
+ * Update a metric
1805
2661
  */
1806
- HoneyHive.prototype.postSessionSessionIdTraces = function (req, config) {
2662
+ HoneyHive.prototype.putMetrics = function (req, config) {
1807
2663
  var _a, _b;
1808
2664
  return __awaiter(this, void 0, void 0, function () {
1809
- var baseURL, url, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
2665
+ var baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
1810
2666
  var _d;
1811
2667
  return __generator(this, function (_e) {
1812
2668
  switch (_e.label) {
1813
2669
  case 0:
1814
2670
  if (!(req instanceof utils.SpeakeasyBase)) {
1815
- req = new operations.PostSessionSessionIdTracesRequest(req);
2671
+ req = new shared.MetricUpdateRequest(req);
1816
2672
  }
1817
2673
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
1818
- url = utils.generateURL(baseURL, "/session/{session_id}/traces", req);
2674
+ operationUrl = baseURL.replace(/\/$/, "") + "/metrics";
1819
2675
  _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
1820
2676
  try {
1821
- _d = __read(utils.serializeRequestBody(req, "sessionTrace", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
2677
+ _d = __read(utils.serializeRequestBody(req, "request", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
1822
2678
  }
1823
2679
  catch (e) {
1824
2680
  if (e instanceof Error) {
@@ -1838,30 +2694,28 @@ var HoneyHive = /** @class */ (function () {
1838
2694
  }
1839
2695
  properties = utils.parseSecurityProperties(globalSecurity);
1840
2696
  headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
1841
- if (reqBody == null)
1842
- throw new Error("request body is required");
1843
2697
  headers["Accept"] = "application/json";
1844
2698
  headers["user-agent"] = this.sdkConfiguration.userAgent;
1845
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
2699
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "put", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
1846
2700
  case 3:
1847
2701
  httpRes = _e.sent();
1848
- contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
2702
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
1849
2703
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
1850
2704
  throw new Error("status code not found in response: ".concat(httpRes));
1851
2705
  }
1852
- res = new operations.PostSessionSessionIdTracesResponse({
2706
+ res = new operations.PutMetricsResponse({
1853
2707
  statusCode: httpRes.status,
1854
- contentType: contentType,
2708
+ contentType: responseContentType,
1855
2709
  rawResponse: httpRes,
1856
2710
  });
1857
2711
  decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
1858
2712
  switch (true) {
1859
2713
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
1860
- if (utils.matchContentType(contentType, "application/json")) {
1861
- res.successTraceResponse = utils.objectToClass(JSON.parse(decodedRes), shared.SuccessTraceResponse);
2714
+ if (utils.matchContentType(responseContentType, "application/json")) {
2715
+ res.metricUpdateResponse = utils.objectToClass(JSON.parse(decodedRes), shared.MetricUpdateResponse);
1862
2716
  }
1863
2717
  else {
1864
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
2718
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
1865
2719
  }
1866
2720
  break;
1867
2721
  case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
@@ -1874,24 +2728,24 @@ var HoneyHive = /** @class */ (function () {
1874
2728
  });
1875
2729
  };
1876
2730
  /**
1877
- * Create a task
2731
+ * Update a prompt
1878
2732
  */
1879
- HoneyHive.prototype.postTasks = function (req, config) {
2733
+ HoneyHive.prototype.putPromptsId = function (req, config) {
1880
2734
  var _a, _b;
1881
2735
  return __awaiter(this, void 0, void 0, function () {
1882
- var baseURL, url, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
2736
+ var baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
1883
2737
  var _d;
1884
2738
  return __generator(this, function (_e) {
1885
2739
  switch (_e.label) {
1886
2740
  case 0:
1887
2741
  if (!(req instanceof utils.SpeakeasyBase)) {
1888
- req = new shared.TaskCreationQuery(req);
2742
+ req = new operations.PutPromptsIdRequest(req);
1889
2743
  }
1890
2744
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
1891
- url = baseURL.replace(/\/$/, "") + "/tasks";
2745
+ operationUrl = utils.generateURL(baseURL, "/prompts/{id}", req);
1892
2746
  _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
1893
2747
  try {
1894
- _d = __read(utils.serializeRequestBody(req, "request", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
2748
+ _d = __read(utils.serializeRequestBody(req, "promptUpdateQuery", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
1895
2749
  }
1896
2750
  catch (e) {
1897
2751
  if (e instanceof Error) {
@@ -1915,26 +2769,26 @@ var HoneyHive = /** @class */ (function () {
1915
2769
  throw new Error("request body is required");
1916
2770
  headers["Accept"] = "application/json";
1917
2771
  headers["user-agent"] = this.sdkConfiguration.userAgent;
1918
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
2772
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "put", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
1919
2773
  case 3:
1920
2774
  httpRes = _e.sent();
1921
- contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
2775
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
1922
2776
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
1923
2777
  throw new Error("status code not found in response: ".concat(httpRes));
1924
2778
  }
1925
- res = new operations.PostTasksResponse({
2779
+ res = new operations.PutPromptsIdResponse({
1926
2780
  statusCode: httpRes.status,
1927
- contentType: contentType,
2781
+ contentType: responseContentType,
1928
2782
  rawResponse: httpRes,
1929
2783
  });
1930
2784
  decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
1931
2785
  switch (true) {
1932
2786
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
1933
- if (utils.matchContentType(contentType, "application/json")) {
1934
- res.taskResponse = utils.objectToClass(JSON.parse(decodedRes), shared.TaskResponse);
2787
+ if (utils.matchContentType(responseContentType, "application/json")) {
2788
+ res.promptResponse = utils.objectToClass(JSON.parse(decodedRes), shared.PromptResponse);
1935
2789
  }
1936
2790
  else {
1937
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
2791
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
1938
2792
  }
1939
2793
  break;
1940
2794
  case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
@@ -1947,24 +2801,24 @@ var HoneyHive = /** @class */ (function () {
1947
2801
  });
1948
2802
  };
1949
2803
  /**
1950
- * Update a prompt
2804
+ * Update a session event
1951
2805
  */
1952
- HoneyHive.prototype.putPromptsId = function (req, config) {
2806
+ HoneyHive.prototype.putSessionSessionId = function (req, config) {
1953
2807
  var _a, _b;
1954
2808
  return __awaiter(this, void 0, void 0, function () {
1955
- var baseURL, url, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
2809
+ var baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
1956
2810
  var _d;
1957
2811
  return __generator(this, function (_e) {
1958
2812
  switch (_e.label) {
1959
2813
  case 0:
1960
2814
  if (!(req instanceof utils.SpeakeasyBase)) {
1961
- req = new operations.PutPromptsIdRequest(req);
2815
+ req = new operations.PutSessionSessionIdRequest(req);
1962
2816
  }
1963
2817
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
1964
- url = utils.generateURL(baseURL, "/prompts/{id}", req);
2818
+ operationUrl = utils.generateURL(baseURL, "/session/{session_id}", req);
1965
2819
  _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
1966
2820
  try {
1967
- _d = __read(utils.serializeRequestBody(req, "promptUpdateQuery", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
2821
+ _d = __read(utils.serializeRequestBody(req, "sessionEventUpdate", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
1968
2822
  }
1969
2823
  catch (e) {
1970
2824
  if (e instanceof Error) {
@@ -1984,30 +2838,28 @@ var HoneyHive = /** @class */ (function () {
1984
2838
  }
1985
2839
  properties = utils.parseSecurityProperties(globalSecurity);
1986
2840
  headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
1987
- if (reqBody == null)
1988
- throw new Error("request body is required");
1989
2841
  headers["Accept"] = "application/json";
1990
2842
  headers["user-agent"] = this.sdkConfiguration.userAgent;
1991
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "put", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
2843
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "put", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
1992
2844
  case 3:
1993
2845
  httpRes = _e.sent();
1994
- contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
2846
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
1995
2847
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
1996
2848
  throw new Error("status code not found in response: ".concat(httpRes));
1997
2849
  }
1998
- res = new operations.PutPromptsIdResponse({
2850
+ res = new operations.PutSessionSessionIdResponse({
1999
2851
  statusCode: httpRes.status,
2000
- contentType: contentType,
2852
+ contentType: responseContentType,
2001
2853
  rawResponse: httpRes,
2002
2854
  });
2003
2855
  decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
2004
2856
  switch (true) {
2005
2857
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
2006
- if (utils.matchContentType(contentType, "application/json")) {
2007
- res.promptResponse = utils.objectToClass(JSON.parse(decodedRes), shared.PromptResponse);
2858
+ if (utils.matchContentType(responseContentType, "application/json")) {
2859
+ res.successResponse = utils.objectToClass(JSON.parse(decodedRes), shared.SuccessResponse);
2008
2860
  }
2009
2861
  else {
2010
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
2862
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
2011
2863
  }
2012
2864
  break;
2013
2865
  case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
@@ -2025,7 +2877,7 @@ var HoneyHive = /** @class */ (function () {
2025
2877
  HoneyHive.prototype.putTasks = function (req, config) {
2026
2878
  var _a, _b;
2027
2879
  return __awaiter(this, void 0, void 0, function () {
2028
- var baseURL, url, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
2880
+ var baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
2029
2881
  var _d;
2030
2882
  return __generator(this, function (_e) {
2031
2883
  switch (_e.label) {
@@ -2034,7 +2886,7 @@ var HoneyHive = /** @class */ (function () {
2034
2886
  req = new shared.TaskUpdateQuery(req);
2035
2887
  }
2036
2888
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
2037
- url = baseURL.replace(/\/$/, "") + "/tasks";
2889
+ operationUrl = baseURL.replace(/\/$/, "") + "/tasks";
2038
2890
  _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
2039
2891
  try {
2040
2892
  _d = __read(utils.serializeRequestBody(req, "request", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
@@ -2061,26 +2913,26 @@ var HoneyHive = /** @class */ (function () {
2061
2913
  throw new Error("request body is required");
2062
2914
  headers["Accept"] = "application/json";
2063
2915
  headers["user-agent"] = this.sdkConfiguration.userAgent;
2064
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "put", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
2916
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "put", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
2065
2917
  case 3:
2066
2918
  httpRes = _e.sent();
2067
- contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
2919
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
2068
2920
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
2069
2921
  throw new Error("status code not found in response: ".concat(httpRes));
2070
2922
  }
2071
2923
  res = new operations.PutTasksResponse({
2072
2924
  statusCode: httpRes.status,
2073
- contentType: contentType,
2925
+ contentType: responseContentType,
2074
2926
  rawResponse: httpRes,
2075
2927
  });
2076
2928
  decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
2077
2929
  switch (true) {
2078
2930
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
2079
- if (utils.matchContentType(contentType, "application/json")) {
2931
+ if (utils.matchContentType(responseContentType, "application/json")) {
2080
2932
  res.taskUpdateResponse = utils.objectToClass(JSON.parse(decodedRes), shared.TaskUpdateResponse);
2081
2933
  }
2082
2934
  else {
2083
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
2935
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
2084
2936
  }
2085
2937
  break;
2086
2938
  case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||