@layer-ai/sdk 2.2.0 → 2.3.0
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/dist/client.d.ts +11 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +11 -0
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { LayerConfig, RequestOptions } from './types/index.js';
|
|
2
|
-
import type { LayerRequestInput, LayerResponse, ChatRequest } from './types/index.js';
|
|
2
|
+
import type { LayerRequestInput, LayerResponse, ChatRequest, ImageGenerationRequest } from './types/index.js';
|
|
3
3
|
export declare class Layer {
|
|
4
4
|
private apiKey;
|
|
5
5
|
private baseUrl;
|
|
@@ -16,5 +16,15 @@ export declare class Layer {
|
|
|
16
16
|
model?: string;
|
|
17
17
|
metadata?: Record<string, unknown>;
|
|
18
18
|
}): Promise<LayerResponse>;
|
|
19
|
+
/**
|
|
20
|
+
* v3 Image generation endpoint - Type-safe image requests
|
|
21
|
+
* @param request - Image request with gateId and ImageGenerationRequest data
|
|
22
|
+
*/
|
|
23
|
+
image(request: {
|
|
24
|
+
gateId: string;
|
|
25
|
+
data: ImageGenerationRequest;
|
|
26
|
+
model?: string;
|
|
27
|
+
metadata?: Record<string, unknown>;
|
|
28
|
+
}): Promise<LayerResponse>;
|
|
19
29
|
}
|
|
20
30
|
//# sourceMappingURL=client.d.ts.map
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,KAAK,EAAiB,iBAAiB,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,KAAK,EAAiB,iBAAiB,EAAE,aAAa,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAE7H,qBAAa,KAAK;IAChB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,OAAO,CAAS;gBAEZ,MAAM,EAAE,WAAW;IAQlB,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,CAAC,CAAC;IA4BtD,QAAQ,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,aAAa,CAAC;IAQlE;;;OAGG;IACG,IAAI,CAAC,OAAO,EAAE;QAClB,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,WAAW,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACpC,GAAG,OAAO,CAAC,aAAa,CAAC;IAQ1B;;;OAGG;IACG,KAAK,CAAC,OAAO,EAAE;QACnB,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,sBAAsB,CAAC;QAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACpC,GAAG,OAAO,CAAC,aAAa,CAAC;CAO3B"}
|
package/dist/client.js
CHANGED
|
@@ -46,4 +46,15 @@ export class Layer {
|
|
|
46
46
|
body: request,
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* v3 Image generation endpoint - Type-safe image requests
|
|
51
|
+
* @param request - Image request with gateId and ImageGenerationRequest data
|
|
52
|
+
*/
|
|
53
|
+
async image(request) {
|
|
54
|
+
return this.request({
|
|
55
|
+
method: 'POST',
|
|
56
|
+
path: '/v3/image',
|
|
57
|
+
body: request,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
49
60
|
}
|