diff --git a/js/plugins/anthropic/src/list.ts b/js/plugins/anthropic/src/list.ts index 6124fd4392..128209b875 100644 --- a/js/plugins/anthropic/src/list.ts +++ b/js/plugins/anthropic/src/list.ts @@ -33,7 +33,8 @@ import { claudeModelReference } from './models.js'; export async function listActions( client: Anthropic ): Promise { - const clientModels = (await client.models.list()).data; + // Use beta.models.list to get the list of ALL (stable and beta) models + const clientModels = (await client.beta.models.list()).data; const seenNames = new Set(); return clientModels diff --git a/js/plugins/anthropic/tests/index_test.ts b/js/plugins/anthropic/tests/index_test.ts index 62ef06b5fc..9a5271e131 100644 --- a/js/plugins/anthropic/tests/index_test.ts +++ b/js/plugins/anthropic/tests/index_test.ts @@ -190,11 +190,11 @@ describe('Anthropic Plugin', () => { assert.ok(experimentalMetadata, 'Experimental model metadata should exist'); // Verify mock was called - const listStub = mockClient.models.list as any; + const listStub = mockClient.beta.models.list as any; assert.strictEqual( listStub.mock.calls.length, 1, - 'models.list should be called once' + 'beta.models.list should be called once' ); }); @@ -224,11 +224,11 @@ describe('Anthropic Plugin', () => { ); // Verify models.list was only called once due to caching - const listStub = mockClient.models.list as any; + const listStub = mockClient.beta.models.list as any; assert.strictEqual( listStub.mock.calls.length, 1, - 'models.list should only be called once due to caching' + 'beta.models.list should only be called once due to caching' ); }); }); diff --git a/js/plugins/anthropic/tests/mocks/anthropic-client.ts b/js/plugins/anthropic/tests/mocks/anthropic-client.ts index 321df8f24f..7fe29eceb2 100644 --- a/js/plugins/anthropic/tests/mocks/anthropic-client.ts +++ b/js/plugins/anthropic/tests/mocks/anthropic-client.ts @@ -134,10 +134,10 @@ export function createMockAnthropicClient( create: createStub, stream: streamStub, }, - models: { - list: listStub, - }, beta: { + models: { + list: listStub, + }, messages: { create: betaCreateStub, stream: betaStreamStub,