@layer-ai/sdk 2.1.1 → 2.2.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 CHANGED
@@ -1,10 +1,20 @@
1
1
  import type { LayerConfig, RequestOptions } from './types/index.js';
2
- import type { LayerRequestInput, LayerResponse } from './types/index.js';
2
+ import type { LayerRequestInput, LayerResponse, ChatRequest } from './types/index.js';
3
3
  export declare class Layer {
4
4
  private apiKey;
5
5
  private baseUrl;
6
6
  constructor(config: LayerConfig);
7
7
  request<T>(options: RequestOptions): Promise<T>;
8
8
  complete(request: LayerRequestInput): Promise<LayerResponse>;
9
+ /**
10
+ * v3 Chat completion endpoint - Type-safe chat requests
11
+ * @param request - Chat request with gateId and ChatRequest data
12
+ */
13
+ chat(request: {
14
+ gateId: string;
15
+ data: ChatRequest;
16
+ model?: string;
17
+ metadata?: Record<string, unknown>;
18
+ }): Promise<LayerResponse>;
9
19
  }
10
20
  //# sourceMappingURL=client.d.ts.map
@@ -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,MAAM,kBAAkB,CAAC;AAExF,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;CAOnE"}
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;AAErG,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;CAO3B"}
package/dist/client.js CHANGED
@@ -35,4 +35,15 @@ export class Layer {
35
35
  body: request,
36
36
  });
37
37
  }
38
+ /**
39
+ * v3 Chat completion endpoint - Type-safe chat requests
40
+ * @param request - Chat request with gateId and ChatRequest data
41
+ */
42
+ async chat(request) {
43
+ return this.request({
44
+ method: 'POST',
45
+ path: '/v3/chat',
46
+ body: request,
47
+ });
48
+ }
38
49
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@layer-ai/sdk",
3
- "version": "2.1.1",
3
+ "version": "2.2.0",
4
4
  "description": "Configure multiple AI models at runtime without code changes or deployments",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",