@layer-ai/sdk 2.4.0 → 2.5.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 +31 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +33 -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, ImageGenerationRequest, VideoGenerationRequest } from './types/index.js';
|
|
2
|
+
import type { LayerRequestInput, LayerResponse, ChatRequest, ImageGenerationRequest, VideoGenerationRequest, EmbeddingsRequest, TextToSpeechRequest, OCRRequest } from './types/index.js';
|
|
3
3
|
export declare class Layer {
|
|
4
4
|
private apiKey;
|
|
5
5
|
private baseUrl;
|
|
@@ -36,5 +36,35 @@ export declare class Layer {
|
|
|
36
36
|
model?: string;
|
|
37
37
|
metadata?: Record<string, unknown>;
|
|
38
38
|
}): Promise<LayerResponse>;
|
|
39
|
+
/**
|
|
40
|
+
* v3 Embeddings endpoint - Type-safe embeddings requests
|
|
41
|
+
* @param request - Embeddings request with gateId and EmbeddingsRequest data
|
|
42
|
+
*/
|
|
43
|
+
embeddings(request: {
|
|
44
|
+
gateId: string;
|
|
45
|
+
data: EmbeddingsRequest;
|
|
46
|
+
model?: string;
|
|
47
|
+
metadata?: Record<string, unknown>;
|
|
48
|
+
}): Promise<LayerResponse>;
|
|
49
|
+
/**
|
|
50
|
+
* v3 Text-to-Speech endpoint - Type-safe TTS requests
|
|
51
|
+
* @param request - TTS request with gateId and TextToSpeechRequest data
|
|
52
|
+
*/
|
|
53
|
+
tts(request: {
|
|
54
|
+
gateId: string;
|
|
55
|
+
data: TextToSpeechRequest;
|
|
56
|
+
model?: string;
|
|
57
|
+
metadata?: Record<string, unknown>;
|
|
58
|
+
}): Promise<LayerResponse>;
|
|
59
|
+
/**
|
|
60
|
+
* v3 OCR endpoint - Type-safe OCR requests
|
|
61
|
+
* @param request - OCR request with gateId and OCRRequest data
|
|
62
|
+
*/
|
|
63
|
+
ocr(request: {
|
|
64
|
+
gateId: string;
|
|
65
|
+
data: OCRRequest;
|
|
66
|
+
model?: string;
|
|
67
|
+
metadata?: Record<string, unknown>;
|
|
68
|
+
}): Promise<LayerResponse>;
|
|
39
69
|
}
|
|
40
70
|
//# 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,sBAAsB,EAAE,sBAAsB,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,sBAAsB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEzM,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,CA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QACjB,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
|
@@ -68,4 +68,37 @@ export class Layer {
|
|
|
68
68
|
body: request,
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* v3 Embeddings endpoint - Type-safe embeddings requests
|
|
73
|
+
* @param request - Embeddings request with gateId and EmbeddingsRequest data
|
|
74
|
+
*/
|
|
75
|
+
async embeddings(request) {
|
|
76
|
+
return this.request({
|
|
77
|
+
method: 'POST',
|
|
78
|
+
path: '/v3/embeddings',
|
|
79
|
+
body: request,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* v3 Text-to-Speech endpoint - Type-safe TTS requests
|
|
84
|
+
* @param request - TTS request with gateId and TextToSpeechRequest data
|
|
85
|
+
*/
|
|
86
|
+
async tts(request) {
|
|
87
|
+
return this.request({
|
|
88
|
+
method: 'POST',
|
|
89
|
+
path: '/v3/tts',
|
|
90
|
+
body: request,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* v3 OCR endpoint - Type-safe OCR requests
|
|
95
|
+
* @param request - OCR request with gateId and OCRRequest data
|
|
96
|
+
*/
|
|
97
|
+
async ocr(request) {
|
|
98
|
+
return this.request({
|
|
99
|
+
method: 'POST',
|
|
100
|
+
path: '/v3/ocr',
|
|
101
|
+
body: request,
|
|
102
|
+
});
|
|
103
|
+
}
|
|
71
104
|
}
|