Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion js/plugins/anthropic/src/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ import { claudeModelReference } from './models.js';
export async function listActions(
client: Anthropic
): Promise<ActionMetadata[]> {
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<string>();

return clientModels
Expand Down
8 changes: 4 additions & 4 deletions js/plugins/anthropic/tests/index_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
);
});

Expand Down Expand Up @@ -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'
);
});
});
Expand Down
6 changes: 3 additions & 3 deletions js/plugins/anthropic/tests/mocks/anthropic-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@ export function createMockAnthropicClient(
create: createStub,
stream: streamStub,
},
models: {
list: listStub,
},
beta: {
models: {
list: listStub,
},
messages: {
create: betaCreateStub,
stream: betaStreamStub,
Expand Down