Ver Fonte

dev: attempt adding Claude 3.7

At this commit support is not tested. I was unable to get the AI module
in puter.js to call 3.7 instead of the old 3.5 model.
KernelDeimos há 2 meses atrás
pai
commit
8ed1f801b8

+ 12 - 0
src/backend/src/modules/puterai/ClaudeService.js

@@ -232,6 +232,18 @@ class ClaudeService extends BaseService {
     */
     async models_ () {
         return [
+            {
+                id: 'claude-3-7-sonnet-20250219',
+                aliases: ['claude-3-7-sonnet-latest'],
+                context: 200000,
+                cost: {
+                    currency: 'usd-cents',
+                    tokens: 1_000_000,
+                    input: 300,
+                    output: 1500,
+                },
+                max_output: 8192,
+            },
             {
                 id: 'claude-3-5-sonnet-20241022',
                 name: 'Claude 3.5 Sonnet',

+ 6 - 2
src/puter-js/src/modules/AI.js

@@ -228,9 +228,12 @@ class AI{
         }
 
         // convert to the correct model name if necessary
-        if( options.model === 'claude-3-5-sonnet' || options.model === 'claude'){
+        if( options.model === 'claude-3-5-sonnet'){
             options.model = 'claude-3-5-sonnet-latest';
         }
+        if( options.model === 'claude-3-7-sonnet' || options.model === 'claude'){
+            options.model = 'claude-3-7-sonnet-latest';
+        }
         if ( options.model === 'mistral' ) {
             options.model = 'mistral-large-latest';
         }
@@ -248,7 +251,8 @@ class AI{
             options.model === 'claude-3-haiku-20240307' ||
             options.model === 'claude-3-5-sonnet-20240620' ||
             options.model === 'claude-3-5-sonnet-20241022' ||
-            options.model === 'claude-3-5-sonnet-latest'
+            options.model === 'claude-3-5-sonnet-latest' ||
+            options.model === 'claude-3-7-sonnet-latest'
         ){
             driver = 'claude';
         }else if(options.model === 'meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo' || options.model === 'meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo' || options.model === 'meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo' || options.model === `google/gemma-2-27b-it`){