@stack-spot/portal-network 0.113.4 → 0.113.6

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.
@@ -0,0 +1,46 @@
1
+
2
+ import { HttpError } from '@oazapfts/runtime'
3
+ import apis from '../apis.json'
4
+ import { StackspotAPIError } from '../error/StackspotAPIError'
5
+ import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient'
6
+
7
+ import { defaults, deleteModelResourcesV1LlmResourcesResourceIdDelete, getModelV1LlmModelsModelIdGet, listModelsV1LlmModelsGet, saveOrUpdateModelResourcesV1LlmModelsModelIdResourcesPut, updateModelV1LlmModelsModelIdPatch } from '../api/genAiInference'
8
+ import { DefaultAPIError } from '../error/DefaultAPIError'
9
+ import { removeAuthorizationParam } from '../utils/remove-authorization-param'
10
+
11
+ class GenAiInference extends ReactQueryNetworkClient {
12
+ constructor() {
13
+ super(apis.genAiInference.url, defaults)
14
+ }
15
+
16
+ protected buildStackSpotError(error: HttpError): StackspotAPIError {
17
+ return new DefaultAPIError(error.data, error.status, { pt: {}, en:{} }, error.headers)
18
+ }
19
+
20
+ /**
21
+ * List all models.
22
+ */
23
+ listModels = this.query(removeAuthorizationParam(listModelsV1LlmModelsGet));
24
+
25
+ /**
26
+ * Gets model by ID.
27
+ */
28
+ getModel = this.query(removeAuthorizationParam(getModelV1LlmModelsModelIdGet));
29
+
30
+ /**
31
+ * Updates model by ID.
32
+ */
33
+ updateModel = this.mutation(removeAuthorizationParam(updateModelV1LlmModelsModelIdPatch));
34
+
35
+ /**
36
+ * Updates resources for a specific model ID.
37
+ */
38
+ updateModelResource = this.mutation(removeAuthorizationParam(saveOrUpdateModelResourcesV1LlmModelsModelIdResourcesPut));
39
+
40
+ /**
41
+ * Deletes a specific model resource by resource ID.
42
+ */
43
+ deleteModelResource = this.mutation(removeAuthorizationParam(deleteModelResourcesV1LlmResourcesResourceIdDelete));
44
+ }
45
+
46
+ export const genAiInferenceClient = new GenAiInference()
package/src/index.ts CHANGED
@@ -12,6 +12,7 @@ export { cloudServicesClient } from './client/cloud-services'
12
12
  export { codeShiftClient } from './client/code-shift'
13
13
  export { contentClient } from './client/content'
14
14
  export { eventBusClient } from './client/event-bus'
15
+ export { genAiInferenceClient } from './client/gen-ai-inference'
15
16
  export { insightsClient } from './client/insights'
16
17
  export { notificationClient } from './client/notification'
17
18
  export { runtimeManagerClient } from './client/runtime-manager'