@dsh-plus/llm-pi 0.1.6 → 0.1.7
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/lib/client.js +1880 -1844
- package/lib/index.d.ts +21 -4
- package/lib/index.js +562 -126
- package/package.json +16 -11
- package/src/catalog/official.ts +71 -0
- package/src/client/draft.ts +90 -32
- package/src/config.ts +105 -0
- package/src/deepseek-routes.ts +139 -0
- package/src/discovery.ts +33 -2
- package/src/profiles-deepseek.ts +282 -0
- package/src/profiles.ts +5 -0
- package/src/resolve-dsh.ts +89 -0
- package/src/service.ts +39 -1
package/lib/index.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import * as _deepseek_ai_dsh_settings0 from "@deepseek-ai/dsh-settings";
|
|
2
1
|
import z from "@deepseek-ai/schemastery";
|
|
3
2
|
import { Context } from "@deepseek-ai/cordis";
|
|
4
|
-
|
|
5
3
|
//#region src/config.d.ts
|
|
6
|
-
|
|
7
4
|
/** settings 命名空间;webui 配置卡片与插件运行期读取同一份(字面量见 ./ns.ts)。 */
|
|
8
|
-
declare const SETTINGS_NS:
|
|
5
|
+
declare const SETTINGS_NS: import("@deepseek-ai/dsh-settings").SettingsNamespace;
|
|
9
6
|
/** 本插件可为手写 route 提供的协议实现(与官方 PROTOCOLS 表一致)。 */
|
|
10
7
|
declare const PROTOCOL_IDS: readonly ["openai-completions", "openai-responses", "anthropic-messages"];
|
|
11
8
|
type ProtocolId = (typeof PROTOCOL_IDS)[number];
|
|
12
9
|
/** pi-ai 思考档位,升级序。 */
|
|
13
10
|
declare const THINKING_LEVELS: readonly ["off", "minimal", "low", "medium", "high", "xhigh", "max"];
|
|
14
11
|
declare const MODALITIES: readonly ["text", "image"];
|
|
12
|
+
/** 路由适配器种类:pi = PiAiAdapter(默认);deepseek = 官方 DeepSeekAdapter(文件通道)。 */
|
|
13
|
+
declare const ADAPTER_KINDS: readonly ["pi", "deepseek"];
|
|
14
|
+
type AdapterKind = (typeof ADAPTER_KINDS)[number];
|
|
15
15
|
type ThinkingLevel = (typeof THINKING_LEVELS)[number];
|
|
16
16
|
type Modality = (typeof MODALITIES)[number];
|
|
17
17
|
type ReasoningEfforts = Partial<Record<ThinkingLevel, string | null>>;
|
|
@@ -25,9 +25,14 @@ interface ModelEntryConfig {
|
|
|
25
25
|
input?: Modality[];
|
|
26
26
|
reasoningEfforts?: false | ReasoningEfforts;
|
|
27
27
|
compat?: Record<string, unknown>;
|
|
28
|
+
/** 以下仅 adapter: deepseek 的 route 有效(官方 llm-deepseek 目录字段)。 */
|
|
29
|
+
imagePixelBudget?: number;
|
|
30
|
+
imageMaxBytes?: number;
|
|
31
|
+
imageDetail?: 'auto' | 'low';
|
|
28
32
|
}
|
|
29
33
|
/** 单个 provider route 配置(providers 字典的值)。 */
|
|
30
34
|
interface ProviderProfileConfig {
|
|
35
|
+
adapter?: AdapterKind;
|
|
31
36
|
extends?: string;
|
|
32
37
|
displayName?: string;
|
|
33
38
|
api?: ProtocolId;
|
|
@@ -53,6 +58,18 @@ interface ProviderProfileConfig {
|
|
|
53
58
|
maxRequestImageBytes?: number;
|
|
54
59
|
retryPolicy?: unknown;
|
|
55
60
|
models?: ModelEntryConfig[];
|
|
61
|
+
/** 以下仅 adapter: deepseek 的 route 有效(透传官方 llm-deepseek 同名策略)。 */
|
|
62
|
+
thinking?: 'enabled' | 'disabled';
|
|
63
|
+
reasoningEffort?: 'off' | 'low' | 'high' | 'max';
|
|
64
|
+
maxRequestFilesBytes?: number;
|
|
65
|
+
maxInlineRequestImageBytes?: number;
|
|
66
|
+
maxImagesPerRequest?: number;
|
|
67
|
+
imageOffloadByteQuantum?: number;
|
|
68
|
+
inlineImageOffloadByteQuantum?: number;
|
|
69
|
+
imageOffloadCountQuantum?: number;
|
|
70
|
+
filesApiTimeoutMs?: number;
|
|
71
|
+
fileExpiresAfterSeconds?: number;
|
|
72
|
+
fileRefreshMarginSeconds?: number;
|
|
56
73
|
}
|
|
57
74
|
/** 插件配置根。 */
|
|
58
75
|
interface LlmPiConfig {
|