@hautechai/sdk 0.0.3 → 0.0.4

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.
@@ -1,65 +1,77 @@
1
- import { SDKOptions, ListProps } from '../../types';
2
- import { GenerateV1Input, GenerateV3Input, GPTV1Input, InpaintV1Input, ObjectDetectionV1Input, UpscaleV1Input } from '../../autogenerated';
1
+ import { GenerateV1Input, GenerateV3Input, GPTV1Input, ImagineV1Input, InpaintV1Input, ObjectDetectionV1Input, OperationEntity, PoseEstimationV1Input, SegmentAnythingEmbeddingsV1Input, UpscaleV1Input } from '../../autogenerated';
2
+ import { ListProps, SDKOptions } from '../../types';
3
3
  declare const operations: (options: SDKOptions) => {
4
4
  create: {
5
5
  detect: {
6
6
  v1: (props: {
7
7
  input: ObjectDetectionV1Input;
8
8
  metadata?: any;
9
- }) => Promise<import("../../types").OperationEntity>;
9
+ }) => Promise<OperationEntity>;
10
+ };
11
+ estimatePose: {
12
+ v1: (props: {
13
+ input: PoseEstimationV1Input;
14
+ metadata?: any;
15
+ }) => Promise<OperationEntity>;
10
16
  };
11
17
  generate: {
12
18
  v1: (props: {
13
19
  input: GenerateV1Input;
14
20
  metadata?: any;
15
- }) => Promise<import("../../types").OperationEntity>;
21
+ }) => Promise<OperationEntity>;
16
22
  v3: (props: {
17
23
  input: GenerateV3Input;
18
24
  metadata?: any;
19
- }) => Promise<import("../../types").OperationEntity>;
25
+ }) => Promise<OperationEntity>;
20
26
  };
21
27
  gpt: {
22
28
  v1: (props: {
23
29
  input: GPTV1Input;
24
30
  metadata?: any;
25
- }) => Promise<import("../../types").OperationEntity>;
31
+ }) => Promise<OperationEntity>;
26
32
  };
27
33
  imagine: {
28
34
  v1: (props: {
29
- input: InpaintV1Input;
35
+ input: ImagineV1Input;
30
36
  metadata?: any;
31
- }) => Promise<import("../../types").OperationEntity>;
37
+ }) => Promise<OperationEntity>;
32
38
  };
33
39
  inpaint: {
34
40
  v1: (props: {
35
41
  input: InpaintV1Input;
36
42
  metadata?: any;
37
- }) => Promise<import("../../types").OperationEntity>;
43
+ }) => Promise<OperationEntity>;
44
+ };
45
+ segmentEmbeddings: {
46
+ v1: (props: {
47
+ input: SegmentAnythingEmbeddingsV1Input;
48
+ metadata?: any;
49
+ }) => Promise<OperationEntity>;
38
50
  };
39
51
  upscale: {
40
52
  v1: (props: {
41
53
  input: UpscaleV1Input;
42
54
  metadata?: any;
43
- }) => Promise<import("../../types").OperationEntity>;
55
+ }) => Promise<OperationEntity>;
44
56
  };
45
57
  };
46
58
  get: (props: {
47
59
  id: string;
48
- }) => Promise<import("../../types").OperationEntity | undefined>;
60
+ }) => Promise<OperationEntity | undefined>;
49
61
  getMany: (props: {
50
62
  ids: string[];
51
- }) => Promise<import("../../types").OperationEntity[]>;
63
+ }) => Promise<OperationEntity[]>;
52
64
  list: (props?: ListProps) => Promise<import("../../autogenerated").ListOperationsDto>;
53
65
  updateMetadata: (props: {
54
66
  id: string;
55
67
  metadata?: any;
56
- }) => Promise<import("../../types").ResourceEntity>;
68
+ }) => Promise<import("../../autogenerated").ResourceEntity>;
57
69
  updates: {
58
70
  subscribe: (props: {
59
- callback: (operation: import("../../types").OperationEntity) => void;
71
+ callback: (operation: OperationEntity) => void;
60
72
  }) => void;
61
73
  unsubscribe: (props: {
62
- callback: (operation: import("../../types").OperationEntity) => void;
74
+ callback: (operation: OperationEntity) => void;
63
75
  }) => void;
64
76
  };
65
77
  wait: (props: {
@@ -4,61 +4,33 @@ import { useAutogeneratedAPI } from '../api';
4
4
  const operations = (options) => {
5
5
  const api = useAutogeneratedAPI({ API: OperationsApi, options });
6
6
  const updates = createOperationUpdater(options);
7
+ const createOperation = (callMethod) => (props) => api.call({ run: (methods) => callMethod(methods, props) });
7
8
  return {
8
9
  create: {
9
10
  detect: {
10
- v1: (props) => api.call({
11
- run: (methods) => methods.operationsControllerRunObjectDetectionV1V1({
12
- input: props.input,
13
- metadata: props.metadata,
14
- }),
15
- }),
11
+ v1: createOperation((methods, props) => methods.operationsControllerRunObjectDetectionV1V1(props)),
12
+ },
13
+ estimatePose: {
14
+ v1: createOperation((methods, props) => methods.operationsControllerRunPoseEstimationV1V1(props)),
16
15
  },
17
16
  generate: {
18
- v1: (props) => api.call({
19
- run: (methods) => methods.operationsControllerRunGenerateV1V1({
20
- input: props.input,
21
- metadata: props.metadata,
22
- }),
23
- }),
24
- v3: (props) => api.call({
25
- run: (methods) => methods.operationsControllerRunGenerateV3V1({
26
- input: props.input,
27
- metadata: props.metadata,
28
- }),
29
- }),
17
+ v1: createOperation((methods, props) => methods.operationsControllerRunGenerateV1V1(props)),
18
+ v3: createOperation((methods, props) => methods.operationsControllerRunGenerateV3V1(props)),
30
19
  },
31
20
  gpt: {
32
- v1: (props) => api.call({
33
- run: (methods) => methods.operationsControllerRunGptV1V1({
34
- input: props.input,
35
- metadata: props.metadata,
36
- }),
37
- }),
21
+ v1: createOperation((methods, props) => methods.operationsControllerRunGptV1V1(props)),
38
22
  },
39
23
  imagine: {
40
- v1: (props) => api.call({
41
- run: (methods) => methods.operationsControllerRunImagineV1V1({
42
- input: props.input,
43
- metadata: props.metadata,
44
- }),
45
- }),
24
+ v1: createOperation((methods, props) => methods.operationsControllerRunImagineV1V1(props)),
46
25
  },
47
26
  inpaint: {
48
- v1: (props) => api.call({
49
- run: (methods) => methods.operationsControllerRunInpaintV1V1({
50
- input: props.input,
51
- metadata: props.metadata,
52
- }),
53
- }),
27
+ v1: createOperation((methods, props) => methods.operationsControllerRunInpaintV1V1(props)),
28
+ },
29
+ segmentEmbeddings: {
30
+ v1: createOperation((methods, props) => methods.operationsControllerRunSegmentAnythingEmbeddingsV1V1(props)),
54
31
  },
55
32
  upscale: {
56
- v1: (props) => api.call({
57
- run: (methods) => methods.operationsControllerRunUpscaleV1V1({
58
- input: props.input,
59
- metadata: props.metadata,
60
- }),
61
- }),
33
+ v1: createOperation((methods, props) => methods.operationsControllerRunUpscaleV1V1(props)),
62
34
  },
63
35
  },
64
36
  get: (props) => api.callWithReturningUndefinedOn404({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hautechai/sdk",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "license": "MIT",
5
5
  "keywords": [],
6
6
  "repository": {