@gitkraken/core-gitlens 0.5.110 → 0.5.111
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/CHANGELOG.md +16 -1
- package/dist/git/cache.d.ts +111 -6
- package/dist/git/cache.d.ts.map +1 -1
- package/dist/git/cache.js +312 -43
- package/dist/git/cache.js.map +1 -1
- package/dist/git/context.d.ts +11 -0
- package/dist/git/context.d.ts.map +1 -1
- package/dist/git/context.js.map +1 -1
- package/dist/git/models/fileStatus.d.ts +1 -0
- package/dist/git/models/fileStatus.d.ts.map +1 -1
- package/dist/git/models/fileStatus.js +1 -0
- package/dist/git/models/fileStatus.js.map +1 -1
- package/dist/git/models/issue.d.ts +4 -0
- package/dist/git/models/issue.d.ts.map +1 -1
- package/dist/git/models/mergeConflicts.d.ts +2 -0
- package/dist/git/models/mergeConflicts.d.ts.map +1 -1
- package/dist/git/models/pullRequest.d.ts +38 -2
- package/dist/git/models/pullRequest.d.ts.map +1 -1
- package/dist/git/models/pullRequest.js +12 -1
- package/dist/git/models/pullRequest.js.map +1 -1
- package/dist/git/models/repository.d.ts +32 -5
- package/dist/git/models/repository.d.ts.map +1 -1
- package/dist/git/models/repository.js +58 -12
- package/dist/git/models/repository.js.map +1 -1
- package/dist/git/models/statusFile.d.ts.map +1 -1
- package/dist/git/models/statusFile.js +3 -0
- package/dist/git/models/statusFile.js.map +1 -1
- package/dist/git/providers/branches.d.ts +2 -0
- package/dist/git/providers/branches.d.ts.map +1 -1
- package/dist/git/providers/commits.d.ts +8 -0
- package/dist/git/providers/commits.d.ts.map +1 -1
- package/dist/git/providers/config.d.ts +19 -1
- package/dist/git/providers/config.d.ts.map +1 -1
- package/dist/git/providers/operations.d.ts +1 -0
- package/dist/git/providers/operations.d.ts.map +1 -1
- package/dist/git/providers/pausedOperations.d.ts +2 -0
- package/dist/git/providers/pausedOperations.d.ts.map +1 -1
- package/dist/git/providers/status.d.ts +1 -0
- package/dist/git/providers/status.d.ts.map +1 -1
- package/dist/git/utils/config.utils.d.ts +3 -0
- package/dist/git/utils/config.utils.d.ts.map +1 -0
- package/dist/git/utils/config.utils.js +8 -0
- package/dist/git/utils/config.utils.js.map +1 -0
- package/dist/git/utils/issue.utils.d.ts.map +1 -1
- package/dist/git/utils/issue.utils.js +2 -0
- package/dist/git/utils/issue.utils.js.map +1 -1
- package/dist/git/utils/pausedOperationStatus.utils.d.ts +14 -0
- package/dist/git/utils/pausedOperationStatus.utils.d.ts.map +1 -1
- package/dist/git/utils/pausedOperationStatus.utils.js +23 -0
- package/dist/git/utils/pausedOperationStatus.utils.js.map +1 -1
- package/dist/git/utils/pullRequest.utils.d.ts +14 -1
- package/dist/git/utils/pullRequest.utils.d.ts.map +1 -1
- package/dist/git/utils/pullRequest.utils.js +31 -0
- package/dist/git/utils/pullRequest.utils.js.map +1 -1
- package/dist/git/watching/changeEvent.d.ts +6 -1
- package/dist/git/watching/changeEvent.d.ts.map +1 -1
- package/dist/git/watching/classifyChange.d.ts.map +1 -1
- package/dist/git/watching/classifyChange.js +14 -1
- package/dist/git/watching/classifyChange.js.map +1 -1
- package/dist/git/watching/watchService.d.ts.map +1 -1
- package/dist/git/watching/watchService.js +18 -3
- package/dist/git/watching/watchService.js.map +1 -1
- package/dist/git/watching/watchSession.d.ts +8 -1
- package/dist/git/watching/watchSession.d.ts.map +1 -1
- package/dist/git/watching/watchSession.js +38 -6
- package/dist/git/watching/watchSession.js.map +1 -1
- package/dist/git/watching/watcherPatterns.d.ts +2 -2
- package/dist/git/watching/watcherPatterns.d.ts.map +1 -1
- package/dist/git/watching/watcherPatterns.js +1 -1
- package/dist/git/watching/watcherPatterns.js.map +1 -1
- package/dist/git-cli/exec/git.d.ts +1 -1
- package/dist/git-cli/exec/git.d.ts.map +1 -1
- package/dist/git-cli/exec/git.js +13 -3
- package/dist/git-cli/exec/git.js.map +1 -1
- package/dist/git-cli/providers/branches.d.ts +19 -0
- package/dist/git-cli/providers/branches.d.ts.map +1 -1
- package/dist/git-cli/providers/branches.js +282 -78
- package/dist/git-cli/providers/branches.js.map +1 -1
- package/dist/git-cli/providers/commits.d.ts +4 -0
- package/dist/git-cli/providers/commits.d.ts.map +1 -1
- package/dist/git-cli/providers/commits.js +84 -11
- package/dist/git-cli/providers/commits.js.map +1 -1
- package/dist/git-cli/providers/config.d.ts +42 -0
- package/dist/git-cli/providers/config.d.ts.map +1 -1
- package/dist/git-cli/providers/config.js +186 -5
- package/dist/git-cli/providers/config.js.map +1 -1
- package/dist/git-cli/providers/contributors.d.ts.map +1 -1
- package/dist/git-cli/providers/contributors.js +1 -1
- package/dist/git-cli/providers/contributors.js.map +1 -1
- package/dist/git-cli/providers/graph.d.ts +2 -2
- package/dist/git-cli/providers/graph.d.ts.map +1 -1
- package/dist/git-cli/providers/graph.js +27 -9
- package/dist/git-cli/providers/graph.js.map +1 -1
- package/dist/git-cli/providers/operations.d.ts.map +1 -1
- package/dist/git-cli/providers/operations.js +40 -12
- package/dist/git-cli/providers/operations.js.map +1 -1
- package/dist/git-cli/providers/pausedOperations.d.ts +5 -0
- package/dist/git-cli/providers/pausedOperations.d.ts.map +1 -1
- package/dist/git-cli/providers/pausedOperations.js +87 -16
- package/dist/git-cli/providers/pausedOperations.js.map +1 -1
- package/dist/git-cli/providers/refs.d.ts +5 -3
- package/dist/git-cli/providers/refs.d.ts.map +1 -1
- package/dist/git-cli/providers/refs.js +33 -4
- package/dist/git-cli/providers/refs.js.map +1 -1
- package/dist/git-cli/providers/status.d.ts +1 -0
- package/dist/git-cli/providers/status.d.ts.map +1 -1
- package/dist/git-cli/providers/status.js +18 -3
- package/dist/git-cli/providers/status.js.map +1 -1
- package/dist/git-cli/providers/worktrees.d.ts.map +1 -1
- package/dist/git-cli/providers/worktrees.js +4 -0
- package/dist/git-cli/providers/worktrees.js.map +1 -1
- package/dist/git-cli/service.d.ts.map +1 -1
- package/dist/git-cli/service.js.map +1 -1
- package/dist/plus/agents/providers/claudeCodeProvider.d.ts +39 -1
- package/dist/plus/agents/providers/claudeCodeProvider.d.ts.map +1 -1
- package/dist/plus/agents/providers/claudeCodeProvider.js +978 -71
- package/dist/plus/agents/providers/claudeCodeProvider.js.map +1 -1
- package/dist/plus/agents/providers/claudeCodeTranscript.d.ts +24 -2
- package/dist/plus/agents/providers/claudeCodeTranscript.d.ts.map +1 -1
- package/dist/plus/agents/providers/claudeCodeTranscript.js +84 -9
- package/dist/plus/agents/providers/claudeCodeTranscript.js.map +1 -1
- package/dist/plus/agents/types.d.ts +37 -2
- package/dist/plus/agents/types.d.ts.map +1 -1
- package/dist/plus/agents/types.js +2 -0
- package/dist/plus/agents/types.js.map +1 -1
- package/dist/plus/ai/errors.d.ts +10 -0
- package/dist/plus/ai/errors.d.ts.map +1 -1
- package/dist/plus/ai/errors.js +29 -0
- package/dist/plus/ai/errors.js.map +1 -1
- package/dist/plus/ai/models/model.d.ts +4 -0
- package/dist/plus/ai/models/model.d.ts.map +1 -1
- package/dist/plus/ai/models/model.js +51 -6
- package/dist/plus/ai/models/model.js.map +1 -1
- package/dist/plus/ai/models/promptTemplates.d.ts +1 -1
- package/dist/plus/ai/models/promptTemplates.d.ts.map +1 -1
- package/dist/plus/ai/models/provider.d.ts +60 -2
- package/dist/plus/ai/models/provider.d.ts.map +1 -1
- package/dist/plus/ai/prompts.d.ts +12 -0
- package/dist/plus/ai/prompts.d.ts.map +1 -1
- package/dist/plus/ai/prompts.js +177 -61
- package/dist/plus/ai/prompts.js.map +1 -1
- package/dist/plus/ai/providers/anthropicProvider.d.ts +10 -2
- package/dist/plus/ai/providers/anthropicProvider.d.ts.map +1 -1
- package/dist/plus/ai/providers/anthropicProvider.js +139 -46
- package/dist/plus/ai/providers/anthropicProvider.js.map +1 -1
- package/dist/plus/ai/providers/deepSeekProvider.d.ts +2 -0
- package/dist/plus/ai/providers/deepSeekProvider.d.ts.map +1 -1
- package/dist/plus/ai/providers/deepSeekProvider.js +10 -21
- package/dist/plus/ai/providers/deepSeekProvider.js.map +1 -1
- package/dist/plus/ai/providers/geminiProvider.d.ts +1 -0
- package/dist/plus/ai/providers/geminiProvider.d.ts.map +1 -1
- package/dist/plus/ai/providers/geminiProvider.js +19 -0
- package/dist/plus/ai/providers/geminiProvider.js.map +1 -1
- package/dist/plus/ai/providers/gitkrakenProvider.d.ts +5 -1
- package/dist/plus/ai/providers/gitkrakenProvider.d.ts.map +1 -1
- package/dist/plus/ai/providers/gitkrakenProvider.js +118 -3
- package/dist/plus/ai/providers/gitkrakenProvider.js.map +1 -1
- package/dist/plus/ai/providers/huggingFaceProvider.d.ts +1 -0
- package/dist/plus/ai/providers/huggingFaceProvider.d.ts.map +1 -1
- package/dist/plus/ai/providers/huggingFaceProvider.js +5 -0
- package/dist/plus/ai/providers/huggingFaceProvider.js.map +1 -1
- package/dist/plus/ai/providers/mistralProvider.d.ts +3 -1
- package/dist/plus/ai/providers/mistralProvider.d.ts.map +1 -1
- package/dist/plus/ai/providers/mistralProvider.js +99 -19
- package/dist/plus/ai/providers/mistralProvider.js.map +1 -1
- package/dist/plus/ai/providers/ollamaProvider.d.ts +4 -3
- package/dist/plus/ai/providers/ollamaProvider.d.ts.map +1 -1
- package/dist/plus/ai/providers/ollamaProvider.js +38 -3
- package/dist/plus/ai/providers/ollamaProvider.js.map +1 -1
- package/dist/plus/ai/providers/openAICompatibleProvider.d.ts +1 -0
- package/dist/plus/ai/providers/openAICompatibleProvider.d.ts.map +1 -1
- package/dist/plus/ai/providers/openAICompatibleProvider.js +4 -0
- package/dist/plus/ai/providers/openAICompatibleProvider.js.map +1 -1
- package/dist/plus/ai/providers/openAICompatibleProviderBase.d.ts +154 -5
- package/dist/plus/ai/providers/openAICompatibleProviderBase.d.ts.map +1 -1
- package/dist/plus/ai/providers/openAICompatibleProviderBase.js +259 -10
- package/dist/plus/ai/providers/openAICompatibleProviderBase.js.map +1 -1
- package/dist/plus/ai/providers/openRouterProvider.d.ts +4 -0
- package/dist/plus/ai/providers/openRouterProvider.d.ts.map +1 -1
- package/dist/plus/ai/providers/openRouterProvider.js +9 -0
- package/dist/plus/ai/providers/openRouterProvider.js.map +1 -1
- package/dist/plus/ai/providers/openaiProvider.d.ts +1 -0
- package/dist/plus/ai/providers/openaiProvider.d.ts.map +1 -1
- package/dist/plus/ai/providers/openaiProvider.js +1 -0
- package/dist/plus/ai/providers/openaiProvider.js.map +1 -1
- package/dist/plus/ai/providers/responseFormatCache.d.ts +8 -0
- package/dist/plus/ai/providers/responseFormatCache.d.ts.map +1 -0
- package/dist/plus/ai/providers/responseFormatCache.js +25 -0
- package/dist/plus/ai/providers/responseFormatCache.js.map +1 -0
- package/dist/plus/ai/providers/xaiProvider.d.ts +1 -0
- package/dist/plus/ai/providers/xaiProvider.d.ts.map +1 -1
- package/dist/plus/ai/providers/xaiProvider.js +10 -1
- package/dist/plus/ai/providers/xaiProvider.js.map +1 -1
- package/dist/plus/ai/utils/ai.utils.d.ts +3 -0
- package/dist/plus/ai/utils/ai.utils.d.ts.map +1 -1
- package/dist/plus/ai/utils/ai.utils.js +13 -0
- package/dist/plus/ai/utils/ai.utils.js.map +1 -1
- package/dist/plus/ai/utils/results.utils.d.ts +16 -2
- package/dist/plus/ai/utils/results.utils.d.ts.map +1 -1
- package/dist/plus/ai/utils/results.utils.js +204 -28
- package/dist/plus/ai/utils/results.utils.js.map +1 -1
- package/dist/plus/git-github/api/github.d.ts +55 -0
- package/dist/plus/git-github/api/github.d.ts.map +1 -1
- package/dist/plus/git-github/api/github.js +177 -4
- package/dist/plus/git-github/api/github.js.map +1 -1
- package/dist/plus/git-github/models.d.ts +16 -0
- package/dist/plus/git-github/models.d.ts.map +1 -1
- package/dist/plus/git-github/models.js +29 -3
- package/dist/plus/git-github/models.js.map +1 -1
- package/dist/plus/git-github/providers/github/status.d.ts +1 -0
- package/dist/plus/git-github/providers/github/status.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/status.js.map +1 -1
- package/dist/plus/integrations/context.d.ts +4 -0
- package/dist/plus/integrations/context.d.ts.map +1 -1
- package/dist/plus/integrations/index.d.ts.map +1 -1
- package/dist/plus/integrations/index.js +2 -0
- package/dist/plus/integrations/index.js.map +1 -1
- package/dist/plus/integrations/models/gitHostIntegration.d.ts +6 -3
- package/dist/plus/integrations/models/gitHostIntegration.d.ts.map +1 -1
- package/dist/plus/integrations/models/gitHostIntegration.js +12 -2
- package/dist/plus/integrations/models/gitHostIntegration.js.map +1 -1
- package/dist/plus/integrations/models/integration.d.ts +3 -1
- package/dist/plus/integrations/models/integration.d.ts.map +1 -1
- package/dist/plus/integrations/models/integration.js +2 -2
- package/dist/plus/integrations/models/integration.js.map +1 -1
- package/dist/plus/integrations/providers/accounts.d.ts.map +1 -1
- package/dist/plus/integrations/providers/accounts.js +4 -0
- package/dist/plus/integrations/providers/accounts.js.map +1 -1
- package/dist/plus/integrations/providers/azure/models.d.ts.map +1 -1
- package/dist/plus/integrations/providers/azure/models.js +3 -0
- package/dist/plus/integrations/providers/azure/models.js.map +1 -1
- package/dist/plus/integrations/providers/bitbucket/models.d.ts.map +1 -1
- package/dist/plus/integrations/providers/bitbucket/models.js +1 -0
- package/dist/plus/integrations/providers/bitbucket/models.js.map +1 -1
- package/dist/plus/integrations/providers/github.d.ts +14 -2
- package/dist/plus/integrations/providers/github.d.ts.map +1 -1
- package/dist/plus/integrations/providers/github.js +55 -3
- package/dist/plus/integrations/providers/github.js.map +1 -1
- package/dist/plus/integrations/providers/gitlab.d.ts.map +1 -1
- package/dist/plus/integrations/providers/gitlab.js.map +1 -1
- package/dist/plus/integrations/providers/models.d.ts.map +1 -1
- package/dist/plus/integrations/providers/models.js +30 -4
- package/dist/plus/integrations/providers/models.js.map +1 -1
- package/dist/plus/integrations/reads/broaden.d.ts.map +1 -1
- package/dist/plus/integrations/reads/broaden.js +6 -1
- package/dist/plus/integrations/reads/broaden.js.map +1 -1
- package/dist/plus/integrations/reads/drains.d.ts.map +1 -1
- package/dist/plus/integrations/reads/drains.js +7 -4
- package/dist/plus/integrations/reads/drains.js.map +1 -1
- package/dist/plus/integrations/reads/hierarchy.d.ts.map +1 -1
- package/dist/plus/integrations/reads/hierarchy.js +3 -1
- package/dist/plus/integrations/reads/hierarchy.js.map +1 -1
- package/dist/plus/integrations/reads/issueTracker.d.ts.map +1 -1
- package/dist/plus/integrations/reads/issueTracker.js +8 -3
- package/dist/plus/integrations/reads/issueTracker.js.map +1 -1
- package/dist/plus/integrations/reads/issues.d.ts.map +1 -1
- package/dist/plus/integrations/reads/issues.js +9 -4
- package/dist/plus/integrations/reads/issues.js.map +1 -1
- package/dist/plus/integrations/reads/pullRequests.d.ts.map +1 -1
- package/dist/plus/integrations/reads/pullRequests.js +9 -4
- package/dist/plus/integrations/reads/pullRequests.js.map +1 -1
- package/dist/utils/env/browser/base64.d.ts +1 -1
- package/dist/utils/env/browser/base64.d.ts.map +1 -1
- package/dist/utils/env/node/base64.d.ts +1 -1
- package/dist/utils/env/node/base64.d.ts.map +1 -1
- package/dist/utils/env/node/base64.js +2 -0
- package/dist/utils/env/node/base64.js.map +1 -1
- package/dist/utils/keys/chord.d.ts +52 -0
- package/dist/utils/keys/chord.d.ts.map +1 -0
- package/dist/utils/keys/chord.js +135 -0
- package/dist/utils/keys/chord.js.map +1 -0
- package/dist/utils/keys/keybinding.d.ts +53 -0
- package/dist/utils/keys/keybinding.d.ts.map +1 -0
- package/dist/utils/keys/keybinding.js +58 -0
- package/dist/utils/keys/keybinding.js.map +1 -0
- package/dist/utils/path.d.ts +11 -0
- package/dist/utils/path.d.ts.map +1 -1
- package/dist/utils/path.js +13 -0
- package/dist/utils/path.js.map +1 -1
- package/package.json +13 -5
- package/src/git/cache.ts +383 -47
- package/src/git/context.ts +11 -0
- package/src/git/models/fileStatus.ts +1 -0
- package/src/git/models/issue.ts +4 -0
- package/src/git/models/mergeConflicts.ts +3 -2
- package/src/git/models/pullRequest.ts +33 -1
- package/src/git/models/repository.ts +58 -17
- package/src/git/models/statusFile.ts +3 -0
- package/src/git/providers/branches.ts +6 -0
- package/src/git/providers/commits.ts +11 -0
- package/src/git/providers/config.ts +18 -0
- package/src/git/providers/operations.ts +1 -0
- package/src/git/providers/pausedOperations.ts +2 -0
- package/src/git/providers/status.ts +1 -0
- package/src/git/utils/config.utils.ts +8 -0
- package/src/git/utils/issue.utils.ts +2 -0
- package/src/git/utils/pausedOperationStatus.utils.ts +28 -0
- package/src/git/utils/pullRequest.utils.ts +36 -0
- package/src/git/watching/changeEvent.ts +6 -1
- package/src/git/watching/classifyChange.ts +15 -1
- package/src/git/watching/watchService.ts +20 -3
- package/src/git/watching/watchSession.ts +41 -6
- package/src/git/watching/watcherPatterns.ts +1 -1
- package/src/git-cli/exec/git.ts +13 -3
- package/src/git-cli/providers/branches.ts +384 -132
- package/src/git-cli/providers/commits.ts +106 -15
- package/src/git-cli/providers/config.ts +229 -8
- package/src/git-cli/providers/contributors.ts +5 -1
- package/src/git-cli/providers/graph.ts +26 -13
- package/src/git-cli/providers/operations.ts +45 -20
- package/src/git-cli/providers/pausedOperations.ts +109 -17
- package/src/git-cli/providers/refs.ts +33 -3
- package/src/git-cli/providers/status.ts +25 -4
- package/src/git-cli/providers/worktrees.ts +5 -0
- package/src/git-cli/service.ts +0 -1
- package/src/plus/agents/providers/claudeCodeProvider.ts +1130 -87
- package/src/plus/agents/providers/claudeCodeTranscript.ts +95 -9
- package/src/plus/agents/types.ts +46 -2
- package/src/plus/ai/errors.ts +30 -0
- package/src/plus/ai/models/model.ts +56 -6
- package/src/plus/ai/models/promptTemplates.ts +1 -1
- package/src/plus/ai/models/provider.ts +69 -2
- package/src/plus/ai/prompts.ts +186 -61
- package/src/plus/ai/providers/anthropicProvider.ts +155 -47
- package/src/plus/ai/providers/deepSeekProvider.ts +11 -21
- package/src/plus/ai/providers/geminiProvider.ts +19 -0
- package/src/plus/ai/providers/gitkrakenProvider.ts +126 -3
- package/src/plus/ai/providers/huggingFaceProvider.ts +6 -0
- package/src/plus/ai/providers/mistralProvider.ts +102 -19
- package/src/plus/ai/providers/ollamaProvider.ts +55 -4
- package/src/plus/ai/providers/openAICompatibleProvider.ts +5 -0
- package/src/plus/ai/providers/openAICompatibleProviderBase.ts +360 -17
- package/src/plus/ai/providers/openRouterProvider.ts +17 -0
- package/src/plus/ai/providers/openaiProvider.ts +1 -0
- package/src/plus/ai/providers/responseFormatCache.ts +39 -0
- package/src/plus/ai/providers/xaiProvider.ts +10 -1
- package/src/plus/ai/utils/ai.utils.ts +14 -0
- package/src/plus/ai/utils/results.utils.ts +255 -31
- package/src/plus/git-github/api/github.ts +291 -7
- package/src/plus/git-github/models.ts +48 -2
- package/src/plus/git-github/providers/github/status.ts +1 -0
- package/src/plus/integrations/context.ts +4 -0
- package/src/plus/integrations/index.ts +2 -0
- package/src/plus/integrations/models/gitHostIntegration.ts +25 -2
- package/src/plus/integrations/models/integration.ts +23 -13
- package/src/plus/integrations/providers/accounts.ts +4 -0
- package/src/plus/integrations/providers/azure/models.ts +3 -0
- package/src/plus/integrations/providers/bitbucket/models.ts +1 -0
- package/src/plus/integrations/providers/github.ts +85 -1
- package/src/plus/integrations/providers/gitlab.ts +2 -10
- package/src/plus/integrations/providers/models.ts +36 -4
- package/src/plus/integrations/reads/broaden.ts +6 -1
- package/src/plus/integrations/reads/drains.ts +7 -4
- package/src/plus/integrations/reads/hierarchy.ts +3 -1
- package/src/plus/integrations/reads/issueTracker.ts +9 -3
- package/src/plus/integrations/reads/issues.ts +9 -4
- package/src/plus/integrations/reads/pullRequests.ts +9 -4
- package/src/utils/env/browser/base64.ts +1 -1
- package/src/utils/env/node/base64.ts +3 -1
- package/src/utils/keys/chord.ts +184 -0
- package/src/utils/keys/keybinding.ts +116 -0
- package/src/utils/path.ts +14 -0
|
@@ -1,232 +1,270 @@
|
|
|
1
1
|
import { anthropicProviderDescriptor as provider } from '../constants.js';
|
|
2
2
|
import { AIError, AIErrorReason } from '../errors.js';
|
|
3
3
|
import type { AIActionType, AIModel } from '../models/model.js';
|
|
4
|
-
import type { AIChatMessage, AIChatMessageRole } from '../models/provider.js';
|
|
4
|
+
import type { AIChatMessage, AIChatMessageRole, AIResponseFormat, AIToolDefinition } from '../models/provider.js';
|
|
5
5
|
import { getReducedMaxInputTokens } from '../utils/ai.utils.js';
|
|
6
|
+
import type { ChatCompletionRequest } from './openAICompatibleProviderBase.js';
|
|
6
7
|
import { OpenAICompatibleProviderBase } from './openAICompatibleProviderBase.js';
|
|
7
8
|
|
|
8
9
|
type AnthropicModel = AIModel<typeof provider.id>;
|
|
9
10
|
const models: AnthropicModel[] = [
|
|
10
11
|
{
|
|
11
|
-
id: 'claude-opus-
|
|
12
|
-
name: 'Claude Opus
|
|
13
|
-
maxTokens: { input:
|
|
12
|
+
id: 'claude-opus-5',
|
|
13
|
+
name: 'Claude Opus 5',
|
|
14
|
+
maxTokens: { input: 1000000, output: 128000 },
|
|
14
15
|
provider: provider,
|
|
15
16
|
temperature: null, // Sampling params removed on Opus 4.7+/Sonnet 5 (rejected with 400)
|
|
16
17
|
},
|
|
17
18
|
{
|
|
18
|
-
id: 'claude-
|
|
19
|
-
name: 'Claude
|
|
20
|
-
maxTokens: { input:
|
|
19
|
+
id: 'claude-fable-5',
|
|
20
|
+
name: 'Claude Fable 5',
|
|
21
|
+
maxTokens: { input: 1000000, output: 128000 },
|
|
21
22
|
provider: provider,
|
|
23
|
+
// Requires 30-day data retention; ZDR orgs get a 400 on every request
|
|
22
24
|
temperature: null, // Sampling params removed on Opus 4.7+/Sonnet 5 (rejected with 400)
|
|
23
25
|
},
|
|
24
26
|
{
|
|
25
|
-
id: 'claude-
|
|
26
|
-
name: 'Claude
|
|
27
|
-
maxTokens: { input:
|
|
27
|
+
id: 'claude-sonnet-5',
|
|
28
|
+
name: 'Claude Sonnet 5',
|
|
29
|
+
maxTokens: { input: 1000000, output: 128000 },
|
|
28
30
|
provider: provider,
|
|
29
|
-
|
|
31
|
+
temperature: null, // Sampling params removed on Opus 4.7+/Sonnet 5 (rejected with 400)
|
|
30
32
|
},
|
|
31
33
|
{
|
|
32
|
-
id: 'claude-
|
|
33
|
-
name: 'Claude
|
|
34
|
-
maxTokens: { input:
|
|
34
|
+
id: 'claude-opus-4-8',
|
|
35
|
+
name: 'Claude Opus 4.8',
|
|
36
|
+
maxTokens: { input: 1000000, output: 128000 },
|
|
35
37
|
provider: provider,
|
|
36
|
-
|
|
38
|
+
temperature: null, // Sampling params removed on Opus 4.7+/Sonnet 5 (rejected with 400)
|
|
37
39
|
},
|
|
38
40
|
{
|
|
39
41
|
id: 'claude-opus-4-7',
|
|
40
42
|
name: 'Claude Opus 4.7',
|
|
41
|
-
maxTokens: { input:
|
|
43
|
+
maxTokens: { input: 1000000, output: 128000 },
|
|
42
44
|
provider: provider,
|
|
43
45
|
temperature: null, // Sampling params removed on Opus 4.7+/Sonnet 5 (rejected with 400)
|
|
44
46
|
},
|
|
45
47
|
{
|
|
46
48
|
id: 'claude-sonnet-4-6',
|
|
47
49
|
name: 'Claude Sonnet 4.6',
|
|
48
|
-
maxTokens: { input:
|
|
50
|
+
maxTokens: { input: 1000000, output: 128000 },
|
|
49
51
|
provider: provider,
|
|
50
52
|
},
|
|
51
53
|
{
|
|
52
54
|
id: 'claude-opus-4-6',
|
|
53
55
|
name: 'Claude Opus 4.6',
|
|
54
|
-
maxTokens: { input:
|
|
56
|
+
maxTokens: { input: 1000000, output: 128000 },
|
|
57
|
+
provider: provider,
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
id: 'claude-haiku-4-5',
|
|
61
|
+
name: 'Claude Haiku 4.5',
|
|
62
|
+
maxTokens: { input: 200000, output: 64000 },
|
|
55
63
|
provider: provider,
|
|
64
|
+
default: true,
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
id: 'claude-haiku-4-5-20251001',
|
|
68
|
+
name: 'Claude Haiku 4.5',
|
|
69
|
+
maxTokens: { input: 200000, output: 64000 },
|
|
70
|
+
provider: provider,
|
|
71
|
+
hidden: true,
|
|
56
72
|
},
|
|
57
73
|
{
|
|
58
74
|
id: 'claude-sonnet-4-5',
|
|
59
75
|
name: 'Claude Sonnet 4.5',
|
|
60
|
-
maxTokens: { input:
|
|
76
|
+
maxTokens: { input: 200000, output: 64000 },
|
|
61
77
|
provider: provider,
|
|
62
78
|
hidden: true,
|
|
63
79
|
},
|
|
64
80
|
{
|
|
65
81
|
id: 'claude-sonnet-4-5-20250929',
|
|
66
82
|
name: 'Claude Sonnet 4.5',
|
|
67
|
-
maxTokens: { input:
|
|
83
|
+
maxTokens: { input: 200000, output: 64000 },
|
|
68
84
|
provider: provider,
|
|
69
85
|
hidden: true,
|
|
70
86
|
},
|
|
71
87
|
{
|
|
72
88
|
id: 'claude-opus-4-5',
|
|
73
89
|
name: 'Claude Opus 4.5',
|
|
74
|
-
maxTokens: { input:
|
|
90
|
+
maxTokens: { input: 200000, output: 64000 },
|
|
75
91
|
provider: provider,
|
|
76
92
|
hidden: true,
|
|
77
93
|
},
|
|
78
94
|
{
|
|
79
95
|
id: 'claude-opus-4-5-20251101',
|
|
80
96
|
name: 'Claude Opus 4.5',
|
|
81
|
-
maxTokens: { input:
|
|
97
|
+
maxTokens: { input: 200000, output: 64000 },
|
|
82
98
|
provider: provider,
|
|
83
99
|
hidden: true,
|
|
84
100
|
},
|
|
85
101
|
{
|
|
86
102
|
id: 'claude-opus-4-1',
|
|
87
103
|
name: 'Claude Opus 4.1',
|
|
88
|
-
maxTokens: { input:
|
|
104
|
+
maxTokens: { input: 200000, output: 32000 },
|
|
89
105
|
provider: provider,
|
|
90
106
|
hidden: true,
|
|
107
|
+
// Structured outputs require the 4.5 generation or newer (this and every entry below)
|
|
108
|
+
supportsStructuredOutputs: false,
|
|
91
109
|
},
|
|
92
110
|
{
|
|
93
111
|
id: 'claude-opus-4-1-20250805',
|
|
94
112
|
name: 'Claude Opus 4.1',
|
|
95
|
-
maxTokens: { input:
|
|
113
|
+
maxTokens: { input: 200000, output: 32000 },
|
|
96
114
|
provider: provider,
|
|
97
115
|
hidden: true,
|
|
116
|
+
supportsStructuredOutputs: false,
|
|
98
117
|
},
|
|
99
118
|
{
|
|
100
119
|
id: 'claude-opus-4-0',
|
|
101
120
|
name: 'Claude Opus 4',
|
|
102
|
-
maxTokens: { input:
|
|
121
|
+
maxTokens: { input: 200000, output: 32000 },
|
|
103
122
|
provider: provider,
|
|
104
123
|
hidden: true,
|
|
124
|
+
supportsStructuredOutputs: false,
|
|
105
125
|
},
|
|
106
126
|
{
|
|
107
127
|
id: 'claude-opus-4-20250514',
|
|
108
128
|
name: 'Claude Opus 4',
|
|
109
|
-
maxTokens: { input:
|
|
129
|
+
maxTokens: { input: 200000, output: 32000 },
|
|
110
130
|
provider: provider,
|
|
111
131
|
hidden: true,
|
|
132
|
+
supportsStructuredOutputs: false,
|
|
112
133
|
},
|
|
113
134
|
{
|
|
114
135
|
id: 'claude-sonnet-4-0',
|
|
115
136
|
name: 'Claude Sonnet 4',
|
|
116
|
-
maxTokens: { input:
|
|
137
|
+
maxTokens: { input: 200000, output: 64000 },
|
|
117
138
|
provider: provider,
|
|
118
139
|
hidden: true,
|
|
140
|
+
supportsStructuredOutputs: false,
|
|
119
141
|
},
|
|
120
142
|
{
|
|
121
143
|
id: 'claude-sonnet-4-20250514',
|
|
122
144
|
name: 'Claude Sonnet 4',
|
|
123
|
-
maxTokens: { input:
|
|
145
|
+
maxTokens: { input: 200000, output: 64000 },
|
|
124
146
|
provider: provider,
|
|
125
147
|
hidden: true,
|
|
148
|
+
supportsStructuredOutputs: false,
|
|
126
149
|
},
|
|
127
150
|
{
|
|
128
151
|
id: 'claude-3-7-sonnet-latest',
|
|
129
152
|
name: 'Claude Sonnet 3.7',
|
|
130
|
-
maxTokens: { input:
|
|
153
|
+
maxTokens: { input: 200000, output: 64000 },
|
|
131
154
|
provider: provider,
|
|
132
155
|
hidden: true,
|
|
156
|
+
supportsStructuredOutputs: false,
|
|
133
157
|
},
|
|
134
158
|
{
|
|
135
159
|
id: 'claude-3-7-sonnet-20250219',
|
|
136
160
|
name: 'Claude Sonnet 3.7',
|
|
137
|
-
maxTokens: { input:
|
|
161
|
+
maxTokens: { input: 200000, output: 64000 },
|
|
138
162
|
provider: provider,
|
|
139
163
|
hidden: true,
|
|
164
|
+
supportsStructuredOutputs: false,
|
|
140
165
|
},
|
|
141
166
|
{
|
|
142
167
|
id: 'claude-3-5-sonnet-latest',
|
|
143
168
|
name: 'Claude Sonnet 3.5',
|
|
144
|
-
maxTokens: { input:
|
|
169
|
+
maxTokens: { input: 200000, output: 8192 },
|
|
145
170
|
provider: provider,
|
|
146
171
|
hidden: true,
|
|
172
|
+
supportsStructuredOutputs: false,
|
|
147
173
|
},
|
|
148
174
|
{
|
|
149
175
|
id: 'claude-3-5-sonnet-20241022',
|
|
150
176
|
name: 'Claude Sonnet 3.5',
|
|
151
|
-
maxTokens: { input:
|
|
177
|
+
maxTokens: { input: 200000, output: 8192 },
|
|
152
178
|
provider: provider,
|
|
153
179
|
hidden: true,
|
|
180
|
+
supportsStructuredOutputs: false,
|
|
154
181
|
},
|
|
155
182
|
{
|
|
156
183
|
id: 'claude-3-5-sonnet-20240620',
|
|
157
184
|
name: 'Claude Sonnet 3.5',
|
|
158
|
-
maxTokens: { input:
|
|
185
|
+
maxTokens: { input: 200000, output: 8192 },
|
|
159
186
|
provider: provider,
|
|
160
187
|
hidden: true,
|
|
188
|
+
supportsStructuredOutputs: false,
|
|
161
189
|
},
|
|
162
190
|
{
|
|
163
191
|
id: 'claude-3-5-haiku-latest',
|
|
164
192
|
name: 'Claude Haiku 3.5',
|
|
165
|
-
maxTokens: { input:
|
|
193
|
+
maxTokens: { input: 200000, output: 8192 },
|
|
166
194
|
provider: provider,
|
|
167
195
|
hidden: true,
|
|
196
|
+
supportsStructuredOutputs: false,
|
|
168
197
|
},
|
|
169
198
|
{
|
|
170
199
|
id: 'claude-3-5-haiku-20241022',
|
|
171
200
|
name: 'Claude Haiku 3.5',
|
|
172
|
-
maxTokens: { input:
|
|
201
|
+
maxTokens: { input: 200000, output: 8192 },
|
|
173
202
|
provider: provider,
|
|
174
203
|
hidden: true,
|
|
204
|
+
supportsStructuredOutputs: false,
|
|
175
205
|
},
|
|
176
206
|
{
|
|
177
207
|
id: 'claude-3-opus-latest',
|
|
178
208
|
name: 'Claude Opus 3',
|
|
179
|
-
maxTokens: { input:
|
|
209
|
+
maxTokens: { input: 200000, output: 4096 },
|
|
180
210
|
provider: provider,
|
|
181
211
|
hidden: true,
|
|
212
|
+
supportsStructuredOutputs: false,
|
|
182
213
|
},
|
|
183
214
|
{
|
|
184
215
|
id: 'claude-3-opus-20240229',
|
|
185
216
|
name: 'Claude Opus 3',
|
|
186
|
-
maxTokens: { input:
|
|
217
|
+
maxTokens: { input: 200000, output: 4096 },
|
|
187
218
|
provider: provider,
|
|
188
219
|
hidden: true,
|
|
220
|
+
supportsStructuredOutputs: false,
|
|
189
221
|
},
|
|
190
222
|
{
|
|
191
223
|
id: 'claude-3-sonnet-latest',
|
|
192
224
|
name: 'Claude Sonnet 3',
|
|
193
|
-
maxTokens: { input:
|
|
225
|
+
maxTokens: { input: 200000, output: 4096 },
|
|
194
226
|
provider: provider,
|
|
195
227
|
hidden: true,
|
|
228
|
+
supportsStructuredOutputs: false,
|
|
196
229
|
},
|
|
197
230
|
{
|
|
198
231
|
id: 'claude-3-sonnet-20240229',
|
|
199
232
|
name: 'Claude Sonnet 3',
|
|
200
|
-
maxTokens: { input:
|
|
233
|
+
maxTokens: { input: 200000, output: 4096 },
|
|
201
234
|
provider: provider,
|
|
202
235
|
hidden: true,
|
|
236
|
+
supportsStructuredOutputs: false,
|
|
203
237
|
},
|
|
204
238
|
{
|
|
205
239
|
id: 'claude-3-haiku-latest',
|
|
206
240
|
name: 'Claude Haiku 3',
|
|
207
|
-
maxTokens: { input:
|
|
241
|
+
maxTokens: { input: 200000, output: 4096 },
|
|
208
242
|
provider: provider,
|
|
209
243
|
hidden: true,
|
|
244
|
+
supportsStructuredOutputs: false,
|
|
210
245
|
},
|
|
211
246
|
{
|
|
212
247
|
id: 'claude-3-haiku-20240307',
|
|
213
248
|
name: 'Claude Haiku 3',
|
|
214
|
-
maxTokens: { input:
|
|
249
|
+
maxTokens: { input: 200000, output: 4096 },
|
|
215
250
|
provider: provider,
|
|
216
251
|
hidden: true,
|
|
252
|
+
supportsStructuredOutputs: false,
|
|
217
253
|
},
|
|
218
254
|
{
|
|
219
255
|
id: 'claude-2.1',
|
|
220
256
|
name: 'Claude 2.1',
|
|
221
|
-
maxTokens: { input:
|
|
257
|
+
maxTokens: { input: 200000, output: 4096 },
|
|
222
258
|
provider: provider,
|
|
223
259
|
hidden: true,
|
|
260
|
+
supportsStructuredOutputs: false,
|
|
224
261
|
},
|
|
225
262
|
];
|
|
226
263
|
|
|
227
264
|
export class AnthropicProvider extends OpenAICompatibleProviderBase<typeof provider.id> {
|
|
228
265
|
readonly id = provider.id;
|
|
229
266
|
readonly name = provider.name;
|
|
267
|
+
readonly supportsTools = true;
|
|
230
268
|
protected readonly descriptor = provider;
|
|
231
269
|
protected readonly config = {
|
|
232
270
|
keyUrl: 'https://console.anthropic.com/account/keys',
|
|
@@ -241,6 +279,16 @@ export class AnthropicProvider extends OpenAICompatibleProviderBase<typeof provi
|
|
|
241
279
|
return 'https://api.anthropic.com/v1/messages';
|
|
242
280
|
}
|
|
243
281
|
|
|
282
|
+
// Anthropic uses `output_config.format` (no name/strict — enforcement is unconditional) and
|
|
283
|
+
// rejects unknown fields, so this must fully replace the base's `response_format` translation
|
|
284
|
+
protected override applyResponseFormat(
|
|
285
|
+
request: ChatCompletionRequest,
|
|
286
|
+
_model: AIModel<typeof provider.id>,
|
|
287
|
+
responseFormat: AIResponseFormat,
|
|
288
|
+
): void {
|
|
289
|
+
request.output_config = { format: { type: 'json_schema', schema: responseFormat.schema } };
|
|
290
|
+
}
|
|
291
|
+
|
|
244
292
|
protected override getHeaders<TAction extends AIActionType>(
|
|
245
293
|
_action: TAction,
|
|
246
294
|
apiKey: string,
|
|
@@ -291,13 +339,19 @@ export class AnthropicProvider extends OpenAICompatibleProviderBase<typeof provi
|
|
|
291
339
|
model: AIModel<typeof provider.id>,
|
|
292
340
|
retries: number,
|
|
293
341
|
maxInputTokens: number,
|
|
294
|
-
|
|
342
|
+
body?: string,
|
|
343
|
+
sentTools?: boolean,
|
|
344
|
+
): Promise<{ retry: true; maxInputTokens: number; withoutTools?: boolean }> {
|
|
295
345
|
if (rsp.status !== 404 && rsp.status !== 429) {
|
|
346
|
+
// Read into `body` (not the response) so `super.handleFetchFailure` below can still
|
|
347
|
+
// use it; consuming the response here would lose Anthropic's error for the fallback.
|
|
348
|
+
body ??= await rsp
|
|
349
|
+
.clone()
|
|
350
|
+
.text()
|
|
351
|
+
.catch(() => undefined);
|
|
296
352
|
let json;
|
|
297
353
|
try {
|
|
298
|
-
|
|
299
|
-
// otherwise it re-reads the consumed body, loses Anthropic's error, and falls back to statusText.
|
|
300
|
-
json = (await rsp.clone().json()) as AnthropicError | undefined;
|
|
354
|
+
json = (body != null ? JSON.parse(body) : undefined) as AnthropicError | undefined;
|
|
301
355
|
} catch {}
|
|
302
356
|
|
|
303
357
|
debugger;
|
|
@@ -330,10 +384,64 @@ export class AnthropicProvider extends OpenAICompatibleProviderBase<typeof provi
|
|
|
330
384
|
}
|
|
331
385
|
}
|
|
332
386
|
|
|
333
|
-
return super.handleFetchFailure(rsp, action, model, retries, maxInputTokens);
|
|
387
|
+
return super.handleFetchFailure(rsp, action, model, retries, maxInputTokens, body, sentTools);
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
protected override serializeTools(tools: readonly AIToolDefinition[]): { tools: unknown[] } {
|
|
391
|
+
// Anthropic names the schema field `input_schema` and has no `function` envelope.
|
|
392
|
+
return {
|
|
393
|
+
tools: tools.map(t => ({ name: t.name, description: t.description, input_schema: t.parameters })),
|
|
394
|
+
};
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
protected override serializeMessages(messages: AIChatMessage<AIChatMessageRole>[]): unknown[] {
|
|
398
|
+
const out: unknown[] = [];
|
|
399
|
+
|
|
400
|
+
for (const m of messages) {
|
|
401
|
+
// Anthropic carries tool results as `tool_result` blocks on a *user* message, not a
|
|
402
|
+
// `tool`-role message. Consecutive results are batched into one user turn, matching how the
|
|
403
|
+
// API expects a multi-tool-call round to be answered.
|
|
404
|
+
if (m.role === 'tool') {
|
|
405
|
+
// See the base provider: a result with no call id can't be addressed, so it goes as plain
|
|
406
|
+
// text instead of a `tool_use_id: undefined` block the API rejects.
|
|
407
|
+
if (m.toolCallId == null) {
|
|
408
|
+
out.push({ role: 'user', content: m.content });
|
|
409
|
+
continue;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
const block = { type: 'tool_result', tool_use_id: m.toolCallId, content: m.content };
|
|
413
|
+
const last = out.at(-1) as { role?: string; content?: unknown[] } | undefined;
|
|
414
|
+
if (last?.role === 'user' && Array.isArray(last.content) && isToolResultBlocks(last.content)) {
|
|
415
|
+
last.content.push(block);
|
|
416
|
+
} else {
|
|
417
|
+
out.push({ role: 'user', content: [block] });
|
|
418
|
+
}
|
|
419
|
+
continue;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
if (m.role === 'assistant' && m.toolCalls?.length) {
|
|
423
|
+
out.push({
|
|
424
|
+
role: 'assistant',
|
|
425
|
+
content: [
|
|
426
|
+
...(m.content ? [{ type: 'text', text: m.content }] : []),
|
|
427
|
+
...m.toolCalls.map(c => ({ type: 'tool_use', id: c.id, name: c.name, input: c.args })),
|
|
428
|
+
],
|
|
429
|
+
});
|
|
430
|
+
continue;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
out.push({ role: m.role, content: m.content });
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
return out;
|
|
334
437
|
}
|
|
335
438
|
}
|
|
336
439
|
|
|
440
|
+
/** Whether an assembled user message's content is a batch of `tool_result` blocks we can append to. */
|
|
441
|
+
function isToolResultBlocks(content: unknown[]): content is { type: string }[] {
|
|
442
|
+
return content.every(b => (b as { type?: string })?.type === 'tool_result');
|
|
443
|
+
}
|
|
444
|
+
|
|
337
445
|
interface AnthropicError {
|
|
338
446
|
type: 'error';
|
|
339
447
|
error: {
|
|
@@ -4,35 +4,19 @@ import { OpenAICompatibleProviderBase } from './openAICompatibleProviderBase.js'
|
|
|
4
4
|
|
|
5
5
|
type DeepSeekModel = AIModel<typeof provider.id>;
|
|
6
6
|
const models: DeepSeekModel[] = [
|
|
7
|
-
{
|
|
8
|
-
id: 'deepseek-v4-flash',
|
|
9
|
-
name: 'DeepSeek V4 Flash',
|
|
10
|
-
maxTokens: { input: 1000000, output: 65536 },
|
|
11
|
-
provider: provider,
|
|
12
|
-
default: true,
|
|
13
|
-
temperature: 0.0, // Recommended for Coding/Math
|
|
14
|
-
},
|
|
15
7
|
{
|
|
16
8
|
id: 'deepseek-v4-pro',
|
|
17
9
|
name: 'DeepSeek V4 Pro',
|
|
18
|
-
maxTokens: { input: 1000000, output:
|
|
19
|
-
provider: provider,
|
|
20
|
-
temperature: 0.0, // Recommended for Coding/Math
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
id: 'deepseek-chat',
|
|
24
|
-
name: 'DeepSeek-V3',
|
|
25
|
-
maxTokens: { input: 65536, output: 8192 },
|
|
10
|
+
maxTokens: { input: 1000000, output: 384000 }, // DeepSeek publishes "384K" only; decimal reading avoids overstating
|
|
26
11
|
provider: provider,
|
|
27
|
-
hidden: true,
|
|
28
12
|
temperature: 0.0, // Recommended for Coding/Math
|
|
29
13
|
},
|
|
30
14
|
{
|
|
31
|
-
id: 'deepseek-
|
|
32
|
-
name: 'DeepSeek
|
|
33
|
-
maxTokens: { input:
|
|
15
|
+
id: 'deepseek-v4-flash',
|
|
16
|
+
name: 'DeepSeek V4 Flash',
|
|
17
|
+
maxTokens: { input: 1000000, output: 384000 },
|
|
34
18
|
provider: provider,
|
|
35
|
-
|
|
19
|
+
default: true,
|
|
36
20
|
temperature: 0.0, // Recommended for Coding/Math
|
|
37
21
|
},
|
|
38
22
|
];
|
|
@@ -40,6 +24,7 @@ const models: DeepSeekModel[] = [
|
|
|
40
24
|
export class DeepSeekProvider extends OpenAICompatibleProviderBase<typeof provider.id> {
|
|
41
25
|
readonly id = provider.id;
|
|
42
26
|
readonly name = provider.name;
|
|
27
|
+
readonly supportsTools = true;
|
|
43
28
|
protected readonly descriptor = provider;
|
|
44
29
|
protected readonly config = {
|
|
45
30
|
keyUrl: 'https://platform.deepseek.com/api_keys',
|
|
@@ -53,4 +38,9 @@ export class DeepSeekProvider extends OpenAICompatibleProviderBase<typeof provid
|
|
|
53
38
|
protected getUrl(_model: AIModel<typeof provider.id>): string {
|
|
54
39
|
return 'https://api.deepseek.com/v1/chat/completions';
|
|
55
40
|
}
|
|
41
|
+
|
|
42
|
+
// DeepSeek's response_format only accepts text|json_object — json_schema is rejected outright
|
|
43
|
+
protected override supportsResponseFormat(_model: AIModel<typeof provider.id>): boolean {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
56
46
|
}
|
|
@@ -4,6 +4,13 @@ import { OpenAICompatibleProviderBase } from './openAICompatibleProviderBase.js'
|
|
|
4
4
|
|
|
5
5
|
type GeminiModel = AIModel<typeof provider.id>;
|
|
6
6
|
const models: GeminiModel[] = [
|
|
7
|
+
{
|
|
8
|
+
id: 'gemini-3.7-flash',
|
|
9
|
+
name: 'Gemini 3.7 Flash',
|
|
10
|
+
maxTokens: { input: 1048576, output: 65536 },
|
|
11
|
+
provider: provider,
|
|
12
|
+
temperature: null, // Gemini 3.x reasoning is tuned for its default temperature; don't override
|
|
13
|
+
},
|
|
7
14
|
{
|
|
8
15
|
id: 'gemini-3.6-flash',
|
|
9
16
|
name: 'Gemini 3.6 Flash',
|
|
@@ -142,6 +149,10 @@ const models: GeminiModel[] = [
|
|
|
142
149
|
maxTokens: { input: 2097152, output: 8192 },
|
|
143
150
|
provider: provider,
|
|
144
151
|
hidden: true,
|
|
152
|
+
// The OpenAI-compat endpoint's `response_format: json_schema` postdates these frozen
|
|
153
|
+
// pre-GA snapshots and the 1.5 generation (this and every entry below); GA 2.x+ models
|
|
154
|
+
// stay on by default and rely on strip-and-retry for the shapes its converter rejects
|
|
155
|
+
supportsStructuredOutputs: false,
|
|
145
156
|
},
|
|
146
157
|
{
|
|
147
158
|
id: 'gemini-2.0-flash-thinking-exp-01-21',
|
|
@@ -149,6 +160,7 @@ const models: GeminiModel[] = [
|
|
|
149
160
|
maxTokens: { input: 1048576, output: 8192 },
|
|
150
161
|
provider: provider,
|
|
151
162
|
hidden: true,
|
|
163
|
+
supportsStructuredOutputs: false,
|
|
152
164
|
},
|
|
153
165
|
{
|
|
154
166
|
id: 'gemini-2.0-flash-exp',
|
|
@@ -156,6 +168,7 @@ const models: GeminiModel[] = [
|
|
|
156
168
|
maxTokens: { input: 1048576, output: 8192 },
|
|
157
169
|
provider: provider,
|
|
158
170
|
hidden: true,
|
|
171
|
+
supportsStructuredOutputs: false,
|
|
159
172
|
},
|
|
160
173
|
{
|
|
161
174
|
id: 'gemini-exp-1206',
|
|
@@ -163,6 +176,7 @@ const models: GeminiModel[] = [
|
|
|
163
176
|
maxTokens: { input: 2097152, output: 8192 },
|
|
164
177
|
provider: provider,
|
|
165
178
|
hidden: true,
|
|
179
|
+
supportsStructuredOutputs: false,
|
|
166
180
|
},
|
|
167
181
|
{
|
|
168
182
|
id: 'gemini-exp-1121',
|
|
@@ -170,6 +184,7 @@ const models: GeminiModel[] = [
|
|
|
170
184
|
maxTokens: { input: 2097152, output: 8192 },
|
|
171
185
|
provider: provider,
|
|
172
186
|
hidden: true,
|
|
187
|
+
supportsStructuredOutputs: false,
|
|
173
188
|
},
|
|
174
189
|
{
|
|
175
190
|
id: 'gemini-1.5-pro',
|
|
@@ -177,6 +192,7 @@ const models: GeminiModel[] = [
|
|
|
177
192
|
maxTokens: { input: 2097152, output: 8192 },
|
|
178
193
|
provider: provider,
|
|
179
194
|
hidden: true,
|
|
195
|
+
supportsStructuredOutputs: false,
|
|
180
196
|
},
|
|
181
197
|
{
|
|
182
198
|
id: 'gemini-1.5-flash',
|
|
@@ -184,6 +200,7 @@ const models: GeminiModel[] = [
|
|
|
184
200
|
maxTokens: { input: 1048576, output: 8192 },
|
|
185
201
|
provider: provider,
|
|
186
202
|
hidden: true,
|
|
203
|
+
supportsStructuredOutputs: false,
|
|
187
204
|
},
|
|
188
205
|
{
|
|
189
206
|
id: 'gemini-1.5-flash-8b',
|
|
@@ -191,12 +208,14 @@ const models: GeminiModel[] = [
|
|
|
191
208
|
maxTokens: { input: 1048576, output: 8192 },
|
|
192
209
|
provider: provider,
|
|
193
210
|
hidden: true,
|
|
211
|
+
supportsStructuredOutputs: false,
|
|
194
212
|
},
|
|
195
213
|
];
|
|
196
214
|
|
|
197
215
|
export class GeminiProvider extends OpenAICompatibleProviderBase<typeof provider.id> {
|
|
198
216
|
readonly id = provider.id;
|
|
199
217
|
readonly name = provider.name;
|
|
218
|
+
readonly supportsTools = true;
|
|
200
219
|
protected readonly descriptor = provider;
|
|
201
220
|
protected readonly config = {
|
|
202
221
|
keyUrl: 'https://aistudio.google.com/app/apikey',
|