File tree Expand file tree Collapse file tree 2 files changed +5
-8
lines changed
Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change 1- import { AnthropicStream , StreamingTextResponse , anthropic } from 'ai ' ;
1+ import Anthropic from '@anthropic-ai/sdk ' ;
22import { ContentBlockParam } from '@anthropic-ai/sdk/resources/messages/messages.js' ;
33
44import { getAnthropicApiKeyError } from '../../utils/errors.js' ;
@@ -118,10 +118,8 @@ export class AnthropicProvider implements LLMProvider {
118118 const apiKey = process . env . ANTHROPIC_API_KEY ;
119119 if ( ! apiKey ) throw new Error ( getAnthropicApiKeyError ( ) ) ;
120120
121- // Using Vercel AI SDK to create Anthropic client
122- const client = anthropic ( {
123- apiKey,
124- } ) ;
121+ // Create Anthropic client
122+ const client = new Anthropic ( { apiKey } ) ;
125123
126124 logger . verbose (
127125 `Requesting completion with ${ messages . length } messages with ${ JSON . stringify ( messages ) . length } bytes` ,
@@ -144,7 +142,7 @@ export class AnthropicProvider implements LLMProvider {
144142 tools . map ( ( t ) => ( {
145143 name : t . name ,
146144 description : t . description ,
147- input_schema : t . parameters ,
145+ input_schema : t . parameters as Anthropic . Tool . InputSchema ,
148146 } ) ) ,
149147 ) ,
150148 tool_choice : { type : 'auto' } ,
Original file line number Diff line number Diff line change @@ -9,11 +9,10 @@ import { hideBin } from 'yargs/helpers';
99import { fileCommands } from 'yargs-file-commands' ;
1010
1111// Initialize Sentry as early as possible
12+ import { sharedOptions } from './options.js' ;
1213import { initSentry , captureException } from './sentry/index.js' ;
1314initSentry ( ) ;
1415
15- import { sharedOptions } from './options.js' ;
16-
1716import type { PackageJson } from 'type-fest' ;
1817
1918// Add global declaration for our patched toolAgent
You can’t perform that action at this time.
0 commit comments