From 6e8c5ccde54abd5a6c21ff98596344420a40a7d3 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Thu, 11 Jul 2024 17:12:54 +0000 Subject: [PATCH] feat(api): OpenAPI spec update via Stainless API --- .github/workflows/ci.yml | 1 + .stats.yml | 2 +- .../evaluation-assertions.test.ts | 32 +- tests/api-resources/evaluations.test.ts | 272 ++++++++--- tests/api-resources/prompts.test.ts | 430 +++++++++++++----- tests/api-resources/tools.test.ts | 16 +- 6 files changed, 557 insertions(+), 196 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 491db96..d791adb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,7 @@ on: pull_request: branches: - main + - next jobs: lint: diff --git a/.stats.yml b/.stats.yml index 86e616c..21eba64 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 21 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-5d4722a755a01f8917b975ab7e6528e590f53d09891baac758abba1e28df15d1.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-a552977d2b7ab16d16020c083420cadbca97d5766ea0df7b49b3ed275626b995.yml diff --git a/tests/api-resources/evaluation-assertions.test.ts b/tests/api-resources/evaluation-assertions.test.ts index 1987e1a..df8e9ae 100644 --- a/tests/api-resources/evaluation-assertions.test.ts +++ b/tests/api-resources/evaluation-assertions.test.ts @@ -11,10 +11,10 @@ const promptFoundry = new PromptFoundry({ describe('resource evaluationAssertions', () => { test('create: only required params', async () => { const responsePromise = promptFoundry.evaluationAssertions.create({ - evaluationId: 'string', - jsonPath: 'string', - targetValue: 'string', - toolName: 'string', + evaluationId: 'evaluationId', + jsonPath: 'jsonPath', + targetValue: 'targetValue', + toolName: 'toolName', type: 'CONTAINS', }); const rawResponse = await responsePromise.asResponse(); @@ -28,20 +28,20 @@ describe('resource evaluationAssertions', () => { test('create: required and optional params', async () => { const response = await promptFoundry.evaluationAssertions.create({ - evaluationId: 'string', - jsonPath: 'string', - targetValue: 'string', - toolName: 'string', + evaluationId: 'evaluationId', + jsonPath: 'jsonPath', + targetValue: 'targetValue', + toolName: 'toolName', type: 'CONTAINS', }); }); test('update: only required params', async () => { const responsePromise = promptFoundry.evaluationAssertions.update('1212121', { - evaluationId: 'string', - jsonPath: 'string', - targetValue: 'string', - toolName: 'string', + evaluationId: 'evaluationId', + jsonPath: 'jsonPath', + targetValue: 'targetValue', + toolName: 'toolName', type: 'CONTAINS', }); const rawResponse = await responsePromise.asResponse(); @@ -55,10 +55,10 @@ describe('resource evaluationAssertions', () => { test('update: required and optional params', async () => { const response = await promptFoundry.evaluationAssertions.update('1212121', { - evaluationId: 'string', - jsonPath: 'string', - targetValue: 'string', - toolName: 'string', + evaluationId: 'evaluationId', + jsonPath: 'jsonPath', + targetValue: 'targetValue', + toolName: 'toolName', type: 'CONTAINS', }); }); diff --git a/tests/api-resources/evaluations.test.ts b/tests/api-resources/evaluations.test.ts index 196de0a..132c090 100644 --- a/tests/api-resources/evaluations.test.ts +++ b/tests/api-resources/evaluations.test.ts @@ -13,37 +13,73 @@ describe('resource evaluations', () => { const responsePromise = promptFoundry.evaluations.create({ appendedMessages: [ { - content: 'string', + content: 'content', role: 'assistant', - toolCallId: 'string', + toolCallId: 'toolCallId', toolCalls: [ - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, ], }, { - content: 'string', + content: 'content', role: 'assistant', - toolCallId: 'string', + toolCallId: 'toolCallId', toolCalls: [ - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, ], }, { - content: 'string', + content: 'content', role: 'assistant', - toolCallId: 'string', + toolCallId: 'toolCallId', toolCalls: [ - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, ], }, ], - promptId: 'string', + promptId: 'promptId', variables: { foo: 'string' }, }); const rawResponse = await responsePromise.asResponse(); @@ -59,37 +95,73 @@ describe('resource evaluations', () => { const response = await promptFoundry.evaluations.create({ appendedMessages: [ { - content: 'string', + content: 'content', role: 'assistant', - toolCallId: 'string', + toolCallId: 'toolCallId', toolCalls: [ - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, ], }, { - content: 'string', + content: 'content', role: 'assistant', - toolCallId: 'string', + toolCallId: 'toolCallId', toolCalls: [ - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, ], }, { - content: 'string', + content: 'content', role: 'assistant', - toolCallId: 'string', + toolCallId: 'toolCallId', toolCalls: [ - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, ], }, ], - promptId: 'string', + promptId: 'promptId', variables: { foo: 'string' }, }); }); @@ -98,37 +170,73 @@ describe('resource evaluations', () => { const responsePromise = promptFoundry.evaluations.update('1212121', { appendedMessages: [ { - content: 'string', + content: 'content', role: 'assistant', - toolCallId: 'string', + toolCallId: 'toolCallId', toolCalls: [ - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, ], }, { - content: 'string', + content: 'content', role: 'assistant', - toolCallId: 'string', + toolCallId: 'toolCallId', toolCalls: [ - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, ], }, { - content: 'string', + content: 'content', role: 'assistant', - toolCallId: 'string', + toolCallId: 'toolCallId', toolCalls: [ - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, ], }, ], - promptId: 'string', + promptId: 'promptId', variables: { foo: 'string' }, }); const rawResponse = await responsePromise.asResponse(); @@ -144,37 +252,73 @@ describe('resource evaluations', () => { const response = await promptFoundry.evaluations.update('1212121', { appendedMessages: [ { - content: 'string', + content: 'content', role: 'assistant', - toolCallId: 'string', + toolCallId: 'toolCallId', toolCalls: [ - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, ], }, { - content: 'string', + content: 'content', role: 'assistant', - toolCallId: 'string', + toolCallId: 'toolCallId', toolCalls: [ - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, ], }, { - content: 'string', + content: 'content', role: 'assistant', - toolCallId: 'string', + toolCallId: 'toolCallId', toolCalls: [ - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, ], }, ], - promptId: 'string', + promptId: 'promptId', variables: { foo: 'string' }, }); }); diff --git a/tests/api-resources/prompts.test.ts b/tests/api-resources/prompts.test.ts index fe01ab7..043d444 100644 --- a/tests/api-resources/prompts.test.ts +++ b/tests/api-resources/prompts.test.ts @@ -13,40 +13,76 @@ describe('resource prompts', () => { const responsePromise = promptFoundry.prompts.create({ messages: [ { - content: 'string', + content: 'content', role: 'assistant', - toolCallId: 'string', + toolCallId: 'toolCallId', toolCalls: [ - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, ], }, { - content: 'string', + content: 'content', role: 'assistant', - toolCallId: 'string', + toolCallId: 'toolCallId', toolCalls: [ - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, ], }, { - content: 'string', + content: 'content', role: 'assistant', - toolCallId: 'string', + toolCallId: 'toolCallId', toolCalls: [ - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, ], }, ], - name: 'string', + name: 'name', parameters: { modelProvider: 'ANTHROPIC', - modelName: 'string', + modelName: 'modelName', responseFormat: 'JSON', temperature: 0, topP: 0, @@ -55,11 +91,11 @@ describe('resource prompts', () => { presencePenalty: 0, maxTokens: 0, seed: 0, - toolChoice: 'string', + toolChoice: 'toolChoice', stream: true, parallelToolCalls: true, }, - tools: [{ toolId: 'string' }, { toolId: 'string' }, { toolId: 'string' }], + tools: [{ toolId: 'toolId' }, { toolId: 'toolId' }, { toolId: 'toolId' }], }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -74,40 +110,76 @@ describe('resource prompts', () => { const response = await promptFoundry.prompts.create({ messages: [ { - content: 'string', + content: 'content', role: 'assistant', - toolCallId: 'string', + toolCallId: 'toolCallId', toolCalls: [ - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, ], }, { - content: 'string', + content: 'content', role: 'assistant', - toolCallId: 'string', + toolCallId: 'toolCallId', toolCalls: [ - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, ], }, { - content: 'string', + content: 'content', role: 'assistant', - toolCallId: 'string', + toolCallId: 'toolCallId', toolCalls: [ - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, ], }, ], - name: 'string', + name: 'name', parameters: { modelProvider: 'ANTHROPIC', - modelName: 'string', + modelName: 'modelName', responseFormat: 'JSON', temperature: 0, topP: 0, @@ -116,11 +188,11 @@ describe('resource prompts', () => { presencePenalty: 0, maxTokens: 0, seed: 0, - toolChoice: 'string', + toolChoice: 'toolChoice', stream: true, parallelToolCalls: true, }, - tools: [{ toolId: 'string' }, { toolId: 'string' }, { toolId: 'string' }], + tools: [{ toolId: 'toolId' }, { toolId: 'toolId' }, { toolId: 'toolId' }], }); }); @@ -128,40 +200,76 @@ describe('resource prompts', () => { const responsePromise = promptFoundry.prompts.update('1212121', { messages: [ { - content: 'string', + content: 'content', role: 'assistant', - toolCallId: 'string', + toolCallId: 'toolCallId', toolCalls: [ - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, ], }, { - content: 'string', + content: 'content', role: 'assistant', - toolCallId: 'string', + toolCallId: 'toolCallId', toolCalls: [ - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, ], }, { - content: 'string', + content: 'content', role: 'assistant', - toolCallId: 'string', + toolCallId: 'toolCallId', toolCalls: [ - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, ], }, ], - name: 'string', + name: 'name', parameters: { modelProvider: 'ANTHROPIC', - modelName: 'string', + modelName: 'modelName', responseFormat: 'JSON', temperature: 0, topP: 0, @@ -170,11 +278,11 @@ describe('resource prompts', () => { presencePenalty: 0, maxTokens: 0, seed: 0, - toolChoice: 'string', + toolChoice: 'toolChoice', stream: true, parallelToolCalls: true, }, - tools: [{ toolId: 'string' }, { toolId: 'string' }, { toolId: 'string' }], + tools: [{ toolId: 'toolId' }, { toolId: 'toolId' }, { toolId: 'toolId' }], }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -189,40 +297,76 @@ describe('resource prompts', () => { const response = await promptFoundry.prompts.update('1212121', { messages: [ { - content: 'string', + content: 'content', role: 'assistant', - toolCallId: 'string', + toolCallId: 'toolCallId', toolCalls: [ - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, ], }, { - content: 'string', + content: 'content', role: 'assistant', - toolCallId: 'string', + toolCallId: 'toolCallId', toolCalls: [ - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, ], }, { - content: 'string', + content: 'content', role: 'assistant', - toolCallId: 'string', + toolCallId: 'toolCallId', toolCalls: [ - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, ], }, ], - name: 'string', + name: 'name', parameters: { modelProvider: 'ANTHROPIC', - modelName: 'string', + modelName: 'modelName', responseFormat: 'JSON', temperature: 0, topP: 0, @@ -231,11 +375,11 @@ describe('resource prompts', () => { presencePenalty: 0, maxTokens: 0, seed: 0, - toolChoice: 'string', + toolChoice: 'toolChoice', stream: true, parallelToolCalls: true, }, - tools: [{ toolId: 'string' }, { toolId: 'string' }, { toolId: 'string' }], + tools: [{ toolId: 'toolId' }, { toolId: 'toolId' }, { toolId: 'toolId' }], }); }); @@ -319,69 +463,141 @@ describe('resource prompts', () => { { appendMessages: [ { - content: 'string', + content: 'content', role: 'assistant', - toolCallId: 'string', + toolCallId: 'toolCallId', toolCalls: [ - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, ], }, { - content: 'string', + content: 'content', role: 'assistant', - toolCallId: 'string', + toolCallId: 'toolCallId', toolCalls: [ - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, ], }, { - content: 'string', + content: 'content', role: 'assistant', - toolCallId: 'string', + toolCallId: 'toolCallId', toolCalls: [ - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, ], }, ], overrideMessages: [ { - content: 'string', + content: 'content', role: 'assistant', - toolCallId: 'string', + toolCallId: 'toolCallId', toolCalls: [ - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, ], }, { - content: 'string', + content: 'content', role: 'assistant', - toolCallId: 'string', + toolCallId: 'toolCallId', toolCalls: [ - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, ], }, { - content: 'string', + content: 'content', role: 'assistant', - toolCallId: 'string', + toolCallId: 'toolCallId', toolCalls: [ - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, - { toolCallId: 'string', type: 'function', function: { arguments: 'string', name: 'string' } }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, + { + toolCallId: 'toolCallId', + type: 'function', + function: { arguments: 'arguments', name: 'name' }, + }, ], }, ], - user: 'string', + user: 'user', variables: { foo: 'string' }, }, { path: '/_stainless_unknown_path' }, diff --git a/tests/api-resources/tools.test.ts b/tests/api-resources/tools.test.ts index 3d399ef..9d10cca 100644 --- a/tests/api-resources/tools.test.ts +++ b/tests/api-resources/tools.test.ts @@ -11,8 +11,8 @@ const promptFoundry = new PromptFoundry({ describe('resource tools', () => { test('create: only required params', async () => { const responsePromise = promptFoundry.tools.create({ - description: 'string', - name: 'string', + description: 'description', + name: 'name', parameters: { foo: {} }, }); const rawResponse = await responsePromise.asResponse(); @@ -26,16 +26,16 @@ describe('resource tools', () => { test('create: required and optional params', async () => { const response = await promptFoundry.tools.create({ - description: 'string', - name: 'string', + description: 'description', + name: 'name', parameters: { foo: {} }, }); }); test('update: only required params', async () => { const responsePromise = promptFoundry.tools.update('1212121', { - description: 'string', - name: 'string', + description: 'description', + name: 'name', parameters: { foo: {} }, }); const rawResponse = await responsePromise.asResponse(); @@ -49,8 +49,8 @@ describe('resource tools', () => { test('update: required and optional params', async () => { const response = await promptFoundry.tools.update('1212121', { - description: 'string', - name: 'string', + description: 'description', + name: 'name', parameters: { foo: {} }, }); });