Skip to content

Commit cba3804

Browse files
authored
📦 NEW: Anthropic tool call support (#52)
1 parent 8711299 commit cba3804

File tree

3 files changed

+342
-70
lines changed

3 files changed

+342
-70
lines changed

‎packages/baseai/src/dev/llms/call-anthropic.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { ANTHROPIC } from '../data/models';
55
import { handleLlmError } from './utils';
66
import type { ModelParams } from 'types/providers';
77
import type { Message } from 'types/pipe';
8+
import { addToolsToParams } from '../utils/add-tools-to-params';
89

910
export async function callAnthropic({
1011
pipe,
@@ -19,6 +20,7 @@ export async function callAnthropic({
1920
}) {
2021
try {
2122
const modelParams = buildModelParams(pipe, stream, messages);
23+
addToolsToParams(modelParams, pipe);
2224

2325
// Transform params according to provider's format
2426
const transformedRequestParams = transformToProviderRequest({

0 commit comments

Comments
 (0)