diff --git a/tests/api-resources/beta/messages/batches.test.ts b/tests/api-resources/beta/messages/batches.test.ts index ed2027c8..e395910a 100644 --- a/tests/api-resources/beta/messages/batches.test.ts +++ b/tests/api-resources/beta/messages/batches.test.ts @@ -20,22 +20,6 @@ describe('resource batches', () => { model: 'claude-3-5-sonnet-20241022', }, }, - { - custom_id: 'my-custom-id-1', - params: { - max_tokens: 1024, - messages: [{ content: 'Hello, world', role: 'user' }], - model: 'claude-3-5-sonnet-20241022', - }, - }, - { - custom_id: 'my-custom-id-1', - params: { - max_tokens: 1024, - messages: [{ content: 'Hello, world', role: 'user' }], - model: 'claude-3-5-sonnet-20241022', - }, - }, ], }); const rawResponse = await responsePromise.asResponse(); @@ -57,143 +41,7 @@ describe('resource batches', () => { messages: [{ content: 'Hello, world', role: 'user' }], model: 'claude-3-5-sonnet-20241022', metadata: { user_id: '13803d75-b4b5-4c3e-b2a2-6f21399b021b' }, - stop_sequences: ['string', 'string', 'string'], - stream: false, - system: [ - { text: "Today's date is 2024-06-01.", type: 'text', cache_control: { type: 'ephemeral' } }, - ], - temperature: 1, - tool_choice: { type: 'auto', disable_parallel_tool_use: true }, - tools: [ - { - input_schema: { - type: 'object', - properties: { - location: { description: 'The city and state, e.g. San Francisco, CA', type: 'string' }, - unit: { - description: 'Unit for the output - one of (celsius, fahrenheit)', - type: 'string', - }, - }, - }, - name: 'x', - cache_control: { type: 'ephemeral' }, - description: 'Get the current weather in a given location', - type: 'custom', - }, - { - input_schema: { - type: 'object', - properties: { - location: { description: 'The city and state, e.g. San Francisco, CA', type: 'string' }, - unit: { - description: 'Unit for the output - one of (celsius, fahrenheit)', - type: 'string', - }, - }, - }, - name: 'x', - cache_control: { type: 'ephemeral' }, - description: 'Get the current weather in a given location', - type: 'custom', - }, - { - input_schema: { - type: 'object', - properties: { - location: { description: 'The city and state, e.g. San Francisco, CA', type: 'string' }, - unit: { - description: 'Unit for the output - one of (celsius, fahrenheit)', - type: 'string', - }, - }, - }, - name: 'x', - cache_control: { type: 'ephemeral' }, - description: 'Get the current weather in a given location', - type: 'custom', - }, - ], - top_k: 5, - top_p: 0.7, - }, - }, - { - custom_id: 'my-custom-id-1', - params: { - max_tokens: 1024, - messages: [{ content: 'Hello, world', role: 'user' }], - model: 'claude-3-5-sonnet-20241022', - metadata: { user_id: '13803d75-b4b5-4c3e-b2a2-6f21399b021b' }, - stop_sequences: ['string', 'string', 'string'], - stream: false, - system: [ - { text: "Today's date is 2024-06-01.", type: 'text', cache_control: { type: 'ephemeral' } }, - ], - temperature: 1, - tool_choice: { type: 'auto', disable_parallel_tool_use: true }, - tools: [ - { - input_schema: { - type: 'object', - properties: { - location: { description: 'The city and state, e.g. San Francisco, CA', type: 'string' }, - unit: { - description: 'Unit for the output - one of (celsius, fahrenheit)', - type: 'string', - }, - }, - }, - name: 'x', - cache_control: { type: 'ephemeral' }, - description: 'Get the current weather in a given location', - type: 'custom', - }, - { - input_schema: { - type: 'object', - properties: { - location: { description: 'The city and state, e.g. San Francisco, CA', type: 'string' }, - unit: { - description: 'Unit for the output - one of (celsius, fahrenheit)', - type: 'string', - }, - }, - }, - name: 'x', - cache_control: { type: 'ephemeral' }, - description: 'Get the current weather in a given location', - type: 'custom', - }, - { - input_schema: { - type: 'object', - properties: { - location: { description: 'The city and state, e.g. San Francisco, CA', type: 'string' }, - unit: { - description: 'Unit for the output - one of (celsius, fahrenheit)', - type: 'string', - }, - }, - }, - name: 'x', - cache_control: { type: 'ephemeral' }, - description: 'Get the current weather in a given location', - type: 'custom', - }, - ], - top_k: 5, - top_p: 0.7, - }, - }, - { - custom_id: 'my-custom-id-1', - params: { - max_tokens: 1024, - messages: [{ content: 'Hello, world', role: 'user' }], - model: 'claude-3-5-sonnet-20241022', - metadata: { user_id: '13803d75-b4b5-4c3e-b2a2-6f21399b021b' }, - stop_sequences: ['string', 'string', 'string'], + stop_sequences: ['string'], stream: false, system: [ { text: "Today's date is 2024-06-01.", type: 'text', cache_control: { type: 'ephemeral' } }, @@ -217,45 +65,13 @@ describe('resource batches', () => { description: 'Get the current weather in a given location', type: 'custom', }, - { - input_schema: { - type: 'object', - properties: { - location: { description: 'The city and state, e.g. San Francisco, CA', type: 'string' }, - unit: { - description: 'Unit for the output - one of (celsius, fahrenheit)', - type: 'string', - }, - }, - }, - name: 'x', - cache_control: { type: 'ephemeral' }, - description: 'Get the current weather in a given location', - type: 'custom', - }, - { - input_schema: { - type: 'object', - properties: { - location: { description: 'The city and state, e.g. San Francisco, CA', type: 'string' }, - unit: { - description: 'Unit for the output - one of (celsius, fahrenheit)', - type: 'string', - }, - }, - }, - name: 'x', - cache_control: { type: 'ephemeral' }, - description: 'Get the current weather in a given location', - type: 'custom', - }, ], top_k: 5, top_p: 0.7, }, }, ], - betas: ['string', 'string', 'string'], + betas: ['string'], }); }); @@ -282,7 +98,7 @@ describe('resource batches', () => { await expect( client.beta.messages.batches.retrieve( 'message_batch_id', - { betas: ['string', 'string', 'string'] }, + { betas: ['string'] }, { path: '/_stainless_unknown_path' }, ), ).rejects.toThrow(Anthropic.NotFoundError); @@ -310,7 +126,7 @@ describe('resource batches', () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( client.beta.messages.batches.list( - { after_id: 'after_id', before_id: 'before_id', limit: 1, betas: ['string', 'string', 'string'] }, + { after_id: 'after_id', before_id: 'before_id', limit: 1, betas: ['string'] }, { path: '/_stainless_unknown_path' }, ), ).rejects.toThrow(Anthropic.NotFoundError); @@ -339,7 +155,7 @@ describe('resource batches', () => { await expect( client.beta.messages.batches.cancel( 'message_batch_id', - { betas: ['string', 'string', 'string'] }, + { betas: ['string'] }, { path: '/_stainless_unknown_path' }, ), ).rejects.toThrow(Anthropic.NotFoundError); @@ -357,7 +173,7 @@ describe('resource batches', () => { await expect( client.beta.messages.batches.results( 'message_batch_id', - { betas: ['string', 'string', 'string'] }, + { betas: ['string'] }, { path: '/_stainless_unknown_path' }, ), ).rejects.toThrow(Anthropic.NotFoundError); diff --git a/tests/api-resources/beta/messages/messages.test.ts b/tests/api-resources/beta/messages/messages.test.ts index 64b6299c..ec73d9c0 100644 --- a/tests/api-resources/beta/messages/messages.test.ts +++ b/tests/api-resources/beta/messages/messages.test.ts @@ -30,7 +30,7 @@ describe('resource messages', () => { messages: [{ content: 'Hello, world', role: 'user' }], model: 'claude-3-5-sonnet-20241022', metadata: { user_id: '13803d75-b4b5-4c3e-b2a2-6f21399b021b' }, - stop_sequences: ['string', 'string', 'string'], + stop_sequences: ['string'], stream: false, system: [{ text: "Today's date is 2024-06-01.", type: 'text', cache_control: { type: 'ephemeral' } }], temperature: 1, @@ -49,46 +49,16 @@ describe('resource messages', () => { description: 'Get the current weather in a given location', type: 'custom', }, - { - input_schema: { - type: 'object', - properties: { - location: { description: 'The city and state, e.g. San Francisco, CA', type: 'string' }, - unit: { description: 'Unit for the output - one of (celsius, fahrenheit)', type: 'string' }, - }, - }, - name: 'x', - cache_control: { type: 'ephemeral' }, - description: 'Get the current weather in a given location', - type: 'custom', - }, - { - input_schema: { - type: 'object', - properties: { - location: { description: 'The city and state, e.g. San Francisco, CA', type: 'string' }, - unit: { description: 'Unit for the output - one of (celsius, fahrenheit)', type: 'string' }, - }, - }, - name: 'x', - cache_control: { type: 'ephemeral' }, - description: 'Get the current weather in a given location', - type: 'custom', - }, ], top_k: 5, top_p: 0.7, - betas: ['string', 'string', 'string'], + betas: ['string'], }); }); test('countTokens: only required params', async () => { const responsePromise = client.beta.messages.countTokens({ - messages: [ - { content: 'string', role: 'user' }, - { content: 'string', role: 'user' }, - { content: 'string', role: 'user' }, - ], + messages: [{ content: 'string', role: 'user' }], model: 'string', }); const rawResponse = await responsePromise.asResponse(); @@ -102,11 +72,7 @@ describe('resource messages', () => { test('countTokens: required and optional params', async () => { const response = await client.beta.messages.countTokens({ - messages: [ - { content: 'string', role: 'user' }, - { content: 'string', role: 'user' }, - { content: 'string', role: 'user' }, - ], + messages: [{ content: 'string', role: 'user' }], model: 'string', system: [{ text: "Today's date is 2024-06-01.", type: 'text', cache_control: { type: 'ephemeral' } }], tool_choice: { type: 'auto', disable_parallel_tool_use: true }, @@ -124,34 +90,8 @@ describe('resource messages', () => { description: 'Get the current weather in a given location', type: 'custom', }, - { - input_schema: { - type: 'object', - properties: { - location: { description: 'The city and state, e.g. San Francisco, CA', type: 'string' }, - unit: { description: 'Unit for the output - one of (celsius, fahrenheit)', type: 'string' }, - }, - }, - name: 'x', - cache_control: { type: 'ephemeral' }, - description: 'Get the current weather in a given location', - type: 'custom', - }, - { - input_schema: { - type: 'object', - properties: { - location: { description: 'The city and state, e.g. San Francisco, CA', type: 'string' }, - unit: { description: 'Unit for the output - one of (celsius, fahrenheit)', type: 'string' }, - }, - }, - name: 'x', - cache_control: { type: 'ephemeral' }, - description: 'Get the current weather in a given location', - type: 'custom', - }, ], - betas: ['string', 'string', 'string'], + betas: ['string'], }); }); }); diff --git a/tests/api-resources/beta/prompt-caching/messages.test.ts b/tests/api-resources/beta/prompt-caching/messages.test.ts index dd94b3a7..39ecdfab 100644 --- a/tests/api-resources/beta/prompt-caching/messages.test.ts +++ b/tests/api-resources/beta/prompt-caching/messages.test.ts @@ -30,7 +30,7 @@ describe('resource messages', () => { messages: [{ content: 'Hello, world', role: 'user' }], model: 'claude-3-5-sonnet-20241022', metadata: { user_id: '13803d75-b4b5-4c3e-b2a2-6f21399b021b' }, - stop_sequences: ['string', 'string', 'string'], + stop_sequences: ['string'], stream: false, system: [{ text: "Today's date is 2024-06-01.", type: 'text', cache_control: { type: 'ephemeral' } }], temperature: 1, @@ -48,34 +48,10 @@ describe('resource messages', () => { cache_control: { type: 'ephemeral' }, description: 'Get the current weather in a given location', }, - { - input_schema: { - type: 'object', - properties: { - location: { description: 'The city and state, e.g. San Francisco, CA', type: 'string' }, - unit: { description: 'Unit for the output - one of (celsius, fahrenheit)', type: 'string' }, - }, - }, - name: 'x', - cache_control: { type: 'ephemeral' }, - description: 'Get the current weather in a given location', - }, - { - input_schema: { - type: 'object', - properties: { - location: { description: 'The city and state, e.g. San Francisco, CA', type: 'string' }, - unit: { description: 'Unit for the output - one of (celsius, fahrenheit)', type: 'string' }, - }, - }, - name: 'x', - cache_control: { type: 'ephemeral' }, - description: 'Get the current weather in a given location', - }, ], top_k: 5, top_p: 0.7, - betas: ['string', 'string', 'string'], + betas: ['string'], }); }); }); diff --git a/tests/api-resources/completions.test.ts b/tests/api-resources/completions.test.ts index aa326cf2..fcd0a68c 100644 --- a/tests/api-resources/completions.test.ts +++ b/tests/api-resources/completions.test.ts @@ -30,7 +30,7 @@ describe('resource completions', () => { model: 'string', prompt: '\n\nHuman: Hello, world!\n\nAssistant:', metadata: { user_id: '13803d75-b4b5-4c3e-b2a2-6f21399b021b' }, - stop_sequences: ['string', 'string', 'string'], + stop_sequences: ['string'], stream: false, temperature: 1, top_k: 5, diff --git a/tests/api-resources/messages.test.ts b/tests/api-resources/messages.test.ts index 0497742e..17ae6e52 100644 --- a/tests/api-resources/messages.test.ts +++ b/tests/api-resources/messages.test.ts @@ -30,7 +30,7 @@ describe('resource messages', () => { messages: [{ content: 'Hello, world', role: 'user' }], model: 'claude-3-5-sonnet-20241022', metadata: { user_id: '13803d75-b4b5-4c3e-b2a2-6f21399b021b' }, - stop_sequences: ['string', 'string', 'string'], + stop_sequences: ['string'], stream: false, system: [{ text: "Today's date is 2024-06-01.", type: 'text' }], temperature: 1, @@ -47,28 +47,6 @@ describe('resource messages', () => { name: 'x', description: 'Get the current weather in a given location', }, - { - input_schema: { - type: 'object', - properties: { - location: { description: 'The city and state, e.g. San Francisco, CA', type: 'string' }, - unit: { description: 'Unit for the output - one of (celsius, fahrenheit)', type: 'string' }, - }, - }, - name: 'x', - description: 'Get the current weather in a given location', - }, - { - input_schema: { - type: 'object', - properties: { - location: { description: 'The city and state, e.g. San Francisco, CA', type: 'string' }, - unit: { description: 'Unit for the output - one of (celsius, fahrenheit)', type: 'string' }, - }, - }, - name: 'x', - description: 'Get the current weather in a given location', - }, ], top_k: 5, top_p: 0.7,