offPeakSelection.ts 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import type { ModelSelectionView } from "@zcode/provider";
  2. import { OFF_PEAK_PROVIDER_IDS } from "@zcode/shared";
  3. /** 两个域同时存在,用于锁定工具只能选择当前账号域,不能按 Provider 顺序猜。 */
  4. export function offPeakSelectionView(
  5. values: readonly string[] = ["disabled", "high", "max"],
  6. ): ModelSelectionView {
  7. return {
  8. revision: 1,
  9. providers: (["bigmodel", "zai"] as const).map((family) => ({
  10. providerId: OFF_PEAK_PROVIDER_IDS[family],
  11. config: { visibility: "hidden" },
  12. models: [family === "zai" ? "ZAI-only" : "BigModel-only", "GLM-5.2"].map((modelId) => ({
  13. modelId,
  14. config: {
  15. enabled: true,
  16. properties: {
  17. requiresMfjsToolSchema: false,
  18. contextWindow: 200000,
  19. inputFormat: {
  20. supportsText: true,
  21. supportsImage: false,
  22. supportsVideo: false,
  23. supportsAudio: false,
  24. supportsPdf: false,
  25. },
  26. outputFormat: { supportsText: true },
  27. supportsToolCall: true,
  28. supportsJsonSchemaOutput: false,
  29. supportsNativeWebSearch: false,
  30. supportsMidConversationSystem: false,
  31. },
  32. optionSpecs: {
  33. reasoningLevel: { values, map: "{}" },
  34. maxOutputTokens: { max: 32000, map: "{}" },
  35. },
  36. },
  37. })),
  38. })),
  39. };
  40. }