Skip to content

Commit eed9211

Browse files
committed
Fix build errors in Anthropic provider
1 parent 7f6e55a commit eed9211

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

packages/agent/src/core/llm/anthropic.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { AnthropicStream, StreamingTextResponse, anthropic } from 'ai';
1+
import Anthropic from '@anthropic-ai/sdk';
22
import { ContentBlockParam } from '@anthropic-ai/sdk/resources/messages/messages.js';
33

44
import { 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' },

packages/cli/src/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@ import { hideBin } from 'yargs/helpers';
99
import { fileCommands } from 'yargs-file-commands';
1010

1111
// Initialize Sentry as early as possible
12+
import { sharedOptions } from './options.js';
1213
import { initSentry, captureException } from './sentry/index.js';
1314
initSentry();
1415

15-
import { sharedOptions } from './options.js';
16-
1716
import type { PackageJson } from 'type-fest';
1817

1918
// Add global declaration for our patched toolAgent

0 commit comments

Comments
 (0)