@earendil-works/pi-ai 0.80.9 → 0.81.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/README.md +4 -2
- package/dist/api/openai-codex-responses.d.ts.map +1 -1
- package/dist/api/openai-codex-responses.js +2 -7
- package/dist/api/openai-codex-responses.js.map +1 -1
- package/dist/api/openai-completions.d.ts.map +1 -1
- package/dist/api/openai-completions.js +14 -2
- package/dist/api/openai-completions.js.map +1 -1
- package/dist/api/pi-messages.d.ts.map +1 -1
- package/dist/api/pi-messages.js +2 -4
- package/dist/api/pi-messages.js.map +1 -1
- package/dist/auth/helpers.d.ts.map +1 -1
- package/dist/auth/helpers.js +3 -2
- package/dist/auth/helpers.js.map +1 -1
- package/dist/env-api-keys.d.ts.map +1 -1
- package/dist/env-api-keys.js +2 -0
- package/dist/env-api-keys.js.map +1 -1
- package/dist/image-models.generated.d.ts +60 -0
- package/dist/image-models.generated.d.ts.map +1 -1
- package/dist/image-models.generated.js +236 -176
- package/dist/image-models.generated.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/models-store.d.ts +2 -0
- package/dist/models-store.d.ts.map +1 -1
- package/dist/models-store.js.map +1 -1
- package/dist/models.generated.d.ts +4379 -22338
- package/dist/models.generated.d.ts.map +1 -1
- package/dist/models.generated.js +4 -0
- package/dist/models.generated.js.map +1 -1
- package/dist/providers/all.d.ts +2 -0
- package/dist/providers/all.d.ts.map +1 -1
- package/dist/providers/all.js +8 -0
- package/dist/providers/all.js.map +1 -1
- package/dist/providers/amazon-bedrock.d.ts.map +1 -1
- package/dist/providers/amazon-bedrock.js +3 -2
- package/dist/providers/amazon-bedrock.js.map +1 -1
- package/dist/providers/amazon-bedrock.models.d.ts +436 -1988
- package/dist/providers/amazon-bedrock.models.d.ts.map +1 -1
- package/dist/providers/amazon-bedrock.models.js +2 -1892
- package/dist/providers/amazon-bedrock.models.js.map +1 -1
- package/dist/providers/ant-ling.models.d.ts +10 -80
- package/dist/providers/ant-ling.models.d.ts.map +1 -1
- package/dist/providers/ant-ling.models.js +2 -57
- package/dist/providers/ant-ling.models.js.map +1 -1
- package/dist/providers/anthropic.models.d.ts +43 -267
- package/dist/providers/anthropic.models.d.ts.map +1 -1
- package/dist/providers/anthropic.models.js +2 -252
- package/dist/providers/anthropic.models.js.map +1 -1
- package/dist/providers/azure-openai-responses.models.d.ts +184 -883
- package/dist/providers/azure-openai-responses.models.d.ts.map +1 -1
- package/dist/providers/azure-openai-responses.models.js +2 -811
- package/dist/providers/azure-openai-responses.models.js.map +1 -1
- package/dist/providers/cerebras.models.d.ts +10 -60
- package/dist/providers/cerebras.models.d.ts.map +1 -1
- package/dist/providers/cerebras.models.js +2 -56
- package/dist/providers/cerebras.models.js.map +1 -1
- package/dist/providers/cloudflare-ai-gateway.models.d.ts +168 -884
- package/dist/providers/cloudflare-ai-gateway.models.d.ts.map +1 -1
- package/dist/providers/cloudflare-ai-gateway.models.js +2 -755
- package/dist/providers/cloudflare-ai-gateway.models.js.map +1 -1
- package/dist/providers/cloudflare-workers-ai.models.d.ts +40 -286
- package/dist/providers/cloudflare-workers-ai.models.d.ts.map +1 -1
- package/dist/providers/cloudflare-workers-ai.models.js +2 -236
- package/dist/providers/cloudflare-workers-ai.models.js.map +1 -1
- package/dist/providers/data/.manifest.json +1 -0
- package/dist/providers/data/amazon-bedrock.json +1 -0
- package/dist/providers/data/ant-ling.json +1 -0
- package/dist/providers/data/anthropic.json +1 -0
- package/dist/providers/data/azure-openai-responses.json +1 -0
- package/dist/providers/data/cerebras.json +1 -0
- package/dist/providers/data/cloudflare-ai-gateway.json +1 -0
- package/dist/providers/data/cloudflare-workers-ai.json +1 -0
- package/dist/providers/data/deepseek.json +1 -0
- package/dist/providers/data/fireworks.json +1 -0
- package/dist/providers/data/github-copilot.json +1 -0
- package/dist/providers/data/google-vertex.json +1 -0
- package/dist/providers/data/google.json +1 -0
- package/dist/providers/data/groq.json +1 -0
- package/dist/providers/data/huggingface.json +1 -0
- package/dist/providers/data/kimi-coding.json +1 -0
- package/dist/providers/data/minimax-cn.json +1 -0
- package/dist/providers/data/minimax.json +1 -0
- package/dist/providers/data/mistral.json +1 -0
- package/dist/providers/data/moonshotai-cn.json +1 -0
- package/dist/providers/data/moonshotai.json +1 -0
- package/dist/providers/data/nvidia.json +1 -0
- package/dist/providers/data/openai-codex.json +1 -0
- package/dist/providers/data/openai.json +1 -0
- package/dist/providers/data/opencode-go.json +1 -0
- package/dist/providers/data/opencode.json +1 -0
- package/dist/providers/data/openrouter.json +1 -0
- package/dist/providers/data/qwen-token-plan-cn.json +1 -0
- package/dist/providers/data/qwen-token-plan.json +1 -0
- package/dist/providers/data/together.json +1 -0
- package/dist/providers/data/vercel-ai-gateway.json +1 -0
- package/dist/providers/data/xai.json +1 -0
- package/dist/providers/data/xiaomi-token-plan-ams.json +1 -0
- package/dist/providers/data/xiaomi-token-plan-cn.json +1 -0
- package/dist/providers/data/xiaomi-token-plan-sgp.json +1 -0
- package/dist/providers/data/xiaomi.json +1 -0
- package/dist/providers/data/zai-coding-cn.json +1 -0
- package/dist/providers/data/zai.json +1 -0
- package/dist/providers/deepseek.models.d.ts +7 -58
- package/dist/providers/deepseek.models.d.ts.map +1 -1
- package/dist/providers/deepseek.models.js +2 -40
- package/dist/providers/deepseek.models.js.map +1 -1
- package/dist/providers/fireworks.models.d.ts +49 -362
- package/dist/providers/fireworks.models.d.ts.map +1 -1
- package/dist/providers/fireworks.models.js +2 -292
- package/dist/providers/fireworks.models.js.map +1 -1
- package/dist/providers/github-copilot.models.d.ts +85 -760
- package/dist/providers/github-copilot.models.d.ts.map +1 -1
- package/dist/providers/github-copilot.models.js +2 -538
- package/dist/providers/github-copilot.models.js.map +1 -1
- package/dist/providers/google-vertex.models.d.ts +31 -189
- package/dist/providers/google-vertex.models.d.ts.map +1 -1
- package/dist/providers/google-vertex.models.js +2 -179
- package/dist/providers/google-vertex.models.js.map +1 -1
- package/dist/providers/google.models.d.ts +49 -309
- package/dist/providers/google.models.d.ts.map +1 -1
- package/dist/providers/google.models.js +2 -285
- package/dist/providers/google.models.js.map +1 -1
- package/dist/providers/groq.models.d.ts +22 -118
- package/dist/providers/groq.models.d.ts.map +1 -1
- package/dist/providers/groq.models.js +2 -122
- package/dist/providers/groq.models.js.map +1 -1
- package/dist/providers/huggingface.models.d.ts +196 -979
- package/dist/providers/huggingface.models.d.ts.map +1 -1
- package/dist/providers/huggingface.models.js +2 -884
- package/dist/providers/huggingface.models.js.map +1 -1
- package/dist/providers/kimi-coding.models.d.ts +10 -97
- package/dist/providers/kimi-coding.models.d.ts.map +1 -1
- package/dist/providers/kimi-coding.models.js +2 -92
- package/dist/providers/kimi-coding.models.js.map +1 -1
- package/dist/providers/minimax-cn.models.d.ts +10 -48
- package/dist/providers/minimax-cn.models.d.ts.map +1 -1
- package/dist/providers/minimax-cn.models.js +2 -53
- package/dist/providers/minimax-cn.models.js.map +1 -1
- package/dist/providers/minimax.models.d.ts +10 -48
- package/dist/providers/minimax.models.d.ts.map +1 -1
- package/dist/providers/minimax.models.js +2 -53
- package/dist/providers/minimax.models.js.map +1 -1
- package/dist/providers/mistral.models.d.ts +91 -480
- package/dist/providers/mistral.models.d.ts.map +1 -1
- package/dist/providers/mistral.models.js +2 -512
- package/dist/providers/mistral.models.js.map +1 -1
- package/dist/providers/moonshotai-cn.models.d.ts +31 -257
- package/dist/providers/moonshotai-cn.models.d.ts.map +1 -1
- package/dist/providers/moonshotai-cn.models.js +2 -185
- package/dist/providers/moonshotai-cn.models.js.map +1 -1
- package/dist/providers/moonshotai.models.d.ts +31 -257
- package/dist/providers/moonshotai.models.d.ts.map +1 -1
- package/dist/providers/moonshotai.models.js +2 -185
- package/dist/providers/moonshotai.models.js.map +1 -1
- package/dist/providers/nvidia.models.d.ts +58 -541
- package/dist/providers/nvidia.models.d.ts.map +1 -1
- package/dist/providers/nvidia.models.js +2 -382
- package/dist/providers/nvidia.models.js.map +1 -1
- package/dist/providers/openai-codex.models.d.ts +22 -196
- package/dist/providers/openai-codex.models.d.ts.map +1 -1
- package/dist/providers/openai-codex.models.js +2 -139
- package/dist/providers/openai-codex.models.js.map +1 -1
- package/dist/providers/openai.models.d.ts +184 -954
- package/dist/providers/openai.models.d.ts.map +1 -1
- package/dist/providers/openai.models.js +2 -825
- package/dist/providers/openai.models.js.map +1 -1
- package/dist/providers/opencode-go.d.ts +1 -1
- package/dist/providers/opencode-go.d.ts.map +1 -1
- package/dist/providers/opencode-go.js +2 -0
- package/dist/providers/opencode-go.js.map +1 -1
- package/dist/providers/opencode-go.models.d.ts +48 -293
- package/dist/providers/opencode-go.models.d.ts.map +1 -1
- package/dist/providers/opencode-go.models.js +2 -237
- package/dist/providers/opencode-go.models.js.map +1 -1
- package/dist/providers/opencode.models.d.ts +160 -1185
- package/dist/providers/opencode.models.d.ts.map +1 -1
- package/dist/providers/opencode.models.js +2 -996
- package/dist/providers/opencode.models.js.map +1 -1
- package/dist/providers/openrouter.models.d.ts +1076 -5750
- package/dist/providers/openrouter.models.d.ts.map +1 -1
- package/dist/providers/openrouter.models.js +2 -4910
- package/dist/providers/openrouter.models.js.map +1 -1
- package/dist/providers/qwen-token-plan-cn.d.ts +3 -0
- package/dist/providers/qwen-token-plan-cn.d.ts.map +1 -0
- package/dist/providers/qwen-token-plan-cn.js +15 -0
- package/dist/providers/qwen-token-plan-cn.js.map +1 -0
- package/dist/providers/qwen-token-plan-cn.models.d.ts +64 -0
- package/dist/providers/qwen-token-plan-cn.models.d.ts.map +1 -0
- package/dist/providers/qwen-token-plan-cn.models.js +5 -0
- package/dist/providers/qwen-token-plan-cn.models.js.map +1 -0
- package/dist/providers/qwen-token-plan.d.ts +3 -0
- package/dist/providers/qwen-token-plan.d.ts.map +1 -0
- package/dist/providers/qwen-token-plan.js +15 -0
- package/dist/providers/qwen-token-plan.js.map +1 -0
- package/dist/providers/qwen-token-plan.models.d.ts +64 -0
- package/dist/providers/qwen-token-plan.models.d.ts.map +1 -0
- package/dist/providers/qwen-token-plan.models.js +5 -0
- package/dist/providers/qwen-token-plan.models.js.map +1 -0
- package/dist/providers/radius-config.d.ts.map +1 -1
- package/dist/providers/radius-config.js +18 -14
- package/dist/providers/radius-config.js.map +1 -1
- package/dist/providers/together.models.d.ts +49 -579
- package/dist/providers/together.models.d.ts.map +1 -1
- package/dist/providers/together.models.js +2 -377
- package/dist/providers/together.models.js.map +1 -1
- package/dist/providers/vercel-ai-gateway.models.d.ts +752 -3336
- package/dist/providers/vercel-ai-gateway.models.d.ts.map +1 -1
- package/dist/providers/vercel-ai-gateway.models.js +2 -3263
- package/dist/providers/vercel-ai-gateway.models.js.map +1 -1
- package/dist/providers/xai.models.d.ts +10 -175
- package/dist/providers/xai.models.d.ts.map +1 -1
- package/dist/providers/xai.models.js +2 -147
- package/dist/providers/xai.models.js.map +1 -1
- package/dist/providers/xiaomi-token-plan-ams.models.d.ts +10 -60
- package/dist/providers/xiaomi-token-plan-ams.models.d.ts.map +1 -1
- package/dist/providers/xiaomi-token-plan-ams.models.js +2 -56
- package/dist/providers/xiaomi-token-plan-ams.models.js.map +1 -1
- package/dist/providers/xiaomi-token-plan-cn.models.d.ts +10 -60
- package/dist/providers/xiaomi-token-plan-cn.models.d.ts.map +1 -1
- package/dist/providers/xiaomi-token-plan-cn.models.js +2 -56
- package/dist/providers/xiaomi-token-plan-cn.models.js.map +1 -1
- package/dist/providers/xiaomi-token-plan-sgp.models.d.ts +10 -60
- package/dist/providers/xiaomi-token-plan-sgp.models.d.ts.map +1 -1
- package/dist/providers/xiaomi-token-plan-sgp.models.js +2 -56
- package/dist/providers/xiaomi-token-plan-sgp.models.js.map +1 -1
- package/dist/providers/xiaomi.models.d.ts +19 -120
- package/dist/providers/xiaomi.models.d.ts.map +1 -1
- package/dist/providers/xiaomi.models.js +2 -110
- package/dist/providers/xiaomi.models.js.map +1 -1
- package/dist/providers/zai-coding-cn.models.d.ts +19 -144
- package/dist/providers/zai-coding-cn.models.d.ts.map +1 -1
- package/dist/providers/zai-coding-cn.models.js +2 -111
- package/dist/providers/zai-coding-cn.models.js.map +1 -1
- package/dist/providers/zai.models.d.ts +19 -144
- package/dist/providers/zai.models.d.ts.map +1 -1
- package/dist/providers/zai.models.js +2 -111
- package/dist/providers/zai.models.js.map +1 -1
- package/dist/types.d.ts +3 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/overflow.d.ts +1 -0
- package/dist/utils/overflow.d.ts.map +1 -1
- package/dist/utils/overflow.js +3 -0
- package/dist/utils/overflow.js.map +1 -1
- package/dist/utils/retry.d.ts.map +1 -1
- package/dist/utils/retry.js +1 -0
- package/dist/utils/retry.js.map +1 -1
- package/dist/utils/text.d.ts +6 -0
- package/dist/utils/text.d.ts.map +1 -0
- package/dist/utils/text.js +10 -0
- package/dist/utils/text.js.map +1 -0
- package/dist/utils/uuid.d.ts +3 -0
- package/dist/utils/uuid.d.ts.map +1 -0
- package/dist/utils/uuid.js +46 -0
- package/dist/utils/uuid.js.map +1 -0
- package/package.json +8 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qwen-token-plan-cn.d.ts","sourceRoot":"","sources":["../../src/providers/qwen-token-plan-cn.ts"],"names":[],"mappings":"AAEA,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AAG7D,wBAAgB,uBAAuB,IAAI,QAAQ,CAAC,oBAAoB,CAAC,CASxE","sourcesContent":["import { openAICompletionsApi } from \"../api/openai-completions.lazy.ts\";\nimport { envApiKeyAuth } from \"../auth/helpers.ts\";\nimport { createProvider, type Provider } from \"../models.ts\";\nimport { QWEN_TOKEN_PLAN_CN_MODELS } from \"./qwen-token-plan-cn.models.ts\";\n\nexport function qwenTokenPlanCnProvider(): Provider<\"openai-completions\"> {\n\treturn createProvider({\n\t\tid: \"qwen-token-plan-cn\",\n\t\tname: \"Qwen Token Plan CN\",\n\t\tbaseUrl: \"https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1\",\n\t\tauth: { apiKey: envApiKeyAuth(\"Qwen Token Plan CN API key\", [\"QWEN_TOKEN_PLAN_CN_API_KEY\"]) },\n\t\tmodels: Object.values(QWEN_TOKEN_PLAN_CN_MODELS),\n\t\tapi: openAICompletionsApi(),\n\t});\n}\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { openAICompletionsApi } from "../api/openai-completions.lazy.js";
|
|
2
|
+
import { envApiKeyAuth } from "../auth/helpers.js";
|
|
3
|
+
import { createProvider } from "../models.js";
|
|
4
|
+
import { QWEN_TOKEN_PLAN_CN_MODELS } from "./qwen-token-plan-cn.models.js";
|
|
5
|
+
export function qwenTokenPlanCnProvider() {
|
|
6
|
+
return createProvider({
|
|
7
|
+
id: "qwen-token-plan-cn",
|
|
8
|
+
name: "Qwen Token Plan CN",
|
|
9
|
+
baseUrl: "https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",
|
|
10
|
+
auth: { apiKey: envApiKeyAuth("Qwen Token Plan CN API key", ["QWEN_TOKEN_PLAN_CN_API_KEY"]) },
|
|
11
|
+
models: Object.values(QWEN_TOKEN_PLAN_CN_MODELS),
|
|
12
|
+
api: openAICompletionsApi(),
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=qwen-token-plan-cn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qwen-token-plan-cn.js","sourceRoot":"","sources":["../../src/providers/qwen-token-plan-cn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAiB,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAE3E,MAAM,UAAU,uBAAuB,GAAmC;IACzE,OAAO,cAAc,CAAC;QACrB,EAAE,EAAE,oBAAoB;QACxB,IAAI,EAAE,oBAAoB;QAC1B,OAAO,EAAE,oEAAoE;QAC7E,IAAI,EAAE,EAAE,MAAM,EAAE,aAAa,CAAC,4BAA4B,EAAE,CAAC,4BAA4B,CAAC,CAAC,EAAE;QAC7F,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,yBAAyB,CAAC;QAChD,GAAG,EAAE,oBAAoB,EAAE;KAC3B,CAAC,CAAC;AAAA,CACH","sourcesContent":["import { openAICompletionsApi } from \"../api/openai-completions.lazy.ts\";\nimport { envApiKeyAuth } from \"../auth/helpers.ts\";\nimport { createProvider, type Provider } from \"../models.ts\";\nimport { QWEN_TOKEN_PLAN_CN_MODELS } from \"./qwen-token-plan-cn.models.ts\";\n\nexport function qwenTokenPlanCnProvider(): Provider<\"openai-completions\"> {\n\treturn createProvider({\n\t\tid: \"qwen-token-plan-cn\",\n\t\tname: \"Qwen Token Plan CN\",\n\t\tbaseUrl: \"https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1\",\n\t\tauth: { apiKey: envApiKeyAuth(\"Qwen Token Plan CN API key\", [\"QWEN_TOKEN_PLAN_CN_API_KEY\"]) },\n\t\tmodels: Object.values(QWEN_TOKEN_PLAN_CN_MODELS),\n\t\tapi: openAICompletionsApi(),\n\t});\n}\n"]}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { Model } from "../types.ts";
|
|
2
|
+
export declare const QWEN_TOKEN_PLAN_CN_MODELS: {
|
|
3
|
+
"MiniMax-M2.5": Model<"openai-completions"> & {
|
|
4
|
+
id: "MiniMax-M2.5";
|
|
5
|
+
provider: "qwen-token-plan-cn";
|
|
6
|
+
};
|
|
7
|
+
"deepseek-v3.2": Model<"openai-completions"> & {
|
|
8
|
+
id: "deepseek-v3.2";
|
|
9
|
+
provider: "qwen-token-plan-cn";
|
|
10
|
+
};
|
|
11
|
+
"deepseek-v4-flash": Model<"openai-completions"> & {
|
|
12
|
+
id: "deepseek-v4-flash";
|
|
13
|
+
provider: "qwen-token-plan-cn";
|
|
14
|
+
};
|
|
15
|
+
"deepseek-v4-pro": Model<"openai-completions"> & {
|
|
16
|
+
id: "deepseek-v4-pro";
|
|
17
|
+
provider: "qwen-token-plan-cn";
|
|
18
|
+
};
|
|
19
|
+
"glm-5": Model<"openai-completions"> & {
|
|
20
|
+
id: "glm-5";
|
|
21
|
+
provider: "qwen-token-plan-cn";
|
|
22
|
+
};
|
|
23
|
+
"glm-5.1": Model<"openai-completions"> & {
|
|
24
|
+
id: "glm-5.1";
|
|
25
|
+
provider: "qwen-token-plan-cn";
|
|
26
|
+
};
|
|
27
|
+
"glm-5.2": Model<"openai-completions"> & {
|
|
28
|
+
id: "glm-5.2";
|
|
29
|
+
provider: "qwen-token-plan-cn";
|
|
30
|
+
};
|
|
31
|
+
"kimi-k2.5": Model<"openai-completions"> & {
|
|
32
|
+
id: "kimi-k2.5";
|
|
33
|
+
provider: "qwen-token-plan-cn";
|
|
34
|
+
};
|
|
35
|
+
"kimi-k2.6": Model<"openai-completions"> & {
|
|
36
|
+
id: "kimi-k2.6";
|
|
37
|
+
provider: "qwen-token-plan-cn";
|
|
38
|
+
};
|
|
39
|
+
"kimi-k2.7-code": Model<"openai-completions"> & {
|
|
40
|
+
id: "kimi-k2.7-code";
|
|
41
|
+
provider: "qwen-token-plan-cn";
|
|
42
|
+
};
|
|
43
|
+
"qwen3.6-flash": Model<"openai-completions"> & {
|
|
44
|
+
id: "qwen3.6-flash";
|
|
45
|
+
provider: "qwen-token-plan-cn";
|
|
46
|
+
};
|
|
47
|
+
"qwen3.6-plus": Model<"openai-completions"> & {
|
|
48
|
+
id: "qwen3.6-plus";
|
|
49
|
+
provider: "qwen-token-plan-cn";
|
|
50
|
+
};
|
|
51
|
+
"qwen3.7-max": Model<"openai-completions"> & {
|
|
52
|
+
id: "qwen3.7-max";
|
|
53
|
+
provider: "qwen-token-plan-cn";
|
|
54
|
+
};
|
|
55
|
+
"qwen3.7-plus": Model<"openai-completions"> & {
|
|
56
|
+
id: "qwen3.7-plus";
|
|
57
|
+
provider: "qwen-token-plan-cn";
|
|
58
|
+
};
|
|
59
|
+
"qwen3.8-max-preview": Model<"openai-completions"> & {
|
|
60
|
+
id: "qwen3.8-max-preview";
|
|
61
|
+
provider: "qwen-token-plan-cn";
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=qwen-token-plan-cn.models.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qwen-token-plan-cn.models.d.ts","sourceRoot":"","sources":["../../src/providers/qwen-token-plan-cn.models.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEzC,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6DrC,CAAC","sourcesContent":["// This file is auto-generated by scripts/generate-models.ts\n// Do not edit manually - run 'npm run generate-models' to update\n\nimport values from \"./data/qwen-token-plan-cn.json\" with { type: \"json\" };\nimport type { Model } from \"../types.ts\";\n\nexport const QWEN_TOKEN_PLAN_CN_MODELS = values as {\n\t\"MiniMax-M2.5\": Model<\"openai-completions\"> & {\n\t\tid: \"MiniMax-M2.5\";\n\t\tprovider: \"qwen-token-plan-cn\";\n\t};\n\t\"deepseek-v3.2\": Model<\"openai-completions\"> & {\n\t\tid: \"deepseek-v3.2\";\n\t\tprovider: \"qwen-token-plan-cn\";\n\t};\n\t\"deepseek-v4-flash\": Model<\"openai-completions\"> & {\n\t\tid: \"deepseek-v4-flash\";\n\t\tprovider: \"qwen-token-plan-cn\";\n\t};\n\t\"deepseek-v4-pro\": Model<\"openai-completions\"> & {\n\t\tid: \"deepseek-v4-pro\";\n\t\tprovider: \"qwen-token-plan-cn\";\n\t};\n\t\"glm-5\": Model<\"openai-completions\"> & {\n\t\tid: \"glm-5\";\n\t\tprovider: \"qwen-token-plan-cn\";\n\t};\n\t\"glm-5.1\": Model<\"openai-completions\"> & {\n\t\tid: \"glm-5.1\";\n\t\tprovider: \"qwen-token-plan-cn\";\n\t};\n\t\"glm-5.2\": Model<\"openai-completions\"> & {\n\t\tid: \"glm-5.2\";\n\t\tprovider: \"qwen-token-plan-cn\";\n\t};\n\t\"kimi-k2.5\": Model<\"openai-completions\"> & {\n\t\tid: \"kimi-k2.5\";\n\t\tprovider: \"qwen-token-plan-cn\";\n\t};\n\t\"kimi-k2.6\": Model<\"openai-completions\"> & {\n\t\tid: \"kimi-k2.6\";\n\t\tprovider: \"qwen-token-plan-cn\";\n\t};\n\t\"kimi-k2.7-code\": Model<\"openai-completions\"> & {\n\t\tid: \"kimi-k2.7-code\";\n\t\tprovider: \"qwen-token-plan-cn\";\n\t};\n\t\"qwen3.6-flash\": Model<\"openai-completions\"> & {\n\t\tid: \"qwen3.6-flash\";\n\t\tprovider: \"qwen-token-plan-cn\";\n\t};\n\t\"qwen3.6-plus\": Model<\"openai-completions\"> & {\n\t\tid: \"qwen3.6-plus\";\n\t\tprovider: \"qwen-token-plan-cn\";\n\t};\n\t\"qwen3.7-max\": Model<\"openai-completions\"> & {\n\t\tid: \"qwen3.7-max\";\n\t\tprovider: \"qwen-token-plan-cn\";\n\t};\n\t\"qwen3.7-plus\": Model<\"openai-completions\"> & {\n\t\tid: \"qwen3.7-plus\";\n\t\tprovider: \"qwen-token-plan-cn\";\n\t};\n\t\"qwen3.8-max-preview\": Model<\"openai-completions\"> & {\n\t\tid: \"qwen3.8-max-preview\";\n\t\tprovider: \"qwen-token-plan-cn\";\n\t};\n};\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// This file is auto-generated by scripts/generate-models.ts
|
|
2
|
+
// Do not edit manually - run 'npm run generate-models' to update
|
|
3
|
+
import values from "./data/qwen-token-plan-cn.json" with { type: "json" };
|
|
4
|
+
export const QWEN_TOKEN_PLAN_CN_MODELS = values;
|
|
5
|
+
//# sourceMappingURL=qwen-token-plan-cn.models.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qwen-token-plan-cn.models.js","sourceRoot":"","sources":["../../src/providers/qwen-token-plan-cn.models.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,iEAAiE;AAEjE,OAAO,MAAM,MAAM,gCAAgC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAG1E,MAAM,CAAC,MAAM,yBAAyB,GAAG,MA6DxC,CAAC","sourcesContent":["// This file is auto-generated by scripts/generate-models.ts\n// Do not edit manually - run 'npm run generate-models' to update\n\nimport values from \"./data/qwen-token-plan-cn.json\" with { type: \"json\" };\nimport type { Model } from \"../types.ts\";\n\nexport const QWEN_TOKEN_PLAN_CN_MODELS = values as {\n\t\"MiniMax-M2.5\": Model<\"openai-completions\"> & {\n\t\tid: \"MiniMax-M2.5\";\n\t\tprovider: \"qwen-token-plan-cn\";\n\t};\n\t\"deepseek-v3.2\": Model<\"openai-completions\"> & {\n\t\tid: \"deepseek-v3.2\";\n\t\tprovider: \"qwen-token-plan-cn\";\n\t};\n\t\"deepseek-v4-flash\": Model<\"openai-completions\"> & {\n\t\tid: \"deepseek-v4-flash\";\n\t\tprovider: \"qwen-token-plan-cn\";\n\t};\n\t\"deepseek-v4-pro\": Model<\"openai-completions\"> & {\n\t\tid: \"deepseek-v4-pro\";\n\t\tprovider: \"qwen-token-plan-cn\";\n\t};\n\t\"glm-5\": Model<\"openai-completions\"> & {\n\t\tid: \"glm-5\";\n\t\tprovider: \"qwen-token-plan-cn\";\n\t};\n\t\"glm-5.1\": Model<\"openai-completions\"> & {\n\t\tid: \"glm-5.1\";\n\t\tprovider: \"qwen-token-plan-cn\";\n\t};\n\t\"glm-5.2\": Model<\"openai-completions\"> & {\n\t\tid: \"glm-5.2\";\n\t\tprovider: \"qwen-token-plan-cn\";\n\t};\n\t\"kimi-k2.5\": Model<\"openai-completions\"> & {\n\t\tid: \"kimi-k2.5\";\n\t\tprovider: \"qwen-token-plan-cn\";\n\t};\n\t\"kimi-k2.6\": Model<\"openai-completions\"> & {\n\t\tid: \"kimi-k2.6\";\n\t\tprovider: \"qwen-token-plan-cn\";\n\t};\n\t\"kimi-k2.7-code\": Model<\"openai-completions\"> & {\n\t\tid: \"kimi-k2.7-code\";\n\t\tprovider: \"qwen-token-plan-cn\";\n\t};\n\t\"qwen3.6-flash\": Model<\"openai-completions\"> & {\n\t\tid: \"qwen3.6-flash\";\n\t\tprovider: \"qwen-token-plan-cn\";\n\t};\n\t\"qwen3.6-plus\": Model<\"openai-completions\"> & {\n\t\tid: \"qwen3.6-plus\";\n\t\tprovider: \"qwen-token-plan-cn\";\n\t};\n\t\"qwen3.7-max\": Model<\"openai-completions\"> & {\n\t\tid: \"qwen3.7-max\";\n\t\tprovider: \"qwen-token-plan-cn\";\n\t};\n\t\"qwen3.7-plus\": Model<\"openai-completions\"> & {\n\t\tid: \"qwen3.7-plus\";\n\t\tprovider: \"qwen-token-plan-cn\";\n\t};\n\t\"qwen3.8-max-preview\": Model<\"openai-completions\"> & {\n\t\tid: \"qwen3.8-max-preview\";\n\t\tprovider: \"qwen-token-plan-cn\";\n\t};\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qwen-token-plan.d.ts","sourceRoot":"","sources":["../../src/providers/qwen-token-plan.ts"],"names":[],"mappings":"AAEA,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AAG7D,wBAAgB,qBAAqB,IAAI,QAAQ,CAAC,oBAAoB,CAAC,CAStE","sourcesContent":["import { openAICompletionsApi } from \"../api/openai-completions.lazy.ts\";\nimport { envApiKeyAuth } from \"../auth/helpers.ts\";\nimport { createProvider, type Provider } from \"../models.ts\";\nimport { QWEN_TOKEN_PLAN_MODELS } from \"./qwen-token-plan.models.ts\";\n\nexport function qwenTokenPlanProvider(): Provider<\"openai-completions\"> {\n\treturn createProvider({\n\t\tid: \"qwen-token-plan\",\n\t\tname: \"Qwen Token Plan\",\n\t\tbaseUrl: \"https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1\",\n\t\tauth: { apiKey: envApiKeyAuth(\"Qwen Token Plan API key\", [\"QWEN_TOKEN_PLAN_API_KEY\"]) },\n\t\tmodels: Object.values(QWEN_TOKEN_PLAN_MODELS),\n\t\tapi: openAICompletionsApi(),\n\t});\n}\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { openAICompletionsApi } from "../api/openai-completions.lazy.js";
|
|
2
|
+
import { envApiKeyAuth } from "../auth/helpers.js";
|
|
3
|
+
import { createProvider } from "../models.js";
|
|
4
|
+
import { QWEN_TOKEN_PLAN_MODELS } from "./qwen-token-plan.models.js";
|
|
5
|
+
export function qwenTokenPlanProvider() {
|
|
6
|
+
return createProvider({
|
|
7
|
+
id: "qwen-token-plan",
|
|
8
|
+
name: "Qwen Token Plan",
|
|
9
|
+
baseUrl: "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
|
|
10
|
+
auth: { apiKey: envApiKeyAuth("Qwen Token Plan API key", ["QWEN_TOKEN_PLAN_API_KEY"]) },
|
|
11
|
+
models: Object.values(QWEN_TOKEN_PLAN_MODELS),
|
|
12
|
+
api: openAICompletionsApi(),
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=qwen-token-plan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qwen-token-plan.js","sourceRoot":"","sources":["../../src/providers/qwen-token-plan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAiB,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,MAAM,UAAU,qBAAqB,GAAmC;IACvE,OAAO,cAAc,CAAC;QACrB,EAAE,EAAE,iBAAiB;QACrB,IAAI,EAAE,iBAAiB;QACvB,OAAO,EAAE,wEAAwE;QACjF,IAAI,EAAE,EAAE,MAAM,EAAE,aAAa,CAAC,yBAAyB,EAAE,CAAC,yBAAyB,CAAC,CAAC,EAAE;QACvF,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,sBAAsB,CAAC;QAC7C,GAAG,EAAE,oBAAoB,EAAE;KAC3B,CAAC,CAAC;AAAA,CACH","sourcesContent":["import { openAICompletionsApi } from \"../api/openai-completions.lazy.ts\";\nimport { envApiKeyAuth } from \"../auth/helpers.ts\";\nimport { createProvider, type Provider } from \"../models.ts\";\nimport { QWEN_TOKEN_PLAN_MODELS } from \"./qwen-token-plan.models.ts\";\n\nexport function qwenTokenPlanProvider(): Provider<\"openai-completions\"> {\n\treturn createProvider({\n\t\tid: \"qwen-token-plan\",\n\t\tname: \"Qwen Token Plan\",\n\t\tbaseUrl: \"https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1\",\n\t\tauth: { apiKey: envApiKeyAuth(\"Qwen Token Plan API key\", [\"QWEN_TOKEN_PLAN_API_KEY\"]) },\n\t\tmodels: Object.values(QWEN_TOKEN_PLAN_MODELS),\n\t\tapi: openAICompletionsApi(),\n\t});\n}\n"]}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { Model } from "../types.ts";
|
|
2
|
+
export declare const QWEN_TOKEN_PLAN_MODELS: {
|
|
3
|
+
"MiniMax-M2.5": Model<"openai-completions"> & {
|
|
4
|
+
id: "MiniMax-M2.5";
|
|
5
|
+
provider: "qwen-token-plan";
|
|
6
|
+
};
|
|
7
|
+
"deepseek-v3.2": Model<"openai-completions"> & {
|
|
8
|
+
id: "deepseek-v3.2";
|
|
9
|
+
provider: "qwen-token-plan";
|
|
10
|
+
};
|
|
11
|
+
"deepseek-v4-flash": Model<"openai-completions"> & {
|
|
12
|
+
id: "deepseek-v4-flash";
|
|
13
|
+
provider: "qwen-token-plan";
|
|
14
|
+
};
|
|
15
|
+
"deepseek-v4-pro": Model<"openai-completions"> & {
|
|
16
|
+
id: "deepseek-v4-pro";
|
|
17
|
+
provider: "qwen-token-plan";
|
|
18
|
+
};
|
|
19
|
+
"glm-5": Model<"openai-completions"> & {
|
|
20
|
+
id: "glm-5";
|
|
21
|
+
provider: "qwen-token-plan";
|
|
22
|
+
};
|
|
23
|
+
"glm-5.1": Model<"openai-completions"> & {
|
|
24
|
+
id: "glm-5.1";
|
|
25
|
+
provider: "qwen-token-plan";
|
|
26
|
+
};
|
|
27
|
+
"glm-5.2": Model<"openai-completions"> & {
|
|
28
|
+
id: "glm-5.2";
|
|
29
|
+
provider: "qwen-token-plan";
|
|
30
|
+
};
|
|
31
|
+
"kimi-k2.5": Model<"openai-completions"> & {
|
|
32
|
+
id: "kimi-k2.5";
|
|
33
|
+
provider: "qwen-token-plan";
|
|
34
|
+
};
|
|
35
|
+
"kimi-k2.6": Model<"openai-completions"> & {
|
|
36
|
+
id: "kimi-k2.6";
|
|
37
|
+
provider: "qwen-token-plan";
|
|
38
|
+
};
|
|
39
|
+
"kimi-k2.7-code": Model<"openai-completions"> & {
|
|
40
|
+
id: "kimi-k2.7-code";
|
|
41
|
+
provider: "qwen-token-plan";
|
|
42
|
+
};
|
|
43
|
+
"qwen3.6-flash": Model<"openai-completions"> & {
|
|
44
|
+
id: "qwen3.6-flash";
|
|
45
|
+
provider: "qwen-token-plan";
|
|
46
|
+
};
|
|
47
|
+
"qwen3.6-plus": Model<"openai-completions"> & {
|
|
48
|
+
id: "qwen3.6-plus";
|
|
49
|
+
provider: "qwen-token-plan";
|
|
50
|
+
};
|
|
51
|
+
"qwen3.7-max": Model<"openai-completions"> & {
|
|
52
|
+
id: "qwen3.7-max";
|
|
53
|
+
provider: "qwen-token-plan";
|
|
54
|
+
};
|
|
55
|
+
"qwen3.7-plus": Model<"openai-completions"> & {
|
|
56
|
+
id: "qwen3.7-plus";
|
|
57
|
+
provider: "qwen-token-plan";
|
|
58
|
+
};
|
|
59
|
+
"qwen3.8-max-preview": Model<"openai-completions"> & {
|
|
60
|
+
id: "qwen3.8-max-preview";
|
|
61
|
+
provider: "qwen-token-plan";
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=qwen-token-plan.models.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qwen-token-plan.models.d.ts","sourceRoot":"","sources":["../../src/providers/qwen-token-plan.models.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEzC,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6DlC,CAAC","sourcesContent":["// This file is auto-generated by scripts/generate-models.ts\n// Do not edit manually - run 'npm run generate-models' to update\n\nimport values from \"./data/qwen-token-plan.json\" with { type: \"json\" };\nimport type { Model } from \"../types.ts\";\n\nexport const QWEN_TOKEN_PLAN_MODELS = values as {\n\t\"MiniMax-M2.5\": Model<\"openai-completions\"> & {\n\t\tid: \"MiniMax-M2.5\";\n\t\tprovider: \"qwen-token-plan\";\n\t};\n\t\"deepseek-v3.2\": Model<\"openai-completions\"> & {\n\t\tid: \"deepseek-v3.2\";\n\t\tprovider: \"qwen-token-plan\";\n\t};\n\t\"deepseek-v4-flash\": Model<\"openai-completions\"> & {\n\t\tid: \"deepseek-v4-flash\";\n\t\tprovider: \"qwen-token-plan\";\n\t};\n\t\"deepseek-v4-pro\": Model<\"openai-completions\"> & {\n\t\tid: \"deepseek-v4-pro\";\n\t\tprovider: \"qwen-token-plan\";\n\t};\n\t\"glm-5\": Model<\"openai-completions\"> & {\n\t\tid: \"glm-5\";\n\t\tprovider: \"qwen-token-plan\";\n\t};\n\t\"glm-5.1\": Model<\"openai-completions\"> & {\n\t\tid: \"glm-5.1\";\n\t\tprovider: \"qwen-token-plan\";\n\t};\n\t\"glm-5.2\": Model<\"openai-completions\"> & {\n\t\tid: \"glm-5.2\";\n\t\tprovider: \"qwen-token-plan\";\n\t};\n\t\"kimi-k2.5\": Model<\"openai-completions\"> & {\n\t\tid: \"kimi-k2.5\";\n\t\tprovider: \"qwen-token-plan\";\n\t};\n\t\"kimi-k2.6\": Model<\"openai-completions\"> & {\n\t\tid: \"kimi-k2.6\";\n\t\tprovider: \"qwen-token-plan\";\n\t};\n\t\"kimi-k2.7-code\": Model<\"openai-completions\"> & {\n\t\tid: \"kimi-k2.7-code\";\n\t\tprovider: \"qwen-token-plan\";\n\t};\n\t\"qwen3.6-flash\": Model<\"openai-completions\"> & {\n\t\tid: \"qwen3.6-flash\";\n\t\tprovider: \"qwen-token-plan\";\n\t};\n\t\"qwen3.6-plus\": Model<\"openai-completions\"> & {\n\t\tid: \"qwen3.6-plus\";\n\t\tprovider: \"qwen-token-plan\";\n\t};\n\t\"qwen3.7-max\": Model<\"openai-completions\"> & {\n\t\tid: \"qwen3.7-max\";\n\t\tprovider: \"qwen-token-plan\";\n\t};\n\t\"qwen3.7-plus\": Model<\"openai-completions\"> & {\n\t\tid: \"qwen3.7-plus\";\n\t\tprovider: \"qwen-token-plan\";\n\t};\n\t\"qwen3.8-max-preview\": Model<\"openai-completions\"> & {\n\t\tid: \"qwen3.8-max-preview\";\n\t\tprovider: \"qwen-token-plan\";\n\t};\n};\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// This file is auto-generated by scripts/generate-models.ts
|
|
2
|
+
// Do not edit manually - run 'npm run generate-models' to update
|
|
3
|
+
import values from "./data/qwen-token-plan.json" with { type: "json" };
|
|
4
|
+
export const QWEN_TOKEN_PLAN_MODELS = values;
|
|
5
|
+
//# sourceMappingURL=qwen-token-plan.models.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qwen-token-plan.models.js","sourceRoot":"","sources":["../../src/providers/qwen-token-plan.models.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,iEAAiE;AAEjE,OAAO,MAAM,MAAM,6BAA6B,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAGvE,MAAM,CAAC,MAAM,sBAAsB,GAAG,MA6DrC,CAAC","sourcesContent":["// This file is auto-generated by scripts/generate-models.ts\n// Do not edit manually - run 'npm run generate-models' to update\n\nimport values from \"./data/qwen-token-plan.json\" with { type: \"json\" };\nimport type { Model } from \"../types.ts\";\n\nexport const QWEN_TOKEN_PLAN_MODELS = values as {\n\t\"MiniMax-M2.5\": Model<\"openai-completions\"> & {\n\t\tid: \"MiniMax-M2.5\";\n\t\tprovider: \"qwen-token-plan\";\n\t};\n\t\"deepseek-v3.2\": Model<\"openai-completions\"> & {\n\t\tid: \"deepseek-v3.2\";\n\t\tprovider: \"qwen-token-plan\";\n\t};\n\t\"deepseek-v4-flash\": Model<\"openai-completions\"> & {\n\t\tid: \"deepseek-v4-flash\";\n\t\tprovider: \"qwen-token-plan\";\n\t};\n\t\"deepseek-v4-pro\": Model<\"openai-completions\"> & {\n\t\tid: \"deepseek-v4-pro\";\n\t\tprovider: \"qwen-token-plan\";\n\t};\n\t\"glm-5\": Model<\"openai-completions\"> & {\n\t\tid: \"glm-5\";\n\t\tprovider: \"qwen-token-plan\";\n\t};\n\t\"glm-5.1\": Model<\"openai-completions\"> & {\n\t\tid: \"glm-5.1\";\n\t\tprovider: \"qwen-token-plan\";\n\t};\n\t\"glm-5.2\": Model<\"openai-completions\"> & {\n\t\tid: \"glm-5.2\";\n\t\tprovider: \"qwen-token-plan\";\n\t};\n\t\"kimi-k2.5\": Model<\"openai-completions\"> & {\n\t\tid: \"kimi-k2.5\";\n\t\tprovider: \"qwen-token-plan\";\n\t};\n\t\"kimi-k2.6\": Model<\"openai-completions\"> & {\n\t\tid: \"kimi-k2.6\";\n\t\tprovider: \"qwen-token-plan\";\n\t};\n\t\"kimi-k2.7-code\": Model<\"openai-completions\"> & {\n\t\tid: \"kimi-k2.7-code\";\n\t\tprovider: \"qwen-token-plan\";\n\t};\n\t\"qwen3.6-flash\": Model<\"openai-completions\"> & {\n\t\tid: \"qwen3.6-flash\";\n\t\tprovider: \"qwen-token-plan\";\n\t};\n\t\"qwen3.6-plus\": Model<\"openai-completions\"> & {\n\t\tid: \"qwen3.6-plus\";\n\t\tprovider: \"qwen-token-plan\";\n\t};\n\t\"qwen3.7-max\": Model<\"openai-completions\"> & {\n\t\tid: \"qwen3.7-max\";\n\t\tprovider: \"qwen-token-plan\";\n\t};\n\t\"qwen3.7-plus\": Model<\"openai-completions\"> & {\n\t\tid: \"qwen3.7-plus\";\n\t\tprovider: \"qwen-token-plan\";\n\t};\n\t\"qwen3.8-max-preview\": Model<\"openai-completions\"> & {\n\t\tid: \"qwen3.8-max-preview\";\n\t\tprovider: \"qwen-token-plan\";\n\t};\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radius-config.d.ts","sourceRoot":"","sources":["../../src/providers/radius-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE3D,eAAO,MAAM,sBAAsB,0BAA0B,CAAC;AAE9D,MAAM,MAAM,kBAAkB,GAAG;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,KAAK,EAAE,CAAC,MAAM,GAAG,OAAO,CAAC,EAAE,CAAC;IAC5B,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;IACnC,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IACj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,KAAK,CAAC,aAAa,CAAC,EAAE,CAOjH;AAED,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,eAAe,GAAG,SAAS,GAAG,KAAK,CAAC,aAAa,CAAC,EAAE,CAGnH;AAOD,wBAAsB,uBAAuB,CAC5C,OAAO,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,WAAW,GAClB,OAAO,CAAC,mBAAmB,CAAC,CAY9B","sourcesContent":["import type { OAuthCredential } from \"../auth/types.ts\";\nimport type { Model, ThinkingLevelMap } from \"../types.ts\";\n\nexport const DEFAULT_RADIUS_GATEWAY = \"https://radius.pi.dev\";\n\nexport type RadiusGatewayModel = {\n\tid: string;\n\tname: string;\n\treasoning: boolean;\n\tthinkingLevelMap?: ThinkingLevelMap;\n\tinput: (\"text\" | \"image\")[];\n\tcost: Model<\"pi-messages\">[\"cost\"];\n\tcontextWindow: number;\n\tmaxTokens: number;\n};\n\nexport type RadiusGatewayConfig = {\n\tbaseUrl: string;\n\tmodels: RadiusGatewayModel[];\n};\n\nexport type RadiusOAuthCredential = OAuthCredential & {\n\tgatewayConfig?: RadiusGatewayConfig;\n};\n\nfunction isRadiusGatewayModel(value: unknown): value is RadiusGatewayModel {\n\tif (typeof value !== \"object\" || value === null || Array.isArray(value)) return false;\n\tconst model = value as Partial<RadiusGatewayModel>;\n\treturn (\n\t\ttypeof model.id === \"string\" &&\n\t\ttypeof model.name === \"string\" &&\n\t\ttypeof model.reasoning === \"boolean\" &&\n\t\tArray.isArray(model.input) &&\n\t\ttypeof model.cost === \"object\" &&\n\t\tmodel.cost !== null &&\n\t\t!Array.isArray(model.cost) &&\n\t\ttypeof model.contextWindow === \"number\" &&\n\t\ttypeof model.maxTokens === \"number\"\n\t);\n}\n\nfunction sanitizeRadiusGatewayConfig(config: unknown): RadiusGatewayConfig | undefined {\n\tif (typeof config !== \"object\" || config === null || Array.isArray(config)) return undefined;\n\tconst { baseUrl, models } = config as Partial<RadiusGatewayConfig>;\n\tif (typeof baseUrl !== \"string\" || !Array.isArray(models)) return undefined;\n\treturn {\n\t\tbaseUrl,\n\t\tmodels: models.filter(isRadiusGatewayModel).map((model) => ({ ...model })),\n\t};\n}\n\nexport function normalizeRadiusGatewayUrl(value: string): string {\n\tconst withScheme = /^https?:\\/\\//iu.test(value) ? value : `https://${value}`;\n\treturn withScheme.replace(/\\/+$/u, \"\");\n}\n\nexport function getRadiusCredentialConfig(credential: OAuthCredential | undefined): RadiusGatewayConfig | undefined {\n\treturn sanitizeRadiusGatewayConfig((credential as RadiusOAuthCredential | undefined)?.gatewayConfig);\n}\n\nexport function getRadiusModelsFromConfig(providerId: string, config: RadiusGatewayConfig): Model<\"pi-messages\">[] {\n\treturn config.models.map((model) => ({\n\t\t...model,\n\t\tapi: \"pi-messages\",\n\t\tprovider: providerId,\n\t\tbaseUrl: config.baseUrl,\n\t}));\n}\n\nexport function getRadiusModels(providerId: string, credential: OAuthCredential | undefined): Model<\"pi-messages\">[] {\n\tconst config = getRadiusCredentialConfig(credential);\n\treturn config ? getRadiusModelsFromConfig(providerId, config) : [];\n}\n\nfunction truncateHttpBody(body: string): string {\n\tconst trimmed = body.trim();\n\treturn trimmed.length > 512 ? `${trimmed.slice(0, 512)}…` : trimmed;\n}\n\nexport async function loadRadiusGatewayConfig(\n\tgateway: string,\n\tapiKey?: string,\n\tsignal?: AbortSignal,\n): Promise<RadiusGatewayConfig> {\n\tconst headers: Record<string, string> = { accept: \"application/json\" };\n\tif (apiKey) headers.authorization = `Bearer ${apiKey}`;\n\tconst response = await fetch(new URL(\"/v1/config\", gateway), { headers, signal });\n\tif (!response.ok) {\n\t\tthrow new Error(\n\t\t\t`Could not load Radius config from ${gateway}: ${response.status}: ${truncateHttpBody(await response.text())}`,\n\t\t);\n\t}\n\tconst config = sanitizeRadiusGatewayConfig(await response.json());\n\tif (!config) throw new Error(`Invalid Radius config from ${gateway}`);\n\treturn config;\n}\n"]}
|
|
@@ -1,23 +1,27 @@
|
|
|
1
1
|
export const DEFAULT_RADIUS_GATEWAY = "https://radius.pi.dev";
|
|
2
|
-
function isRecord(value) {
|
|
3
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
4
|
-
}
|
|
5
2
|
function isRadiusGatewayModel(value) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
typeof
|
|
3
|
+
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
4
|
+
return false;
|
|
5
|
+
const model = value;
|
|
6
|
+
return (typeof model.id === "string" &&
|
|
7
|
+
typeof model.name === "string" &&
|
|
8
|
+
typeof model.reasoning === "boolean" &&
|
|
9
|
+
Array.isArray(model.input) &&
|
|
10
|
+
typeof model.cost === "object" &&
|
|
11
|
+
model.cost !== null &&
|
|
12
|
+
!Array.isArray(model.cost) &&
|
|
13
|
+
typeof model.contextWindow === "number" &&
|
|
14
|
+
typeof model.maxTokens === "number");
|
|
14
15
|
}
|
|
15
16
|
function sanitizeRadiusGatewayConfig(config) {
|
|
16
|
-
if (
|
|
17
|
+
if (typeof config !== "object" || config === null || Array.isArray(config))
|
|
18
|
+
return undefined;
|
|
19
|
+
const { baseUrl, models } = config;
|
|
20
|
+
if (typeof baseUrl !== "string" || !Array.isArray(models))
|
|
17
21
|
return undefined;
|
|
18
22
|
return {
|
|
19
|
-
baseUrl
|
|
20
|
-
models:
|
|
23
|
+
baseUrl,
|
|
24
|
+
models: models.filter(isRadiusGatewayModel).map((model) => ({ ...model })),
|
|
21
25
|
};
|
|
22
26
|
}
|
|
23
27
|
export function normalizeRadiusGatewayUrl(value) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radius-config.js","sourceRoot":"","sources":["../../src/providers/radius-config.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,sBAAsB,GAAG,uBAAuB,CAAC;AAsB9D,SAAS,
|
|
1
|
+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AAK,UAAU,uBAAuB,CAC5C,OAAe,EACf,MAAe,EACf,MAAoB,EACW;IAC/B,MAAM,OAAO,GAA2B,EAAE,MAAM,EAAE,kBAAkB,EAAE,CAAC;IACvE,IAAI,MAAM;QAAE,OAAO,CAAC,aAAa,GAAG,UAAU,MAAM,EAAE,CAAC;IACvD,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,IAAI,GAAG,CAAC,YAAY,EAAE,OAAO,CAAC,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;IAClF,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QAClB,MAAM,IAAI,KAAK,CACd,qCAAqC,OAAO,KAAK,QAAQ,CAAC,MAAM,KAAK,gBAAgB,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,EAAE,CAC9G,CAAC;IACH,CAAC;IACD,MAAM,MAAM,GAAG,2BAA2B,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;IAClE,IAAI,CAAC,MAAM;QAAE,MAAM,IAAI,KAAK,CAAC,8BAA8B,OAAO,EAAE,CAAC,CAAC;IACtE,OAAO,MAAM,CAAC;AAAA,CACd","sourcesContent":["import type { OAuthCredential } from \"../auth/types.ts\";\nimport type { Model, ThinkingLevelMap } from \"../types.ts\";\n\nexport const DEFAULT_RADIUS_GATEWAY = \"https://radius.pi.dev\";\n\nexport type RadiusGatewayModel = {\n\tid: string;\n\tname: string;\n\treasoning: boolean;\n\tthinkingLevelMap?: ThinkingLevelMap;\n\tinput: (\"text\" | \"image\")[];\n\tcost: Model<\"pi-messages\">[\"cost\"];\n\tcontextWindow: number;\n\tmaxTokens: number;\n};\n\nexport type RadiusGatewayConfig = {\n\tbaseUrl: string;\n\tmodels: RadiusGatewayModel[];\n};\n\nexport type RadiusOAuthCredential = OAuthCredential & {\n\tgatewayConfig?: RadiusGatewayConfig;\n};\n\nfunction isRadiusGatewayModel(value: unknown): value is RadiusGatewayModel {\n\tif (typeof value !== \"object\" || value === null || Array.isArray(value)) return false;\n\tconst model = value as Partial<RadiusGatewayModel>;\n\treturn (\n\t\ttypeof model.id === \"string\" &&\n\t\ttypeof model.name === \"string\" &&\n\t\ttypeof model.reasoning === \"boolean\" &&\n\t\tArray.isArray(model.input) &&\n\t\ttypeof model.cost === \"object\" &&\n\t\tmodel.cost !== null &&\n\t\t!Array.isArray(model.cost) &&\n\t\ttypeof model.contextWindow === \"number\" &&\n\t\ttypeof model.maxTokens === \"number\"\n\t);\n}\n\nfunction sanitizeRadiusGatewayConfig(config: unknown): RadiusGatewayConfig | undefined {\n\tif (typeof config !== \"object\" || config === null || Array.isArray(config)) return undefined;\n\tconst { baseUrl, models } = config as Partial<RadiusGatewayConfig>;\n\tif (typeof baseUrl !== \"string\" || !Array.isArray(models)) return undefined;\n\treturn {\n\t\tbaseUrl,\n\t\tmodels: models.filter(isRadiusGatewayModel).map((model) => ({ ...model })),\n\t};\n}\n\nexport function normalizeRadiusGatewayUrl(value: string): string {\n\tconst withScheme = /^https?:\\/\\//iu.test(value) ? value : `https://${value}`;\n\treturn withScheme.replace(/\\/+$/u, \"\");\n}\n\nexport function getRadiusCredentialConfig(credential: OAuthCredential | undefined): RadiusGatewayConfig | undefined {\n\treturn sanitizeRadiusGatewayConfig((credential as RadiusOAuthCredential | undefined)?.gatewayConfig);\n}\n\nexport function getRadiusModelsFromConfig(providerId: string, config: RadiusGatewayConfig): Model<\"pi-messages\">[] {\n\treturn config.models.map((model) => ({\n\t\t...model,\n\t\tapi: \"pi-messages\",\n\t\tprovider: providerId,\n\t\tbaseUrl: config.baseUrl,\n\t}));\n}\n\nexport function getRadiusModels(providerId: string, credential: OAuthCredential | undefined): Model<\"pi-messages\">[] {\n\tconst config = getRadiusCredentialConfig(credential);\n\treturn config ? getRadiusModelsFromConfig(providerId, config) : [];\n}\n\nfunction truncateHttpBody(body: string): string {\n\tconst trimmed = body.trim();\n\treturn trimmed.length > 512 ? `${trimmed.slice(0, 512)}…` : trimmed;\n}\n\nexport async function loadRadiusGatewayConfig(\n\tgateway: string,\n\tapiKey?: string,\n\tsignal?: AbortSignal,\n): Promise<RadiusGatewayConfig> {\n\tconst headers: Record<string, string> = { accept: \"application/json\" };\n\tif (apiKey) headers.authorization = `Bearer ${apiKey}`;\n\tconst response = await fetch(new URL(\"/v1/config\", gateway), { headers, signal });\n\tif (!response.ok) {\n\t\tthrow new Error(\n\t\t\t`Could not load Radius config from ${gateway}: ${response.status}: ${truncateHttpBody(await response.text())}`,\n\t\t);\n\t}\n\tconst config = sanitizeRadiusGatewayConfig(await response.json());\n\tif (!config) throw new Error(`Invalid Radius config from ${gateway}`);\n\treturn config;\n}\n"]}
|