@eaziz/prepare 0.1.1 → 0.1.3

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.
Files changed (86) hide show
  1. package/README.md +8 -2
  2. package/dist/address.d.ts +12 -0
  3. package/dist/address.d.ts.map +1 -0
  4. package/dist/address.js +16 -0
  5. package/dist/address.js.map +1 -0
  6. package/dist/contracts.d.ts +3 -46
  7. package/dist/contracts.d.ts.map +1 -1
  8. package/dist/headers.d.ts +2 -0
  9. package/dist/headers.d.ts.map +1 -0
  10. package/dist/headers.js +8 -0
  11. package/dist/headers.js.map +1 -0
  12. package/dist/index.d.ts +6 -2
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js +6 -2
  15. package/dist/index.js.map +1 -1
  16. package/dist/media-codecs.d.ts +5 -0
  17. package/dist/media-codecs.d.ts.map +1 -0
  18. package/dist/media-codecs.js +30 -0
  19. package/dist/media-codecs.js.map +1 -0
  20. package/dist/protocol-capabilities.d.ts +111 -0
  21. package/dist/protocol-capabilities.d.ts.map +1 -0
  22. package/dist/protocol-capabilities.js +58 -0
  23. package/dist/protocol-capabilities.js.map +1 -0
  24. package/dist/protocol-registry.d.ts +60 -0
  25. package/dist/protocol-registry.d.ts.map +1 -0
  26. package/dist/protocol-registry.js +89 -0
  27. package/dist/protocol-registry.js.map +1 -0
  28. package/dist/protocols/catalog.d.ts +4 -8
  29. package/dist/protocols/catalog.d.ts.map +1 -1
  30. package/dist/protocols/catalog.js +3 -10
  31. package/dist/protocols/catalog.js.map +1 -1
  32. package/dist/protocols/images.d.ts +4 -8
  33. package/dist/protocols/images.d.ts.map +1 -1
  34. package/dist/protocols/images.js +13 -17
  35. package/dist/protocols/images.js.map +1 -1
  36. package/dist/protocols/media.d.ts +2 -1
  37. package/dist/protocols/media.d.ts.map +1 -1
  38. package/dist/protocols/media.js +38 -12
  39. package/dist/protocols/media.js.map +1 -1
  40. package/dist/protocols/realtime.d.ts +7 -0
  41. package/dist/protocols/realtime.d.ts.map +1 -0
  42. package/dist/protocols/realtime.js +13 -0
  43. package/dist/protocols/realtime.js.map +1 -0
  44. package/dist/protocols/speech.d.ts +19 -0
  45. package/dist/protocols/speech.d.ts.map +1 -0
  46. package/dist/protocols/speech.js +77 -0
  47. package/dist/protocols/speech.js.map +1 -0
  48. package/dist/protocols/text.d.ts +13 -6
  49. package/dist/protocols/text.d.ts.map +1 -1
  50. package/dist/protocols/text.js +14 -133
  51. package/dist/protocols/text.js.map +1 -1
  52. package/dist/protocols/transcription.d.ts +16 -0
  53. package/dist/protocols/transcription.d.ts.map +1 -0
  54. package/dist/protocols/transcription.js +53 -0
  55. package/dist/protocols/transcription.js.map +1 -0
  56. package/dist/protocols/video.d.ts +17 -0
  57. package/dist/protocols/video.d.ts.map +1 -0
  58. package/dist/protocols/video.js +36 -0
  59. package/dist/protocols/video.js.map +1 -0
  60. package/dist/request-builders/http.d.ts +24 -0
  61. package/dist/request-builders/http.d.ts.map +1 -0
  62. package/dist/request-builders/http.js +20 -0
  63. package/dist/request-builders/http.js.map +1 -0
  64. package/dist/request-builders/multipart.d.ts +5 -0
  65. package/dist/request-builders/multipart.d.ts.map +1 -0
  66. package/dist/request-builders/multipart.js +9 -0
  67. package/dist/request-builders/multipart.js.map +1 -0
  68. package/dist/request-builders/websocket.d.ts +12 -0
  69. package/dist/request-builders/websocket.d.ts.map +1 -0
  70. package/dist/request-builders/websocket.js +22 -0
  71. package/dist/request-builders/websocket.js.map +1 -0
  72. package/dist/request-builders.d.ts +13 -0
  73. package/dist/request-builders.d.ts.map +1 -0
  74. package/dist/request-builders.js +9 -0
  75. package/dist/request-builders.js.map +1 -0
  76. package/dist/request-compiler.d.ts +10 -12
  77. package/dist/request-compiler.d.ts.map +1 -1
  78. package/dist/request-compiler.js +2 -100
  79. package/dist/request-compiler.js.map +1 -1
  80. package/dist/request-types.d.ts +126 -62
  81. package/dist/request-types.d.ts.map +1 -1
  82. package/dist/request-utils.d.ts +5 -28
  83. package/dist/request-utils.d.ts.map +1 -1
  84. package/dist/request-utils.js +5 -78
  85. package/dist/request-utils.js.map +1 -1
  86. package/package.json +1 -1
package/README.md CHANGED
@@ -1,6 +1,12 @@
1
1
  # @eaziz/prepare
2
2
 
3
- 一个零运行时依赖的 AI 请求编译器。它把统一语义输入转换成指定协议的 `method`、`path`、`headers` 和 `body`,但不发送网络请求,也不绑定任何 Provider 或网关。
3
+ 一个零运行时依赖的 AI 请求编译器。它把协议原生输入编译成指定协议的 `method`、`path`、`headers` 和 `body`,但不发送网络请求,也不绑定任何 Provider 或网关。
4
+
5
+ `input` 使用所选协议的原生字段和嵌套结构,例如 OpenAI Chat Completions 使用 `max_tokens`,Gemini 使用 `generationConfig`。编译器不会在协议之间做字段命名或消息结构转换。
6
+
7
+ `model` 仍位于请求外层,由编译器写入需要它的协议请求;其余请求字段都放在 `input` 中。
8
+
9
+ 这意味着 `maxTokens`、`topP`、`extraBody` 等旧的统一字段不会再被解释或转换;需要扩展协议请求时,直接把协议字段放进 `input`。
4
10
 
5
11
  ## 安装
6
12
 
@@ -19,7 +25,7 @@ const prepared = prepare({
19
25
  model: 'my-model',
20
26
  input: {
21
27
  messages: [{ role: 'user', content: '你好' }],
22
- maxTokens: 4096,
28
+ max_tokens: 4096,
23
29
  },
24
30
  });
25
31
 
@@ -0,0 +1,12 @@
1
+ export type RequestAddress = Readonly<{
2
+ baseURL?: string;
3
+ endpoint?: string;
4
+ headers?: HeadersInit;
5
+ }>;
6
+ export declare function requestURL(request: Pick<RequestAddress, "baseURL" | "endpoint">, path: string): {
7
+ readonly url?: string;
8
+ };
9
+ export declare function baseURLRequestURL(request: Pick<RequestAddress, "baseURL">, path: string): {
10
+ readonly url?: string;
11
+ };
12
+ //# sourceMappingURL=address.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../src/address.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,WAAW,CAAA;CAAE,CAAC,CAAC;AACtG,wBAAgB,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,cAAc,EAAE,SAAS,GAAG,UAAU,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG;IAAE,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,CAIzH;AACD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG;IAAE,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,CAGnH"}
@@ -0,0 +1,16 @@
1
+ export function requestURL(request, path) {
2
+ if (request.endpoint)
3
+ return { url: request.endpoint };
4
+ if (!request.baseURL)
5
+ return {};
6
+ return { url: joinURL(request.baseURL, path) };
7
+ }
8
+ export function baseURLRequestURL(request, path) {
9
+ if (!request.baseURL)
10
+ return {};
11
+ return { url: joinURL(request.baseURL, path) };
12
+ }
13
+ function joinURL(baseURL, path) {
14
+ return `${baseURL.replace(/\/$/, "")}/${path.replace(/^\//, "")}`;
15
+ }
16
+ //# sourceMappingURL=address.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"address.js","sourceRoot":"","sources":["../src/address.ts"],"names":[],"mappings":"AACA,MAAM,UAAU,UAAU,CAAC,OAAqD,EAAE,IAAY;IAC5F,IAAI,OAAO,CAAC,QAAQ;QAAE,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC;IACvD,IAAI,CAAC,OAAO,CAAC,OAAO;QAAE,OAAO,EAAE,CAAC;IAChC,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC;AACjD,CAAC;AACD,MAAM,UAAU,iBAAiB,CAAC,OAAwC,EAAE,IAAY;IACtF,IAAI,CAAC,OAAO,CAAC,OAAO;QAAE,OAAO,EAAE,CAAC;IAChC,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC;AACjD,CAAC;AACD,SAAS,OAAO,CAAC,OAAe,EAAE,IAAY;IAC5C,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE,CAAC;AACpE,CAAC"}
@@ -1,51 +1,8 @@
1
1
  export type ProtocolMetadata = Readonly<Record<string, unknown>>;
2
+ export type Transport = "http" | "http-stream" | "websocket";
2
3
  export type ModelType = "text-generation" | "multimodal-generation" | "embedding" | "rerank" | "image-generation" | "image-editing" | "speech-generation" | "transcription" | "video-generation" | "realtime";
3
- export type WireProtocol = "openai-chat-completions" | "openai-responses" | "anthropic-messages" | "gemini-generate-content" | "openai-embeddings" | "cohere-rerank" | "openai-images" | "openai-audio" | "dashscope-audio" | "dashscope-transcription" | "volcengine-audio" | "xfyun-audio" | "zhipu-audio" | "minimax-audio" | "dashscope-video" | "volcengine-video" | "openai-responses-websocket" | "openai-realtime";
4
- export type MessageRole = "system" | "developer" | "user" | "assistant" | "tool";
5
- export interface TextPart {
6
- readonly type: "text";
7
- readonly text: string;
8
- }
9
- export interface ImagePart {
10
- readonly type: "image";
11
- readonly image: string | Uint8Array;
12
- readonly mediaType?: string;
13
- readonly detail?: "auto" | "low" | "high";
14
- }
15
- export interface AudioPart {
16
- readonly type: "audio";
17
- readonly audio: string | Uint8Array;
18
- readonly mediaType?: string;
19
- }
20
- export interface FilePart {
21
- readonly type: "file";
22
- readonly file: string | Uint8Array;
23
- readonly mediaType?: string;
24
- readonly filename?: string;
25
- }
26
- export interface RawPart {
27
- readonly type: "raw";
28
- readonly protocol: WireProtocol;
29
- readonly value: unknown;
30
- }
31
- export type ContentPart = TextPart | ImagePart | AudioPart | FilePart | RawPart;
32
- export interface Message {
33
- readonly role: MessageRole;
34
- readonly content: string | readonly ContentPart[];
35
- readonly name?: string;
36
- readonly toolCallId?: string;
37
- readonly protocolMetadata?: ProtocolMetadata;
38
- }
39
- export interface JSONSchema {
40
- readonly [key: string]: unknown;
41
- }
42
- export interface ToolDefinition {
43
- readonly type?: "function";
44
- readonly name: string;
45
- readonly description?: string;
46
- readonly parameters: JSONSchema;
47
- readonly strict?: boolean;
48
- }
4
+ /** Canonical protocol names have one source: protocol-registry.ts. */
5
+ export type WireProtocol = import("./protocol-registry.js").ProtocolFor<ModelType>;
49
6
  export interface ModelProfile {
50
7
  readonly id: string;
51
8
  readonly modelType: ModelType;
@@ -1 +1 @@
1
- {"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAEjE,MAAM,MAAM,SAAS,GACjB,iBAAiB,GACjB,uBAAuB,GACvB,WAAW,GACX,QAAQ,GACR,kBAAkB,GAClB,eAAe,GACf,mBAAmB,GACnB,eAAe,GACf,kBAAkB,GAClB,UAAU,CAAC;AAEf,MAAM,MAAM,YAAY,GACpB,yBAAyB,GACzB,kBAAkB,GAClB,oBAAoB,GACpB,yBAAyB,GACzB,mBAAmB,GACnB,eAAe,GACf,eAAe,GACf,cAAc,GACd,iBAAiB,GACjB,yBAAyB,GACzB,kBAAkB,GAClB,aAAa,GACb,aAAa,GACb,eAAe,GACf,iBAAiB,GACjB,kBAAkB,GAClB,4BAA4B,GAC5B,iBAAiB,CAAC;AAEtB,MAAM,MAAM,WAAW,GACnB,QAAQ,GACR,WAAW,GACX,MAAM,GACN,WAAW,GACX,MAAM,CAAC;AAEX,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,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AC5C,QAAQ,CAAC,QAAQ,CAAC,EAAE,gBAAgB,CAAC;CACtC"}
@@ -0,0 +1,2 @@
1
+ export declare function headerRecord(headers?: HeadersInit): Record<string, string>;
2
+ //# sourceMappingURL=headers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"headers.d.ts","sourceRoot":"","sources":["../src/headers.ts"],"names":[],"mappings":"AAAA,wBAAgB,YAAY,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAK1E"}
@@ -0,0 +1,8 @@
1
+ export function headerRecord(headers) {
2
+ const result = {};
3
+ if (!headers)
4
+ return result;
5
+ new Headers(headers).forEach((value, key) => { result[key] = value; });
6
+ return result;
7
+ }
8
+ //# sourceMappingURL=headers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"headers.js","sourceRoot":"","sources":["../src/headers.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,YAAY,CAAC,OAAqB;IAChD,MAAM,MAAM,GAA2B,EAAE,CAAC;IAC1C,IAAI,CAAC,OAAO;QAAE,OAAO,MAAM,CAAC;IAC5B,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACvE,OAAO,MAAM,CAAC;AAChB,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,3 +1,7 @@
1
- export * from './contracts.js';
2
- export * from './request-compiler.js';
1
+ export * from "./contracts.js";
2
+ export * from "./request-compiler.js";
3
+ export * from "./protocol-registry.js";
4
+ export * from "./request-builders/http.js";
5
+ export * from "./request-builders/websocket.js";
6
+ export * from "./request-builders/multipart.js";
3
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC"}
package/dist/index.js CHANGED
@@ -1,3 +1,7 @@
1
- export * from './contracts.js';
2
- export * from './request-compiler.js';
1
+ export * from "./contracts.js";
2
+ export * from "./request-compiler.js";
3
+ export * from "./protocol-registry.js";
4
+ export * from "./request-builders/http.js";
5
+ export * from "./request-builders/websocket.js";
6
+ export * from "./request-builders/multipart.js";
3
7
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare function dataURL(value: string | Uint8Array, mediaType: string): string;
2
+ export declare function stripDataURL(value: string): string;
3
+ export declare function toBase64(bytes: Uint8Array): string;
4
+ export declare function mediaBlob(value: Blob | Uint8Array | string): Blob;
5
+ //# sourceMappingURL=media-codecs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media-codecs.d.ts","sourceRoot":"","sources":["../src/media-codecs.ts"],"names":[],"mappings":"AAAA,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAE7E;AACD,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAGlD;AACD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAKlD;AACD,wBAAgB,SAAS,CAAC,KAAK,EAAE,IAAI,GAAG,UAAU,GAAG,MAAM,GAAG,IAAI,CAWjE"}
@@ -0,0 +1,30 @@
1
+ export function dataURL(value, mediaType) {
2
+ return typeof value === "string" ? value : `data:${mediaType};base64,${toBase64(value)}`;
3
+ }
4
+ export function stripDataURL(value) {
5
+ const comma = value.indexOf(",");
6
+ return value.startsWith("data:") && comma >= 0 ? value.slice(comma + 1) : value;
7
+ }
8
+ export function toBase64(bytes) {
9
+ if (typeof Buffer !== "undefined")
10
+ return Buffer.from(bytes).toString("base64");
11
+ let binary = "";
12
+ for (const byte of bytes)
13
+ binary += String.fromCharCode(byte);
14
+ return btoa(binary);
15
+ }
16
+ export function mediaBlob(value) {
17
+ if (value instanceof Blob)
18
+ return value;
19
+ if (value instanceof Uint8Array)
20
+ return new Blob([new Uint8Array(value).buffer]);
21
+ if (value.startsWith("data:")) {
22
+ const match = /^data:([^;,]+)?;base64,(.*)$/.exec(value);
23
+ if (match?.[2]) {
24
+ const bytes = typeof Buffer !== "undefined" ? new Uint8Array(Buffer.from(match[2], "base64")) : Uint8Array.from(atob(match[2]), c => c.charCodeAt(0));
25
+ return new Blob([bytes], { type: match[1] ?? "application/octet-stream" });
26
+ }
27
+ }
28
+ return new Blob([value]);
29
+ }
30
+ //# sourceMappingURL=media-codecs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media-codecs.js","sourceRoot":"","sources":["../src/media-codecs.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,OAAO,CAAC,KAA0B,EAAE,SAAiB;IACnE,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,SAAS,W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AC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;YACtJ,OAAO,IAAI,IAAI,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,0BAA0B,EAAE,CAAC,CAAC;QAC7E,CAAC;IACH,CAAC;IACD,OAAO,IAAI,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;AAC3B,CAAC"}
@@ -0,0 +1,111 @@
1
+ import type { ModelType, Transport, WireProtocol } from "./contracts.js";
2
+ export interface ProtocolCapability {
3
+ readonly protocol: WireProtocol;
4
+ readonly transport: Transport;
5
+ readonly statusPath?: string;
6
+ readonly taskIdPath?: string;
7
+ readonly resultPath?: string;
8
+ }
9
+ /** Wire facts belong to prepare; the same protocol can differ by operation. */
10
+ export declare const PROTOCOL_CAPABILITIES: {
11
+ readonly "text-generation": readonly [{
12
+ readonly protocol: "openai-chat-completions";
13
+ readonly transport: "http";
14
+ }, {
15
+ readonly protocol: "openai-responses";
16
+ readonly transport: "http";
17
+ }, {
18
+ readonly protocol: "anthropic-messages";
19
+ readonly transport: "http";
20
+ }, {
21
+ readonly protocol: "gemini-generate-content";
22
+ readonly transport: "http";
23
+ }];
24
+ readonly "multimodal-generation": readonly [{
25
+ readonly protocol: "openai-chat-completions";
26
+ readonly transport: "http";
27
+ }, {
28
+ readonly protocol: "openai-responses";
29
+ readonly transport: "http";
30
+ }, {
31
+ readonly protocol: "anthropic-messages";
32
+ readonly transport: "http";
33
+ }, {
34
+ readonly protocol: "gemini-generate-content";
35
+ readonly transport: "http";
36
+ }];
37
+ readonly embedding: readonly [{
38
+ readonly protocol: "openai-embeddings";
39
+ readonly transport: "http";
40
+ }];
41
+ readonly rerank: readonly [{
42
+ readonly protocol: "cohere-rerank";
43
+ readonly transport: "http";
44
+ }];
45
+ readonly "image-generation": readonly [{
46
+ readonly protocol: "openai-images";
47
+ readonly transport: "http";
48
+ }];
49
+ readonly "image-editing": readonly [{
50
+ readonly protocol: "openai-images";
51
+ readonly transport: "http";
52
+ }];
53
+ readonly "speech-generation": readonly [{
54
+ readonly protocol: "openai-audio";
55
+ readonly transport: "http";
56
+ }, {
57
+ readonly protocol: "dashscope-audio";
58
+ readonly transport: "http";
59
+ }, {
60
+ readonly protocol: "volcengine-audio";
61
+ readonly transport: "http-stream";
62
+ }, {
63
+ readonly protocol: "xfyun-audio";
64
+ readonly transport: "websocket";
65
+ }, {
66
+ readonly protocol: "zhipu-audio";
67
+ readonly transport: "http";
68
+ }, {
69
+ readonly protocol: "minimax-audio";
70
+ readonly transport: "http";
71
+ }];
72
+ readonly transcription: readonly [{
73
+ readonly protocol: "openai-audio";
74
+ readonly transport: "http";
75
+ }, {
76
+ readonly protocol: "volcengine-audio";
77
+ readonly transport: "websocket";
78
+ }, {
79
+ readonly protocol: "zhipu-audio";
80
+ readonly transport: "http";
81
+ }, {
82
+ readonly protocol: "dashscope-transcription";
83
+ readonly transport: "http";
84
+ }];
85
+ readonly "video-generation": readonly [{
86
+ readonly protocol: "dashscope-video";
87
+ readonly transport: "http";
88
+ readonly statusPath: "/api/v1/tasks/{taskId}";
89
+ readonly taskIdPath: "output.task_id";
90
+ readonly resultPath: "output.video_url";
91
+ }, {
92
+ readonly protocol: "volcengine-video";
93
+ readonly transport: "http";
94
+ readonly statusPath: "/api/v3/contents/generations/tasks/{taskId}";
95
+ readonly taskIdPath: "id";
96
+ readonly resultPath: "content.video_url";
97
+ }];
98
+ readonly realtime: readonly [{
99
+ readonly protocol: "openai-responses-websocket";
100
+ readonly transport: "websocket";
101
+ }, {
102
+ readonly protocol: "openai-realtime";
103
+ readonly transport: "websocket";
104
+ }];
105
+ };
106
+ export type ProtocolFor<TModelType extends ModelType> = (typeof PROTOCOL_CAPABILITIES)[TModelType][number]["protocol"];
107
+ /** Derived discovery view; compiler gates and consumers use the same registry. */
108
+ export declare const PROTOCOLS_BY_MODEL_TYPE: { readonly [T in ModelType]: readonly ProtocolFor<T>[]; };
109
+ export declare const SUPPORTED_WIRE_PROTOCOLS: readonly WireProtocol[];
110
+ export declare function getProtocolCapability<T extends ModelType>(modelType: T, protocol: WireProtocol): (typeof PROTOCOL_CAPABILITIES)[T][number];
111
+ //# sourceMappingURL=protocol-capabilities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protocol-capabilities.d.ts","sourceRoot":"","sources":["../src/protocol-capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEzE,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC;IAChC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B;AASD,+EAA+E;AAC/E,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6B6C,CAAC;AAEhF,MAAM,MAAM,WAAW,CAAC,UAAU,SAAS,SAAS,IAClD,CAAC,OAAO,qBAAqB,CAAC,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,CAAC;AAEjE,kFAAkF;AAClF,eAAO,MAAM,uBAAuB,EAI9B,EAAE,QAAQ,EAAE,CAAC,IAAI,SAAS,GAAG,SAAS,WAAW,CAAC,CAAC,CAAC,EAAE,GAAE,CAAC;AAE/D,eAAO,MAAM,wBAAwB,EAAE,SAAS,YAAY,EAE3D,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,SAAS,EACvD,SAAS,EAAE,CAAC,EACZ,QAAQ,EAAE,YAAY,GACrB,CAAC,OAAO,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAO3C"}
@@ -0,0 +1,58 @@
1
+ const text = [
2
+ { protocol: "openai-chat-completions", transport: "http" },
3
+ { protocol: "openai-responses", transport: "http" },
4
+ { protocol: "anthropic-messages", transport: "http" },
5
+ { protocol: "gemini-generate-content", transport: "http" },
6
+ ];
7
+ /** Wire facts belong to prepare; the same protocol can differ by operation. */
8
+ export const PROTOCOL_CAPABILITIES = {
9
+ "text-generation": text,
10
+ "multimodal-generation": text,
11
+ embedding: [{ protocol: "openai-embeddings", transport: "http" }],
12
+ rerank: [{ protocol: "cohere-rerank", transport: "http" }],
13
+ "image-generation": [{ protocol: "openai-images", transport: "http" }],
14
+ "image-editing": [{ protocol: "openai-images", transport: "http" }],
15
+ "speech-generation": [
16
+ { protocol: "openai-audio", transport: "http" },
17
+ { protocol: "dashscope-audio", transport: "http" },
18
+ { protocol: "volcengine-audio", transport: "http-stream" },
19
+ { protocol: "xfyun-audio", transport: "websocket" },
20
+ { protocol: "zhipu-audio", transport: "http" },
21
+ { protocol: "minimax-audio", transport: "http" },
22
+ ],
23
+ transcription: [
24
+ { protocol: "openai-audio", transport: "http" },
25
+ { protocol: "volcengine-audio", transport: "websocket" },
26
+ { protocol: "zhipu-audio", transport: "http" },
27
+ { protocol: "dashscope-transcription", transport: "http" },
28
+ ],
29
+ "video-generation": [
30
+ { protocol: "dashscope-video", transport: "http", statusPath: "/api/v1/tasks/{taskId}", taskIdPath: "output.task_id", resultPath: "output.video_url" },
31
+ { protocol: "volcengine-video", transport: "http", statusPath: "/api/v3/contents/generations/tasks/{taskId}", taskIdPath: "id", resultPath: "content.video_url" },
32
+ ],
33
+ realtime: [
34
+ { protocol: "openai-responses-websocket", transport: "websocket" },
35
+ { protocol: "openai-realtime", transport: "websocket" },
36
+ ],
37
+ };
38
+ /** Derived discovery view; compiler gates and consumers use the same registry. */
39
+ export const PROTOCOLS_BY_MODEL_TYPE = Object.freeze(Object.fromEntries(Object.entries(PROTOCOL_CAPABILITIES).map(([modelType, capabilities]) => [
40
+ modelType, Object.freeze(capabilities.map(({ protocol }) => protocol)),
41
+ ])));
42
+ export const SUPPORTED_WIRE_PROTOCOLS = Object.freeze([...new Set(Object.values(PROTOCOLS_BY_MODEL_TYPE).flat())]);
43
+ export function getProtocolCapability(modelType, protocol) {
44
+ const capabilities = PROTOCOL_CAPABILITIES[modelType];
45
+ const capability = capabilities.find((item) => item.protocol === protocol);
46
+ if (!capability) {
47
+ throw new Error(`Protocol "${protocol}" cannot handle model type "${modelType}".`);
48
+ }
49
+ return capability;
50
+ }
51
+ // Protect the shared registry from accidental consumer mutation.
52
+ for (const capabilities of Object.values(PROTOCOL_CAPABILITIES)) {
53
+ for (const capability of capabilities)
54
+ Object.freeze(capability);
55
+ Object.freeze(capabilities);
56
+ }
57
+ Object.freeze(PROTOCOL_CAPABILITIES);
58
+ //# sourceMappingURL=protocol-capabilities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protocol-capabilities.js","sourceRoot":"","sources":["../src/protocol-capabilities.ts"],"names":[],"mappings":"AAUA,MAAM,IAAI,GAAG;IACX,EAAE,QAAQ,EAAE,yBAAyB,EAAE,SAAS,EAAE,MAAM,EAAE;IAC1D,EAAE,QAAQ,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,EAAE;IACnD,EAAE,QAAQ,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,EAAE;IACrD,EAAE,QAAQ,EAAE,yBAAyB,EAAE,SAAS,EAAE,MAAM,EAAE;CAClD,CAAC;AAEX,+EAA+E;AAC/E,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,iBAAiB,EAAE,IAAI;IACvB,uBAAuB,EAAE,IAAI;IAC7B,SAAS,E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Y,IAAI,MAAM,CAAC,MAAM,CAAC,qBAAqB,CAAC,EAAE,CAAC;IAChE,KAAK,MAAM,UAAU,IAAI,YAAY;QAAE,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IACjE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;AAC9B,CAAC;AACD,MAAM,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC"}
@@ -0,0 +1,60 @@
1
+ import type { ModelType, Transport } from "./contracts.js";
2
+ import type { ProtocolRequest, RequestPreparation } from "./request-types.js";
3
+ import type { PreparedRequest } from "./request-builders/http.js";
4
+ import { type PreparedSpeechRequest } from "./protocols/speech.js";
5
+ import { type PreparedTranscriptionRequest } from "./protocols/transcription.js";
6
+ import { type PreparedVideoRequest } from "./protocols/video.js";
7
+ export interface ProtocolLifecycle {
8
+ readonly statusPath: string;
9
+ readonly taskIdPath: string;
10
+ readonly resultPath: string;
11
+ }
12
+ export interface ProtocolContext {
13
+ readonly transport: Transport;
14
+ readonly lifecycle?: ProtocolLifecycle;
15
+ }
16
+ export interface PreparedByModelType {
17
+ readonly "text-generation": PreparedRequest;
18
+ readonly "multimodal-generation": PreparedRequest;
19
+ readonly embedding: PreparedRequest;
20
+ readonly rerank: PreparedRequest;
21
+ readonly "image-generation": PreparedRequest;
22
+ readonly "image-editing": PreparedRequest;
23
+ readonly "speech-generation": PreparedSpeechRequest;
24
+ readonly transcription: PreparedTranscriptionRequest;
25
+ readonly "video-generation": PreparedVideoRequest;
26
+ readonly realtime: PreparedRequest;
27
+ }
28
+ export interface ProtocolCapability {
29
+ readonly protocol: string;
30
+ readonly modelTypes: readonly ModelType[];
31
+ readonly transport: Transport;
32
+ readonly lifecycle?: ProtocolLifecycle;
33
+ readonly prepare: (request: any) => any;
34
+ }
35
+ type DefinedCapability<M extends ModelType, P extends string> = {
36
+ readonly protocol: P;
37
+ readonly modelTypes: readonly M[];
38
+ readonly transport: Transport;
39
+ readonly lifecycle?: ProtocolLifecycle;
40
+ readonly prepare: (request: ProtocolRequest<M, P>) => PreparedByModelType[M];
41
+ };
42
+ export declare const PROTOCOL_REGISTRY: {
43
+ readonly "text-generation": (DefinedCapability<"text-generation" | "multimodal-generation", "openai-chat-completions"> | DefinedCapability<"text-generation" | "multimodal-generation", "openai-responses"> | DefinedCapability<"text-generation" | "multimodal-generation", "anthropic-messages"> | DefinedCapability<"text-generation" | "multimodal-generation", "gemini-generate-content">)[];
44
+ readonly "multimodal-generation": (DefinedCapability<"text-generation" | "multimodal-generation", "openai-chat-completions"> | DefinedCapability<"text-generation" | "multimodal-generation", "openai-responses"> | DefinedCapability<"text-generation" | "multimodal-generation", "anthropic-messages"> | DefinedCapability<"text-generation" | "multimodal-generation", "gemini-generate-content">)[];
45
+ readonly embedding: readonly [DefinedCapability<"embedding", "openai-embeddings">];
46
+ readonly rerank: readonly [DefinedCapability<"rerank", "cohere-rerank">];
47
+ readonly "image-generation": readonly [DefinedCapability<"image-generation", "openai-images">];
48
+ readonly "image-editing": readonly [DefinedCapability<"image-editing", "openai-images">];
49
+ readonly "speech-generation": readonly [DefinedCapability<"speech-generation", "openai-audio">, DefinedCapability<"speech-generation", "dashscope-audio">, DefinedCapability<"speech-generation", "volcengine-audio">, DefinedCapability<"speech-generation", "xfyun-audio">, DefinedCapability<"speech-generation", "zhipu-audio">, DefinedCapability<"speech-generation", "minimax-audio">];
50
+ readonly transcription: readonly [DefinedCapability<"transcription", "openai-audio">, DefinedCapability<"transcription", "volcengine-audio">, DefinedCapability<"transcription", "zhipu-audio">, DefinedCapability<"transcription", "dashscope-transcription">];
51
+ readonly "video-generation": readonly [DefinedCapability<"video-generation", "dashscope-video">, DefinedCapability<"video-generation", "volcengine-video">];
52
+ readonly realtime: readonly [DefinedCapability<"realtime", "openai-responses-websocket">, DefinedCapability<"realtime", "openai-realtime">];
53
+ };
54
+ export type ProtocolFor<T extends ModelType> = (typeof PROTOCOL_REGISTRY)[T][number]["protocol"];
55
+ export declare const PROTOCOLS_BY_MODEL_TYPE: { readonly [T in ModelType]: readonly ProtocolFor<T>[]; };
56
+ export declare const SUPPORTED_WIRE_PROTOCOLS: readonly ProtocolFor<ModelType>[];
57
+ export declare function getProtocolCapability<T extends ModelType>(modelType: T, protocol: string): (typeof PROTOCOL_REGISTRY)[T][number];
58
+ export type RegisteredRequest = RequestPreparation;
59
+ export {};
60
+ //# sourceMappingURL=protocol-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protocol-registry.d.ts","sourceRoot":"","sources":["../src/protocol-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAYlE,OAAO,EAOL,KAAK,qBAAqB,EAC3B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAKL,KAAK,4BAA4B,EAClC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,sBAAsB,CAAC;AAM9B,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AACD,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,SAAS,CAAC,EAAE,iBAAiB,CAAC;CACxC;AACD,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,iBAAiB,EAAE,eAAe,CAAC;IAC5C,QAAQ,CAAC,uBAAuB,EAAE,eAAe,CAAC;IAClD,QAAQ,CAAC,SAAS,EAAE,eAAe,CAAC;IACpC,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;I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Q,EAAE,CAAC,IAAI,SAAS,GAAG,SAAS,WAAW,CAAC,CAAC,CAAC,EAAE,GAAE,CAAC;AAC9D,eAAO,MAAM,wBAAwB,EAAE,SAAS,WAAW,CAAC,SAAS,CAAC,EACM,CAAC;AAC7E,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,SAAS,EACvD,SAAS,EAAE,CAAC,EACZ,QAAQ,EAAE,MAAM,GACf,CAAC,OAAO,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CASvC;AACD,MAAM,MAAM,iBAAiB,GAAG,kBAAkB,CAAC"}
@@ -0,0 +1,89 @@
1
+ import { prepareOpenAIChat, prepareOpenAIResponses, prepareAnthropic, prepareGemini, } from "./protocols/text.js";
2
+ import { prepareEmbedding, prepareRerank } from "./protocols/catalog.js";
3
+ import { prepareImageEditing, prepareImageGeneration, } from "./protocols/images.js";
4
+ import { prepareOpenAISpeech, prepareDashScopeSpeech, prepareVolcengineSpeech, prepareXfyunSpeech, prepareZhipuSpeech, prepareMiniMaxSpeech, } from "./protocols/speech.js";
5
+ import { prepareOpenAITranscription, prepareVolcengineTranscription, prepareZhipuTranscription, prepareDashScopeTranscription, } from "./protocols/transcription.js";
6
+ import { prepareDashScopeVideo, prepareVolcengineVideo, } from "./protocols/video.js";
7
+ import { prepareOpenAIRealtime, prepareResponsesWebSocket, } from "./protocols/realtime.js";
8
+ const define = (protocol, modelTypes, transport, handler, lifecycle) => {
9
+ const context = {
10
+ transport,
11
+ ...(lifecycle ? { lifecycle } : {}),
12
+ };
13
+ return {
14
+ protocol,
15
+ modelTypes,
16
+ transport,
17
+ ...(lifecycle ? { lifecycle } : {}),
18
+ prepare: (request) => handler(request, context),
19
+ };
20
+ };
21
+ const textTypes = ["text-generation", "multimodal-generation"];
22
+ const text = [
23
+ define("openai-chat-completions", textTypes, "http", (request) => prepareOpenAIChat(request)),
24
+ define("openai-responses", textTypes, "http", (request) => prepareOpenAIResponses(request)),
25
+ define("anthropic-messages", textTypes, "http", (request) => prepareAnthropic(request)),
26
+ define("gemini-generate-content", textTypes, "http", (request) => prepareGemini(request)),
27
+ ];
28
+ export const PROTOCOL_REGISTRY = {
29
+ "text-generation": text,
30
+ "multimodal-generation": text,
31
+ embedding: [
32
+ define("openai-embeddings", ["embedding"], "http", prepareEmbedding),
33
+ ],
34
+ rerank: [define("cohere-rerank", ["rerank"], "http", prepareRerank)],
35
+ "image-generation": [
36
+ define("openai-images", ["image-generation"], "http", prepareImageGeneration),
37
+ ],
38
+ "image-editing": [
39
+ define("openai-images", ["image-editing"], "http", prepareImageEditing),
40
+ ],
41
+ "speech-generation": [
42
+ define("openai-audio", ["speech-generation"], "http", prepareOpenAISpeech),
43
+ define("dashscope-audio", ["speech-generation"], "http", prepareDashScopeSpeech),
44
+ define("volcengine-audio", ["speech-generation"], "http-stream", prepareVolcengineSpeech),
45
+ define("xfyun-audio", ["speech-generation"], "websocket", prepareXfyunSpeech),
46
+ define("zhipu-audio", ["speech-generation"], "http", prepareZhipuSpeech),
47
+ define("minimax-audio", ["speech-generation"], "http", prepareMiniMaxSpeech),
48
+ ],
49
+ transcription: [
50
+ define("openai-audio", ["transcription"], "http", prepareOpenAITranscription),
51
+ define("volcengine-audio", ["transcription"], "websocket", prepareVolcengineTranscription),
52
+ define("zhipu-audio", ["transcription"], "http", prepareZhipuTranscription),
53
+ define("dashscope-transcription", ["transcription"], "http", prepareDashScopeTranscription),
54
+ ],
55
+ "video-generation": [
56
+ define("dashscope-video", ["video-generation"], "http", prepareDashScopeVideo, {
57
+ statusPath: "/api/v1/tasks/{taskId}",
58
+ taskIdPath: "output.task_id",
59
+ resultPath: "output.video_url",
60
+ }),
61
+ define("volcengine-video", ["video-generation"], "http", prepareVolcengineVideo, {
62
+ statusPath: "/api/v3/contents/generations/tasks/{taskId}",
63
+ taskIdPath: "id",
64
+ resultPath: "content.video_url",
65
+ }),
66
+ ],
67
+ realtime: [
68
+ define("openai-responses-websocket", ["realtime"], "websocket", prepareResponsesWebSocket),
69
+ define("openai-realtime", ["realtime"], "websocket", prepareOpenAIRealtime),
70
+ ],
71
+ };
72
+ export const PROTOCOLS_BY_MODEL_TYPE = Object.freeze(Object.fromEntries(Object.entries(PROTOCOL_REGISTRY).map(([modelType, capabilities]) => [
73
+ modelType,
74
+ Object.freeze(capabilities.map(({ protocol }) => protocol)),
75
+ ])));
76
+ export const SUPPORTED_WIRE_PROTOCOLS = Object.freeze([...new Set(Object.values(PROTOCOLS_BY_MODEL_TYPE).flat())]);
77
+ export function getProtocolCapability(modelType, protocol) {
78
+ const capability = PROTOCOL_REGISTRY[modelType].find((item) => item.protocol === protocol);
79
+ if (!capability)
80
+ throw new Error(`Protocol "${protocol}" cannot handle model type "${modelType}".`);
81
+ return capability;
82
+ }
83
+ for (const capabilities of Object.values(PROTOCOL_REGISTRY)) {
84
+ for (const capability of capabilities)
85
+ Object.freeze(capability);
86
+ Object.freeze(capabilities);
87
+ }
88
+ Object.freeze(PROTOCOL_REGISTRY);
89
+ //# sourceMappingURL=protocol-registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protocol-registry.js","sourceRoot":"","sources":["../src/protocol-registry.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,gBAAgB,EAChB,aAAa,GACd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EACL,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,uBAAuB,EACvB,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,GAErB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,0BAA0B,EAC1B,8BAA8B,EAC9B,yBAAyB,EACzB,6BAA6B,GAE9B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GAEvB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AM,UAAU,GAAG,iBAAiB,CAAC,SAAS,CAAC,CAAC,IAAI,CAClD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,KAAK,QAAQ,CACrC,CAAC;IACF,IAAI,CAAC,UAAU;QACb,MAAM,IAAI,KAAK,CACb,aAAa,QAAQ,+BAA+B,SAAS,IAAI,CAClE,CAAC;IACJ,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,KAAK,MAAM,YAAY,IAAI,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC,EAAE,CAAC;IAC5D,KAAK,MAAM,UAAU,IAAI,YAAY;QAAE,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IACjE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;AAC9B,CAAC;AACD,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC"}
@@ -1,9 +1,5 @@
1
- import type { RequestPreparation } from "../request-types.js";
2
- import type { PreparedRequest } from "../request-utils.js";
3
- export declare function prepareEmbedding(request: Extract<RequestPreparation, {
4
- readonly modelType: "embedding";
5
- }>): PreparedRequest;
6
- export declare function prepareRerank(request: Extract<RequestPreparation, {
7
- readonly modelType: "rerank";
8
- }>): PreparedRequest;
1
+ import type { ProtocolRequest } from "../request-types.js";
2
+ import type { PreparedRequest } from "../request-builders/http.js";
3
+ export declare function prepareEmbedding(request: ProtocolRequest<"embedding", "openai-embeddings">): PreparedRequest;
4
+ export declare function prepareRerank(request: ProtocolRequest<"rerank", "cohere-rerank">): PreparedRequest;
9
5
  //# sourceMappingURL=catalog.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../src/protocols/catalog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAG3D,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,OAAO,CAAC,kBAAkB,EAAE;IAAE,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAA;CAAE,CAAC,GACxE,eAAe,CAQjB;AAED,wBAAgB,aAAa,CAC3B,OAAO,EAAE,OAAO,CAAC,kBAAkB,EAAE;IAAE,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAA;CAAE,CAAC,GACrE,eAAe,CASjB"}
1
+ {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../src/protocols/catalog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAGnE,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,eAAe,CAAC,WAAW,EAAE,mBAAmB,CAAC,GACzD,eAAe,CAKjB;AAED,wBAAgB,aAAa,CAC3B,OAAO,EAAE,eAAe,CAAC,QAAQ,EAAE,eAAe,CAAC,GAClD,eAAe,CAKjB"}