@cloudbase/ai 2.23.0 → 2.23.1-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/ai",
3
- "version": "2.23.0",
3
+ "version": "2.23.1-beta.1",
4
4
  "description": "cloudbase js sdk ai module",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -30,8 +30,8 @@
30
30
  "author": "",
31
31
  "license": "Apache-2.0",
32
32
  "dependencies": {
33
- "@cloudbase/types": "2.23.0",
34
- "@cloudbase/utilities": "2.23.0",
33
+ "@cloudbase/types": "2.23.1-beta.1",
34
+ "@cloudbase/utilities": "2.23.1-beta.1",
35
35
  "@mattiasbuelens/web-streams-adapter": "^0.1.0",
36
36
  "text-encoding-shim": "^1.0.5",
37
37
  "web-streams-polyfill": "^4.0.0"
@@ -39,5 +39,5 @@
39
39
  "devDependencies": {
40
40
  "@cloudbase/adapter-interface": "^0.7.1"
41
41
  },
42
- "gitHead": "59b83d8d2037675a0dd771274287087f8c623df7"
42
+ "gitHead": "400c8f04a9d905c565c541f92d3a88eafff3a18e"
43
43
  }
package/src/AI.ts CHANGED
@@ -87,7 +87,7 @@ class AI {
87
87
  MODELS[name] = model
88
88
  }
89
89
 
90
- createImageModel<const T extends 'hunyuan-exp' | (string & {})>(provider: T) {
90
+ createImageModel<const T extends 'hunyuan-image' | (string & {})>(provider: T) {
91
91
  return new models.DefaultImageModel<T>(this.modelRequest, this.aiBaseUrl, provider)
92
92
  }
93
93
 
@@ -1,43 +1,43 @@
1
1
  import type {
2
2
  ModelReq,
3
3
  ImageGenerateInput,
4
- ImageEditInput,
4
+ // ImageEditInput,
5
5
  HunyuanGenerateImageInput,
6
6
  HunyuanGenerateImageOutput,
7
- HunyuanEditImageInput,
8
- HunyuanEditImageOutput,
7
+ // HunyuanEditImageInput,
8
+ // HunyuanEditImageOutput,
9
9
  } from '../type'
10
10
 
11
11
  // mock NoInfer
12
12
  type NoInfer<T> = [T][T extends any ? 0 : never]
13
13
 
14
14
  type GenerateImageInput<TProvider extends string, TInput = unknown> = unknown extends TInput
15
- ? TProvider extends 'hunyuan-exp'
15
+ ? TProvider extends 'hunyuan-image'
16
16
  ? HunyuanGenerateImageInput
17
17
  : ImageGenerateInput
18
18
  : TInput
19
19
 
20
20
  type GenerateImageOutput<TProvider extends string, TOutput = unknown> = unknown extends TOutput
21
- ? TProvider extends 'hunyuan-exp'
21
+ ? TProvider extends 'hunyuan-image'
22
22
  ? HunyuanGenerateImageOutput
23
23
  : unknown
24
24
  : TOutput
25
25
 
26
- type EditImageInput<T extends string, TInput = unknown> = unknown extends TInput
27
- ? T extends 'hunyuan-exp'
28
- ? HunyuanEditImageInput
29
- : ImageEditInput
30
- : TInput
26
+ // type EditImageInput<T extends string, TInput = unknown> = unknown extends TInput
27
+ // ? T extends 'hunyuan-image'
28
+ // ? HunyuanEditImageInput
29
+ // : ImageEditInput
30
+ // : TInput
31
31
 
32
- type EditImageOutput<T extends string, TOutput = unknown> = unknown extends TOutput
33
- ? T extends 'hunyuan-exp'
34
- ? HunyuanEditImageOutput
35
- : unknown
36
- : TOutput
32
+ // type EditImageOutput<T extends string, TOutput = unknown> = unknown extends TOutput
33
+ // ? T extends 'hunyuan-image'
34
+ // ? HunyuanEditImageOutput
35
+ // : unknown
36
+ // : TOutput
37
37
 
38
38
  export class DefaultImageModel<const TProvider extends string> {
39
39
  public generateImageSubUrl = 'images/generations'
40
- public editImageSubUrl = 'images/edits'
40
+ // public editImageSubUrl = 'images/edits'
41
41
 
42
42
  constructor(
43
43
  private req: ModelReq,
@@ -55,20 +55,20 @@ export class DefaultImageModel<const TProvider extends string> {
55
55
  return res as GenerateImageOutput<TProvider, TOutput>
56
56
  }
57
57
 
58
- public async editImage<TInput = unknown, TOutput = unknown>(input: NoInfer<EditImageInput<TProvider, TInput>>,): Promise<EditImageOutput<TProvider, TOutput>> {
59
- const res = await this.req({
60
- url: this.getEditUrl(),
61
- data: input,
62
- stream: false,
63
- })
64
- return res as EditImageOutput<TProvider, TOutput>
65
- }
58
+ // public async editImage<TInput = unknown, TOutput = unknown>(input: NoInfer<EditImageInput<TProvider, TInput>>,): Promise<EditImageOutput<TProvider, TOutput>> {
59
+ // const res = await this.req({
60
+ // url: this.getEditUrl(),
61
+ // data: input,
62
+ // stream: false,
63
+ // })
64
+ // return res as EditImageOutput<TProvider, TOutput>
65
+ // }
66
66
 
67
67
  private getGenerateUrl() {
68
68
  return `${this.baseUrl}/${this.provider}/${this.generateImageSubUrl}`
69
69
  }
70
70
 
71
- private getEditUrl() {
72
- return `${this.baseUrl}/${this.provider}/${this.editImageSubUrl}`
73
- }
71
+ // private getEditUrl() {
72
+ // return `${this.baseUrl}/${this.provider}/${this.editImageSubUrl}`
73
+ // }
74
74
  }