@jaypie/llm 1.3.1 → 1.3.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.
- package/dist/cjs/index.cjs +136 -13
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +661 -0
- package/dist/cjs/operate/OperateLoop.d.ts +6 -3
- package/dist/cjs/providers/anthropic/utils.d.ts +2 -1
- package/dist/cjs/providers/bedrock/utils.d.ts +2 -1
- package/dist/cjs/providers/google/utils.d.ts +2 -1
- package/dist/cjs/providers/openai/utils.d.ts +2 -1
- package/dist/cjs/providers/openrouter/utils.d.ts +2 -1
- package/dist/cjs/providers/xai/utils.d.ts +2 -1
- package/dist/cjs/util/index.d.ts +1 -0
- package/dist/cjs/util/logger.d.ts +2 -1
- package/dist/cjs/util/repairFormatKeys.d.ts +19 -0
- package/dist/esm/index.d.ts +661 -16
- package/dist/esm/index.js +136 -13
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/operate/OperateLoop.d.ts +6 -3
- package/dist/esm/providers/anthropic/utils.d.ts +2 -1
- package/dist/esm/providers/bedrock/utils.d.ts +2 -1
- package/dist/esm/providers/google/utils.d.ts +2 -1
- package/dist/esm/providers/openai/utils.d.ts +2 -1
- package/dist/esm/providers/openrouter/utils.d.ts +2 -1
- package/dist/esm/providers/xai/utils.d.ts +2 -1
- package/dist/esm/util/index.d.ts +1 -0
- package/dist/esm/util/logger.d.ts +2 -1
- package/dist/esm/util/repairFormatKeys.d.ts +19 -0
- package/package.json +11 -5
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { createLogger } from "@jaypie/logger";
|
|
1
2
|
import type { GoogleGenAI } from "@google/genai";
|
|
2
3
|
import { LlmMessageOptions } from "../../types/LlmProvider.interface.js";
|
|
3
4
|
export declare function loadSdk(): Promise<typeof import("@google/genai")>;
|
|
4
|
-
export declare const getLogger: () =>
|
|
5
|
+
export declare const getLogger: () => ReturnType<typeof createLogger>;
|
|
5
6
|
export declare function initializeClient({ apiKey, }?: {
|
|
6
7
|
apiKey?: string;
|
|
7
8
|
}): Promise<GoogleGenAI>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { createLogger } from "@jaypie/logger";
|
|
1
2
|
import { JsonObject, NaturalSchema } from "@jaypie/types";
|
|
2
3
|
import { OpenAI } from "openai";
|
|
3
4
|
import { z } from "zod/v4";
|
|
4
5
|
import { LlmMessageOptions } from "../../types/LlmProvider.interface.js";
|
|
5
|
-
export declare const getLogger: () =>
|
|
6
|
+
export declare const getLogger: () => ReturnType<typeof createLogger>;
|
|
6
7
|
export declare function initializeClient({ apiKey, }?: {
|
|
7
8
|
apiKey?: string;
|
|
8
9
|
}): Promise<OpenAI>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { createLogger } from "@jaypie/logger";
|
|
1
2
|
import type { OpenRouter } from "@openrouter/sdk";
|
|
2
3
|
import { LlmMessageOptions } from "../../types/LlmProvider.interface.js";
|
|
3
4
|
export declare function loadSdk(): Promise<typeof import("@openrouter/sdk")>;
|
|
4
|
-
export declare const getLogger: () =>
|
|
5
|
+
export declare const getLogger: () => ReturnType<typeof createLogger>;
|
|
5
6
|
export declare function initializeClient({ apiKey, }?: {
|
|
6
7
|
apiKey?: string;
|
|
7
8
|
}): Promise<OpenRouter>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { createLogger } from "@jaypie/logger";
|
|
1
2
|
import { OpenAI } from "openai";
|
|
2
|
-
export declare const getLogger: () =>
|
|
3
|
+
export declare const getLogger: () => ReturnType<typeof createLogger>;
|
|
3
4
|
export declare function initializeClient({ apiKey, }?: {
|
|
4
5
|
apiKey?: string;
|
|
5
6
|
}): Promise<OpenAI>;
|
package/dist/cjs/util/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { createLogger } from "@jaypie/logger";
|
|
2
|
+
export declare const getLogger: () => ReturnType<typeof createLogger>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from "zod/v4";
|
|
2
|
+
import { JsonObject, NaturalSchema } from "@jaypie/types";
|
|
3
|
+
type Format = JsonObject | NaturalSchema | z.ZodType;
|
|
4
|
+
/**
|
|
5
|
+
* Repair structured-output keys that a provider/model corrupted by wrapping
|
|
6
|
+
* them in literal double quotes (observed on OpenAI for multi-word `format`
|
|
7
|
+
* keys: `Merchant Request` returned as `"Merchant Request"`). A declared
|
|
8
|
+
* `format` is a schema contract: returned keys should match the declared names
|
|
9
|
+
* exactly. Any returned key whose de-quoted form matches a declared key is
|
|
10
|
+
* renamed back to the declared key.
|
|
11
|
+
*
|
|
12
|
+
* Only mutates a (cloned) structured object; strings and non-objects pass
|
|
13
|
+
* through untouched.
|
|
14
|
+
*/
|
|
15
|
+
export declare function repairFormatKeys({ content, format, }: {
|
|
16
|
+
content: JsonObject;
|
|
17
|
+
format: Format;
|
|
18
|
+
}): JsonObject;
|
|
19
|
+
export {};
|