Преглед изворни кода

feat(core): cold-start providers/anthropic from lobe@main (9 models)

fanghanjun пре 6 месеци
родитељ
комит
bb952ccfb7
1 измењених фајлова са 90 додато и 0 уклоњено
  1. 90 0
      packages/core/src/llm/providers/anthropic.ts

+ 90 - 0
packages/core/src/llm/providers/anthropic.ts

@@ -0,0 +1,90 @@
+import type { InkosProvider } from "./types.js";
+
+export const ANTHROPIC: InkosProvider = {
+  id: "anthropic",
+  label: "Anthropic",
+  api: "anthropic-messages",
+  baseUrl: "https://api.anthropic.com",
+  checkModel: "claude-haiku-4-5-20251001",
+  temperatureRange: [0, 1],
+  defaultTemperature: 1.0,
+  writingTemperature: 1.0,
+  temperatureHint: "不要同时改 temperature 和 top_p",
+  models: [
+    {
+      id: "claude-opus-4-6",
+      displayName: "Claude Opus 4.6",
+      maxOutput: 128_000,
+      contextWindowTokens: 1_000_000,
+      abilities: { reasoning: true, vision: true, functionCall: true, search: true, structuredOutput: true },
+      enabled: true,
+      releasedAt: "2026-02-05",
+    },
+    {
+      id: "claude-sonnet-4-6",
+      displayName: "Claude Sonnet 4.6",
+      maxOutput: 64_000,
+      contextWindowTokens: 1_000_000,
+      abilities: { reasoning: true, vision: true, functionCall: true, search: true, structuredOutput: true },
+      enabled: true,
+      releasedAt: "2026-02-17",
+    },
+    {
+      id: "claude-opus-4-5-20251101",
+      displayName: "Claude Opus 4.5",
+      maxOutput: 64_000,
+      contextWindowTokens: 200_000,
+      abilities: { reasoning: true, vision: true, functionCall: true, search: true, structuredOutput: true },
+      releasedAt: "2025-11-24",
+    },
+    {
+      id: "claude-sonnet-4-5-20250929",
+      displayName: "Claude Sonnet 4.5",
+      maxOutput: 64_000,
+      contextWindowTokens: 200_000,
+      abilities: { reasoning: true, vision: true, functionCall: true, search: true, structuredOutput: true },
+      releasedAt: "2025-09-29",
+    },
+    {
+      id: "claude-haiku-4-5-20251001",
+      displayName: "Claude Haiku 4.5",
+      maxOutput: 64_000,
+      contextWindowTokens: 200_000,
+      abilities: { reasoning: true, vision: true, functionCall: true, search: true, structuredOutput: true },
+      enabled: true,
+      releasedAt: "2025-10-16",
+    },
+    {
+      id: "claude-opus-4-1-20250805",
+      displayName: "Claude Opus 4.1",
+      maxOutput: 32_000,
+      contextWindowTokens: 200_000,
+      abilities: { reasoning: true, vision: true, functionCall: true, search: true },
+      releasedAt: "2025-08-05",
+    },
+    {
+      id: "claude-opus-4-20250514",
+      displayName: "Claude Opus 4",
+      maxOutput: 32_000,
+      contextWindowTokens: 200_000,
+      abilities: { reasoning: true, vision: true, functionCall: true, search: true },
+      releasedAt: "2025-05-23",
+    },
+    {
+      id: "claude-sonnet-4-20250514",
+      displayName: "Claude Sonnet 4",
+      maxOutput: 64_000,
+      contextWindowTokens: 200_000,
+      abilities: { reasoning: true, vision: true, functionCall: true, search: true },
+      releasedAt: "2025-05-23",
+    },
+    {
+      id: "claude-3-haiku-20240307",
+      displayName: "Claude 3 Haiku",
+      maxOutput: 4096,
+      contextWindowTokens: 200_000,
+      abilities: { vision: true, functionCall: true },
+      releasedAt: "2024-03-07",
+    },
+  ],
+};