@morlay/dsh-llm-openai-compatible 0.0.11 → 0.0.12
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/index.d.mts +15 -15
- package/dist/invariant.d.mts +4 -5
- package/dist/wire.d.mts +9 -10
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -7,12 +7,12 @@ import { Context, Volatile } from "@deepseek-ai/cordis";
|
|
|
7
7
|
type Dict<T = any, K extends string | symbol = string> = { [key in K]: T; };
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region src/index.d.ts
|
|
10
|
-
declare const name = "llm-openai-compatible";
|
|
11
|
-
declare const inject: string[];
|
|
12
|
-
declare const NS = "llm-openai-compatible";
|
|
13
|
-
declare const REASONING_LEVELS: readonly ["off", "low", "high", "max"];
|
|
14
|
-
declare const MODEL_MODALITIES: readonly ["text", "image"];
|
|
15
|
-
interface ModelProfileSource {
|
|
10
|
+
export declare const name = "llm-openai-compatible";
|
|
11
|
+
export declare const inject: string[];
|
|
12
|
+
export declare const NS = "llm-openai-compatible";
|
|
13
|
+
export declare const REASONING_LEVELS: readonly ["off", "low", "high", "max"];
|
|
14
|
+
export declare const MODEL_MODALITIES: readonly ["text", "image"];
|
|
15
|
+
export interface ModelProfileSource {
|
|
16
16
|
id: string;
|
|
17
17
|
name?: string;
|
|
18
18
|
description?: string;
|
|
@@ -21,7 +21,7 @@ interface ModelProfileSource {
|
|
|
21
21
|
inputModalities?: ModelModality[];
|
|
22
22
|
reasoningEfforts?: false | Partial<Record<ReasoningEffort, string | null>>;
|
|
23
23
|
}
|
|
24
|
-
interface ProviderProfileSource {
|
|
24
|
+
export interface ProviderProfileSource {
|
|
25
25
|
apiKeyEnv?: string;
|
|
26
26
|
displayName?: string;
|
|
27
27
|
baseURL: string;
|
|
@@ -41,18 +41,18 @@ interface ProviderProfileSource {
|
|
|
41
41
|
timeoutMs?: number;
|
|
42
42
|
retryPolicy?: RetryPolicyConfig;
|
|
43
43
|
}
|
|
44
|
-
interface Config {
|
|
44
|
+
export interface Config {
|
|
45
45
|
providers: Volatile<Record<string, ProviderProfileSource>>;
|
|
46
46
|
}
|
|
47
|
-
type Options = { [K in keyof Config]?: Config[K] extends Volatile<infer T> ? T : never; };
|
|
48
|
-
declare const Config: z<Schemastery.ObjectS<NoInfer<{
|
|
47
|
+
export type Options = { [K in keyof Config]?: Config[K] extends Volatile<infer T> ? T : never; };
|
|
48
|
+
export declare const Config: z<Schemastery.ObjectS<NoInfer<{
|
|
49
49
|
providers: z<NoInfer<Dict<ProviderProfileSource, string>>, NoInfer<Dict<ProviderProfileSource, string>>, "volatile-defined">;
|
|
50
50
|
}>>, Schemastery.ObjectT<NoInfer<{
|
|
51
51
|
providers: z<NoInfer<Dict<ProviderProfileSource, string>>, NoInfer<Dict<ProviderProfileSource, string>>, "volatile-defined">;
|
|
52
52
|
}>>, "plain">;
|
|
53
|
-
declare function resolveAdapterOptions(provider: string, source: ProviderProfileSource): ResolvedProviderProfile;
|
|
54
|
-
declare function resolveProfiles(providers: Readonly<Record<string, ProviderProfileSource>> | undefined): Map<string, ResolvedProviderProfile>;
|
|
55
|
-
declare function assertServiceable(config: Options): void;
|
|
56
|
-
declare function apply(ctx: Context, config: Config): void;
|
|
53
|
+
export declare function resolveAdapterOptions(provider: string, source: ProviderProfileSource): ResolvedProviderProfile;
|
|
54
|
+
export declare function resolveProfiles(providers: Readonly<Record<string, ProviderProfileSource>> | undefined): Map<string, ResolvedProviderProfile>;
|
|
55
|
+
export declare function assertServiceable(config: Options): void;
|
|
56
|
+
export declare function apply(ctx: Context, config: Config): void;
|
|
57
57
|
//#endregion
|
|
58
|
-
export {
|
|
58
|
+
export { DEFAULT_CONTEXT_WINDOW, DEFAULT_MAX_REQUEST_IMAGE_BYTES, DEFAULT_MAX_TOKENS, DEFAULT_STREAM_IDLE_TIMEOUT_MS, OpenAICompatibleAdapter, type OpenAICompatibleAdapterOptions, type ReasoningEffort, type ResolvedModelProfile, type ResolvedProviderProfile };
|
package/dist/invariant.d.mts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Context } from "@deepseek-ai/cordis";
|
|
2
2
|
//#region src/invariant.d.ts
|
|
3
|
-
declare const name = "llm-openai-compatible-invariant";
|
|
4
|
-
declare const inject: string[];
|
|
5
|
-
declare const apply: (ctx: Context) => Promise<() => void>;
|
|
6
|
-
//#endregion
|
|
7
|
-
export { apply, inject, name };
|
|
3
|
+
export declare const name = "llm-openai-compatible-invariant";
|
|
4
|
+
export declare const inject: string[];
|
|
5
|
+
export declare const apply: (ctx: Context) => Promise<() => void>;
|
|
6
|
+
//#endregion
|
package/dist/wire.d.mts
CHANGED
|
@@ -3,13 +3,13 @@ import { FinishReason, GenerateOptions, StreamChunk, TokenUsage } from "@deepsee
|
|
|
3
3
|
import { LanguageModelV4FinishReason, LanguageModelV4FunctionTool, LanguageModelV4Prompt, LanguageModelV4StreamPart, LanguageModelV4Usage, SharedV4ProviderOptions } from "@ai-sdk/provider";
|
|
4
4
|
import { AttachmentStore } from "@deepseek-ai/dsh-attachment";
|
|
5
5
|
//#region src/serialize.d.ts
|
|
6
|
-
type OpenAICompatibleProviderOptions = SharedV4ProviderOptions & {
|
|
6
|
+
export type OpenAICompatibleProviderOptions = SharedV4ProviderOptions & {
|
|
7
7
|
"openai-compatible"?: {
|
|
8
8
|
reasoningEffort?: string;
|
|
9
9
|
top_k?: number;
|
|
10
10
|
};
|
|
11
11
|
};
|
|
12
|
-
interface OpenAICompatibleCallOptions {
|
|
12
|
+
export interface OpenAICompatibleCallOptions {
|
|
13
13
|
prompt: LanguageModelV4Prompt;
|
|
14
14
|
maxOutputTokens?: number;
|
|
15
15
|
temperature?: number;
|
|
@@ -21,17 +21,16 @@ interface OpenAICompatibleCallOptions {
|
|
|
21
21
|
tools?: LanguageModelV4FunctionTool[];
|
|
22
22
|
providerOptions?: OpenAICompatibleProviderOptions;
|
|
23
23
|
}
|
|
24
|
-
declare function resolveReasoningWire(model: ResolvedModelProfile | undefined, effort: ResolvedProviderProfile["reasoning"] | undefined): string | undefined;
|
|
25
|
-
declare function serializeCallOptions(options: GenerateOptions, profile: ResolvedProviderProfile, model: ResolvedModelProfile | undefined): Promise<OpenAICompatibleCallOptions>;
|
|
26
|
-
declare function serializeCallOptionsWithImages(options: GenerateOptions, profile: ResolvedProviderProfile, model: ResolvedModelProfile | undefined, images: {
|
|
24
|
+
export declare function resolveReasoningWire(model: ResolvedModelProfile | undefined, effort: ResolvedProviderProfile["reasoning"] | undefined): string | undefined;
|
|
25
|
+
export declare function serializeCallOptions(options: GenerateOptions, profile: ResolvedProviderProfile, model: ResolvedModelProfile | undefined): Promise<OpenAICompatibleCallOptions>;
|
|
26
|
+
export declare function serializeCallOptionsWithImages(options: GenerateOptions, profile: ResolvedProviderProfile, model: ResolvedModelProfile | undefined, images: {
|
|
27
27
|
attachments: AttachmentStore;
|
|
28
28
|
maxRequestImageBytes: number;
|
|
29
29
|
signal?: AbortSignal;
|
|
30
30
|
}): Promise<OpenAICompatibleCallOptions>;
|
|
31
31
|
//#endregion
|
|
32
32
|
//#region src/translate.d.ts
|
|
33
|
-
declare function mapFinishReason(reason: LanguageModelV4FinishReason): FinishReason;
|
|
34
|
-
declare function mapUsage(usage: LanguageModelV4Usage): TokenUsage;
|
|
35
|
-
declare function translate(stream: ReadableStream<LanguageModelV4StreamPart>): AsyncGenerator<StreamChunk, void>;
|
|
36
|
-
//#endregion
|
|
37
|
-
export { OpenAICompatibleCallOptions, OpenAICompatibleProviderOptions, mapFinishReason, mapUsage, resolveReasoningWire, serializeCallOptions, serializeCallOptionsWithImages, translate };
|
|
33
|
+
export declare function mapFinishReason(reason: LanguageModelV4FinishReason): FinishReason;
|
|
34
|
+
export declare function mapUsage(usage: LanguageModelV4Usage): TokenUsage;
|
|
35
|
+
export declare function translate(stream: ReadableStream<LanguageModelV4StreamPart>): AsyncGenerator<StreamChunk, void>;
|
|
36
|
+
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@morlay/dsh-llm-openai-compatible",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.12",
|
|
4
4
|
"description": "Optional OpenAI-compatible LLM adapter plugin for DeepSeek Harness with configurable default sampling parameters (temperature / topP / topK / penalties / seed) over a providers dict. Pick either this bundle or the built-in llm-pi-ai, never both.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dsh",
|