From 32cb6f92b8f7b5efd743d698d113eff2754cd40b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 10 Jul 2024 20:13:13 +0000 Subject: [PATCH 01/18] feat(api): OpenAPI spec update via Stainless API (#147) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From de660c2b31f79be4195159f94c6c3ca112ba6447 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 10 Jul 2024 21:06:11 +0000 Subject: [PATCH 02/18] feat(api): OpenAPI spec update via Stainless API (#149) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 21eba64..86e616c 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-a552977d2b7ab16d16020c083420cadbca97d5766ea0df7b49b3ed275626b995.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-5d4722a755a01f8917b975ab7e6528e590f53d09891baac758abba1e28df15d1.yml From b7ef7880cf87a071c0435cdd2b49ba7cc46f49a0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 10 Jul 2024 21:13:12 +0000 Subject: [PATCH 03/18] feat(api): OpenAPI spec update via Stainless API (#150) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From fb48dbd5ff6b29a564f28a289c58e5991386ca40 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 10 Jul 2024 21:48:25 +0000 Subject: [PATCH 04/18] feat(api): OpenAPI spec update via Stainless API (#151) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 21eba64..86e616c 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-a552977d2b7ab16d16020c083420cadbca97d5766ea0df7b49b3ed275626b995.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-5d4722a755a01f8917b975ab7e6528e590f53d09891baac758abba1e28df15d1.yml From 755a2b3f28a1d277235a7a7792398fca8a8a2843 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 11 Jul 2024 17:13:00 +0000 Subject: [PATCH 05/18] feat(api): OpenAPI spec update via Stainless API (#152) --- .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: {} }, }); }); From 93f95551e6a63115efb9f8610b18fa5c9c2831fc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 11 Jul 2024 17:35:31 +0000 Subject: [PATCH 06/18] feat(api): OpenAPI spec update via Stainless API (#153) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 21eba64..86e616c 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-a552977d2b7ab16d16020c083420cadbca97d5766ea0df7b49b3ed275626b995.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-5d4722a755a01f8917b975ab7e6528e590f53d09891baac758abba1e28df15d1.yml From f9dac25563076648db74238dab095038e970b980 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 11 Jul 2024 18:12:53 +0000 Subject: [PATCH 07/18] feat(api): OpenAPI spec update via Stainless API (#154) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From a079c063443fa4d74de035966f455bb92dcd830b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 16 Jul 2024 17:02:49 +0000 Subject: [PATCH 08/18] feat(api): OpenAPI spec update via Stainless API (#155) --- .stats.yml | 2 +- README.md | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 21eba64..be1e079 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-a552977d2b7ab16d16020c083420cadbca97d5766ea0df7b49b3ed275626b995.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-c77cec085f7f9aee5a6450f1d95d7587b2580c18ebf1481e36863f3ab549d7fb.yml diff --git a/README.md b/README.md index ba216e5..2114316 100644 --- a/README.md +++ b/README.md @@ -363,6 +363,9 @@ The following runtimes are supported: - Jest 28 or greater with the `"node"` environment (`"jsdom"` is not supported at this time). - Nitro v2.6 or greater. +> [!WARNING] +> Web browser runtimes aren't supported. The SDK will throw an error if used in a browser environment. + Note that React Native is not supported at this time. If you are interested in other runtime environments, please open or upvote an issue on GitHub. From 6d54ca422b72aadfe3e7ff1022cb576aa962c053 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 16 Jul 2024 17:14:39 +0000 Subject: [PATCH 09/18] feat(api): OpenAPI spec update via Stainless API (#156) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index be1e079..ddfeae1 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-c77cec085f7f9aee5a6450f1d95d7587b2580c18ebf1481e36863f3ab549d7fb.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-441451c27073e45d1bdc832c5b66c26d90bd185bd94bd461b91257fbf0987ef2.yml From bf8d9d9b83c9cd63e9dfbe0521e87d747131ab17 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 16 Jul 2024 17:16:50 +0000 Subject: [PATCH 10/18] feat(api): OpenAPI spec update via Stainless API (#157) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index ddfeae1..da24255 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-441451c27073e45d1bdc832c5b66c26d90bd185bd94bd461b91257fbf0987ef2.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-0042044f00457ff0bf65c07207eea291e4df838e2bdab4dfc602eec8d3517c42.yml From ffbb0f2567f5cd0569f732e9304b3db74cb364e1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 16 Jul 2024 21:24:40 +0000 Subject: [PATCH 11/18] feat(api): OpenAPI spec update via Stainless API (#158) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index da24255..ddfeae1 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-0042044f00457ff0bf65c07207eea291e4df838e2bdab4dfc602eec8d3517c42.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-441451c27073e45d1bdc832c5b66c26d90bd185bd94bd461b91257fbf0987ef2.yml From bb2950c2348f6d1a399d012f0d3b1816a8842c7a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 16 Jul 2024 22:12:50 +0000 Subject: [PATCH 12/18] feat(api): OpenAPI spec update via Stainless API (#159) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index ddfeae1..da24255 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-441451c27073e45d1bdc832c5b66c26d90bd185bd94bd461b91257fbf0987ef2.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-0042044f00457ff0bf65c07207eea291e4df838e2bdab4dfc602eec8d3517c42.yml From 95926621f31f6148bbedfc7c2373445cdccb05c9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 16 Jul 2024 22:23:18 +0000 Subject: [PATCH 13/18] feat(api): OpenAPI spec update via Stainless API (#160) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index da24255..ddfeae1 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-0042044f00457ff0bf65c07207eea291e4df838e2bdab4dfc602eec8d3517c42.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-441451c27073e45d1bdc832c5b66c26d90bd185bd94bd461b91257fbf0987ef2.yml From 51f7e7f84dc87b602e20743b67f2417e6fe4cb48 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 16 Jul 2024 22:42:26 +0000 Subject: [PATCH 14/18] feat(api): update via SDK Studio (#161) --- src/resources/evaluations.ts | 255 +++++++++----- src/resources/prompts.ts | 429 +++++++++++++++-------- tests/api-resources/evaluations.test.ts | 288 ++++----------- tests/api-resources/prompts.test.ts | 444 ++++++------------------ 4 files changed, 606 insertions(+), 810 deletions(-) diff --git a/src/resources/evaluations.ts b/src/resources/evaluations.ts index 5b56520..f99c2d0 100644 --- a/src/resources/evaluations.ts +++ b/src/resources/evaluations.ts @@ -62,53 +62,78 @@ export interface Evaluation { } export namespace Evaluation { - /** - * The initial messages to be included with your call to the LLM API. - */ export interface AppendedMessage { - /** - * Example: "Hello, {{city}}!" - */ - content: string | null; + content: Array< + | AppendedMessage.TextContentBlockSchema + | AppendedMessage.ImageBase64ContentBlock + | AppendedMessage.ToolCallContentBlock + | AppendedMessage.ToolResultContentBlock + >; role: 'assistant' | 'system' | 'tool' | 'user'; - - toolCallId: string | null; - - toolCalls: Array | null; } export namespace AppendedMessage { - export interface ToolCall { - function: ToolCall.Function; + export interface TextContentBlockSchema { + text: string; - /** - * TOOL_CALL_1 - */ - toolCallId: string; + type: 'TEXT'; + } + + export interface ImageBase64ContentBlock { + imageBase64: string; + + mediaType: string; - /** - * The type of the tool. Currently, only `function` is supported. - */ - type: 'function'; + type: 'IMAGE_BASE64'; } - export namespace ToolCall { - export interface Function { + export interface ToolCallContentBlock { + toolCall: ToolCallContentBlock.ToolCall; + + type: 'TOOL_CALL'; + } + + export namespace ToolCallContentBlock { + export interface ToolCall { + function: ToolCall.Function; + /** - * The arguments to call the function with, as generated by the model in JSON - * format. Note that the model does not always generate valid JSON, and may - * hallucinate parameters not defined by your function schema. Validate the - * arguments in your code before calling your function. + * TOOL_CALL_1 */ - arguments: string; + toolCallId: string; /** - * The name of the function to call. + * The type of the tool. Currently, only `function` is supported. */ - name: string; + type: 'function'; + } + + export namespace ToolCall { + export interface Function { + /** + * The arguments to call the function with, as generated by the model in JSON + * format. Note that the model does not always generate valid JSON, and may + * hallucinate parameters not defined by your function schema. Validate the + * arguments in your code before calling your function. + */ + arguments: string; + + /** + * The name of the function to call. + */ + name: string; + } } } + + export interface ToolResultContentBlock { + result: string; + + toolCallId: string; + + type: 'TOOL_RESULT'; + } } } @@ -133,53 +158,78 @@ export interface EvaluationCreateParams { } export namespace EvaluationCreateParams { - /** - * The initial messages to be included with your call to the LLM API. - */ export interface AppendedMessage { - /** - * Example: "Hello, {{city}}!" - */ - content: string | null; + content: Array< + | AppendedMessage.TextContentBlockSchema + | AppendedMessage.ImageBase64ContentBlock + | AppendedMessage.ToolCallContentBlock + | AppendedMessage.ToolResultContentBlock + >; role: 'assistant' | 'system' | 'tool' | 'user'; - - toolCallId: string | null; - - toolCalls: Array | null; } export namespace AppendedMessage { - export interface ToolCall { - function: ToolCall.Function; + export interface TextContentBlockSchema { + text: string; - /** - * TOOL_CALL_1 - */ - toolCallId: string; + type: 'TEXT'; + } + + export interface ImageBase64ContentBlock { + imageBase64: string; - /** - * The type of the tool. Currently, only `function` is supported. - */ - type: 'function'; + mediaType: string; + + type: 'IMAGE_BASE64'; } - export namespace ToolCall { - export interface Function { + export interface ToolCallContentBlock { + toolCall: ToolCallContentBlock.ToolCall; + + type: 'TOOL_CALL'; + } + + export namespace ToolCallContentBlock { + export interface ToolCall { + function: ToolCall.Function; + /** - * The arguments to call the function with, as generated by the model in JSON - * format. Note that the model does not always generate valid JSON, and may - * hallucinate parameters not defined by your function schema. Validate the - * arguments in your code before calling your function. + * TOOL_CALL_1 */ - arguments: string; + toolCallId: string; /** - * The name of the function to call. + * The type of the tool. Currently, only `function` is supported. */ - name: string; + type: 'function'; + } + + export namespace ToolCall { + export interface Function { + /** + * The arguments to call the function with, as generated by the model in JSON + * format. Note that the model does not always generate valid JSON, and may + * hallucinate parameters not defined by your function schema. Validate the + * arguments in your code before calling your function. + */ + arguments: string; + + /** + * The name of the function to call. + */ + name: string; + } } } + + export interface ToolResultContentBlock { + result: string; + + toolCallId: string; + + type: 'TOOL_RESULT'; + } } } @@ -198,52 +248,77 @@ export interface EvaluationUpdateParams { } export namespace EvaluationUpdateParams { - /** - * The initial messages to be included with your call to the LLM API. - */ export interface AppendedMessage { - /** - * Example: "Hello, {{city}}!" - */ - content: string | null; + content: Array< + | AppendedMessage.TextContentBlockSchema + | AppendedMessage.ImageBase64ContentBlock + | AppendedMessage.ToolCallContentBlock + | AppendedMessage.ToolResultContentBlock + >; role: 'assistant' | 'system' | 'tool' | 'user'; - - toolCallId: string | null; - - toolCalls: Array | null; } export namespace AppendedMessage { - export interface ToolCall { - function: ToolCall.Function; + export interface TextContentBlockSchema { + text: string; - /** - * TOOL_CALL_1 - */ - toolCallId: string; + type: 'TEXT'; + } + + export interface ImageBase64ContentBlock { + imageBase64: string; - /** - * The type of the tool. Currently, only `function` is supported. - */ - type: 'function'; + mediaType: string; + + type: 'IMAGE_BASE64'; } - export namespace ToolCall { - export interface Function { + export interface ToolCallContentBlock { + toolCall: ToolCallContentBlock.ToolCall; + + type: 'TOOL_CALL'; + } + + export namespace ToolCallContentBlock { + export interface ToolCall { + function: ToolCall.Function; + /** - * The arguments to call the function with, as generated by the model in JSON - * format. Note that the model does not always generate valid JSON, and may - * hallucinate parameters not defined by your function schema. Validate the - * arguments in your code before calling your function. + * TOOL_CALL_1 */ - arguments: string; + toolCallId: string; /** - * The name of the function to call. + * The type of the tool. Currently, only `function` is supported. */ - name: string; + type: 'function'; } + + export namespace ToolCall { + export interface Function { + /** + * The arguments to call the function with, as generated by the model in JSON + * format. Note that the model does not always generate valid JSON, and may + * hallucinate parameters not defined by your function schema. Validate the + * arguments in your code before calling your function. + */ + arguments: string; + + /** + * The name of the function to call. + */ + name: string; + } + } + } + + export interface ToolResultContentBlock { + result: string; + + toolCallId: string; + + type: 'TOOL_RESULT'; } } } diff --git a/src/resources/prompts.ts b/src/resources/prompts.ts index 2f39bbe..adff8ed 100644 --- a/src/resources/prompts.ts +++ b/src/resources/prompts.ts @@ -452,53 +452,78 @@ export interface PromptConfiguration { } export namespace PromptConfiguration { - /** - * The initial messages to be included with your call to the LLM API. - */ export interface Message { - /** - * Example: "Hello, {{city}}!" - */ - content: string | null; + content: Array< + | Message.TextContentBlockSchema + | Message.ImageBase64ContentBlock + | Message.ToolCallContentBlock + | Message.ToolResultContentBlock + >; role: 'assistant' | 'system' | 'tool' | 'user'; - - toolCallId: string | null; - - toolCalls: Array | null; } export namespace Message { - export interface ToolCall { - function: ToolCall.Function; + export interface TextContentBlockSchema { + text: string; - /** - * TOOL_CALL_1 - */ - toolCallId: string; + type: 'TEXT'; + } + + export interface ImageBase64ContentBlock { + imageBase64: string; - /** - * The type of the tool. Currently, only `function` is supported. - */ - type: 'function'; + mediaType: string; + + type: 'IMAGE_BASE64'; } - export namespace ToolCall { - export interface Function { + export interface ToolCallContentBlock { + toolCall: ToolCallContentBlock.ToolCall; + + type: 'TOOL_CALL'; + } + + export namespace ToolCallContentBlock { + export interface ToolCall { + function: ToolCall.Function; + /** - * The arguments to call the function with, as generated by the model in JSON - * format. Note that the model does not always generate valid JSON, and may - * hallucinate parameters not defined by your function schema. Validate the - * arguments in your code before calling your function. + * TOOL_CALL_1 */ - arguments: string; + toolCallId: string; /** - * The name of the function to call. + * The type of the tool. Currently, only `function` is supported. */ - name: string; + type: 'function'; + } + + export namespace ToolCall { + export interface Function { + /** + * The arguments to call the function with, as generated by the model in JSON + * format. Note that the model does not always generate valid JSON, and may + * hallucinate parameters not defined by your function schema. Validate the + * arguments in your code before calling your function. + */ + arguments: string; + + /** + * The name of the function to call. + */ + name: string; + } } } + + export interface ToolResultContentBlock { + result: string; + + toolCallId: string; + + type: 'TOOL_RESULT'; + } } export interface Parameters { @@ -603,53 +628,80 @@ export interface PromptCreateParams { } export namespace PromptCreateParams { - /** - * The initial messages to be included with your call to the LLM API. - */ export interface Message { - /** - * Example: "Hello, {{city}}!" - */ - content: string | null; + content: Array< + | Message.TextContentBlockSchema + | Message.ImageBase64ContentBlock + | Message.ToolCallContentBlock + | Message.ToolResultContentBlock + >; - role: 'assistant' | 'system' | 'tool' | 'user'; - - toolCallId: string | null; + promptMessageId: string; - toolCalls: Array | null; + role: 'assistant' | 'system' | 'tool' | 'user'; } export namespace Message { - export interface ToolCall { - function: ToolCall.Function; + export interface TextContentBlockSchema { + text: string; - /** - * TOOL_CALL_1 - */ - toolCallId: string; + type: 'TEXT'; + } + + export interface ImageBase64ContentBlock { + imageBase64: string; + + mediaType: string; - /** - * The type of the tool. Currently, only `function` is supported. - */ - type: 'function'; + type: 'IMAGE_BASE64'; } - export namespace ToolCall { - export interface Function { + export interface ToolCallContentBlock { + toolCall: ToolCallContentBlock.ToolCall; + + type: 'TOOL_CALL'; + } + + export namespace ToolCallContentBlock { + export interface ToolCall { + function: ToolCall.Function; + /** - * The arguments to call the function with, as generated by the model in JSON - * format. Note that the model does not always generate valid JSON, and may - * hallucinate parameters not defined by your function schema. Validate the - * arguments in your code before calling your function. + * TOOL_CALL_1 */ - arguments: string; + toolCallId: string; /** - * The name of the function to call. + * The type of the tool. Currently, only `function` is supported. */ - name: string; + type: 'function'; + } + + export namespace ToolCall { + export interface Function { + /** + * The arguments to call the function with, as generated by the model in JSON + * format. Note that the model does not always generate valid JSON, and may + * hallucinate parameters not defined by your function schema. Validate the + * arguments in your code before calling your function. + */ + arguments: string; + + /** + * The name of the function to call. + */ + name: string; + } } } + + export interface ToolResultContentBlock { + result: string; + + toolCallId: string; + + type: 'TOOL_RESULT'; + } } export interface Parameters { @@ -726,53 +778,80 @@ export interface PromptUpdateParams { } export namespace PromptUpdateParams { - /** - * The initial messages to be included with your call to the LLM API. - */ export interface Message { - /** - * Example: "Hello, {{city}}!" - */ - content: string | null; - - role: 'assistant' | 'system' | 'tool' | 'user'; + content: Array< + | Message.TextContentBlockSchema + | Message.ImageBase64ContentBlock + | Message.ToolCallContentBlock + | Message.ToolResultContentBlock + >; - toolCallId: string | null; + promptMessageId: string; - toolCalls: Array | null; + role: 'assistant' | 'system' | 'tool' | 'user'; } export namespace Message { - export interface ToolCall { - function: ToolCall.Function; + export interface TextContentBlockSchema { + text: string; - /** - * TOOL_CALL_1 - */ - toolCallId: string; + type: 'TEXT'; + } + + export interface ImageBase64ContentBlock { + imageBase64: string; + + mediaType: string; + + type: 'IMAGE_BASE64'; + } + + export interface ToolCallContentBlock { + toolCall: ToolCallContentBlock.ToolCall; - /** - * The type of the tool. Currently, only `function` is supported. - */ - type: 'function'; + type: 'TOOL_CALL'; } - export namespace ToolCall { - export interface Function { + export namespace ToolCallContentBlock { + export interface ToolCall { + function: ToolCall.Function; + /** - * The arguments to call the function with, as generated by the model in JSON - * format. Note that the model does not always generate valid JSON, and may - * hallucinate parameters not defined by your function schema. Validate the - * arguments in your code before calling your function. + * TOOL_CALL_1 */ - arguments: string; + toolCallId: string; /** - * The name of the function to call. + * The type of the tool. Currently, only `function` is supported. */ - name: string; + type: 'function'; + } + + export namespace ToolCall { + export interface Function { + /** + * The arguments to call the function with, as generated by the model in JSON + * format. Note that the model does not always generate valid JSON, and may + * hallucinate parameters not defined by your function schema. Validate the + * arguments in your code before calling your function. + */ + arguments: string; + + /** + * The name of the function to call. + */ + name: string; + } } } + + export interface ToolResultContentBlock { + result: string; + + toolCallId: string; + + type: 'TOOL_RESULT'; + } } export interface Parameters { @@ -863,101 +942,151 @@ export interface PromptGetParametersParams { } export namespace PromptGetParametersParams { - /** - * The initial messages to be included with your call to the LLM API. - */ export interface AppendMessage { - /** - * Example: "Hello, {{city}}!" - */ - content: string | null; + content: Array< + | AppendMessage.TextContentBlockSchema + | AppendMessage.ImageBase64ContentBlock + | AppendMessage.ToolCallContentBlock + | AppendMessage.ToolResultContentBlock + >; role: 'assistant' | 'system' | 'tool' | 'user'; - - toolCallId: string | null; - - toolCalls: Array | null; } export namespace AppendMessage { - export interface ToolCall { - function: ToolCall.Function; + export interface TextContentBlockSchema { + text: string; - /** - * TOOL_CALL_1 - */ - toolCallId: string; + type: 'TEXT'; + } + + export interface ImageBase64ContentBlock { + imageBase64: string; + + mediaType: string; + + type: 'IMAGE_BASE64'; + } - /** - * The type of the tool. Currently, only `function` is supported. - */ - type: 'function'; + export interface ToolCallContentBlock { + toolCall: ToolCallContentBlock.ToolCall; + + type: 'TOOL_CALL'; } - export namespace ToolCall { - export interface Function { + export namespace ToolCallContentBlock { + export interface ToolCall { + function: ToolCall.Function; + /** - * The arguments to call the function with, as generated by the model in JSON - * format. Note that the model does not always generate valid JSON, and may - * hallucinate parameters not defined by your function schema. Validate the - * arguments in your code before calling your function. + * TOOL_CALL_1 */ - arguments: string; + toolCallId: string; /** - * The name of the function to call. + * The type of the tool. Currently, only `function` is supported. */ - name: string; + type: 'function'; + } + + export namespace ToolCall { + export interface Function { + /** + * The arguments to call the function with, as generated by the model in JSON + * format. Note that the model does not always generate valid JSON, and may + * hallucinate parameters not defined by your function schema. Validate the + * arguments in your code before calling your function. + */ + arguments: string; + + /** + * The name of the function to call. + */ + name: string; + } } } + + export interface ToolResultContentBlock { + result: string; + + toolCallId: string; + + type: 'TOOL_RESULT'; + } } - /** - * The initial messages to be included with your call to the LLM API. - */ export interface OverrideMessage { - /** - * Example: "Hello, {{city}}!" - */ - content: string | null; + content: Array< + | OverrideMessage.TextContentBlockSchema + | OverrideMessage.ImageBase64ContentBlock + | OverrideMessage.ToolCallContentBlock + | OverrideMessage.ToolResultContentBlock + >; role: 'assistant' | 'system' | 'tool' | 'user'; - - toolCallId: string | null; - - toolCalls: Array | null; } export namespace OverrideMessage { - export interface ToolCall { - function: ToolCall.Function; + export interface TextContentBlockSchema { + text: string; - /** - * TOOL_CALL_1 - */ - toolCallId: string; + type: 'TEXT'; + } + + export interface ImageBase64ContentBlock { + imageBase64: string; - /** - * The type of the tool. Currently, only `function` is supported. - */ - type: 'function'; + mediaType: string; + + type: 'IMAGE_BASE64'; } - export namespace ToolCall { - export interface Function { + export interface ToolCallContentBlock { + toolCall: ToolCallContentBlock.ToolCall; + + type: 'TOOL_CALL'; + } + + export namespace ToolCallContentBlock { + export interface ToolCall { + function: ToolCall.Function; + /** - * The arguments to call the function with, as generated by the model in JSON - * format. Note that the model does not always generate valid JSON, and may - * hallucinate parameters not defined by your function schema. Validate the - * arguments in your code before calling your function. + * TOOL_CALL_1 */ - arguments: string; + toolCallId: string; /** - * The name of the function to call. + * The type of the tool. Currently, only `function` is supported. */ - name: string; + type: 'function'; } + + export namespace ToolCall { + export interface Function { + /** + * The arguments to call the function with, as generated by the model in JSON + * format. Note that the model does not always generate valid JSON, and may + * hallucinate parameters not defined by your function schema. Validate the + * arguments in your code before calling your function. + */ + arguments: string; + + /** + * The name of the function to call. + */ + name: string; + } + } + } + + export interface ToolResultContentBlock { + result: string; + + toolCallId: string; + + type: 'TOOL_RESULT'; } } } diff --git a/tests/api-resources/evaluations.test.ts b/tests/api-resources/evaluations.test.ts index 132c090..b51cd36 100644 --- a/tests/api-resources/evaluations.test.ts +++ b/tests/api-resources/evaluations.test.ts @@ -13,70 +13,28 @@ describe('resource evaluations', () => { const responsePromise = promptFoundry.evaluations.create({ appendedMessages: [ { - content: 'content', - role: 'assistant', - toolCallId: 'toolCallId', - toolCalls: [ - { - 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: [ + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, ], + role: 'assistant', }, { - content: 'content', - role: 'assistant', - toolCallId: 'toolCallId', - toolCalls: [ - { - 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: [ + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, ], + role: 'assistant', }, { - content: 'content', - role: 'assistant', - toolCallId: 'toolCallId', - toolCalls: [ - { - 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: [ + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, ], + role: 'assistant', }, ], promptId: 'promptId', @@ -95,70 +53,28 @@ describe('resource evaluations', () => { const response = await promptFoundry.evaluations.create({ appendedMessages: [ { - content: 'content', - role: 'assistant', - toolCallId: 'toolCallId', - toolCalls: [ - { - 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: [ + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, ], + role: 'assistant', }, { - content: 'content', - role: 'assistant', - toolCallId: 'toolCallId', - toolCalls: [ - { - 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: [ + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, ], + role: 'assistant', }, { - content: 'content', - role: 'assistant', - toolCallId: 'toolCallId', - toolCalls: [ - { - 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: [ + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, ], + role: 'assistant', }, ], promptId: 'promptId', @@ -170,70 +86,28 @@ describe('resource evaluations', () => { const responsePromise = promptFoundry.evaluations.update('1212121', { appendedMessages: [ { - content: 'content', - role: 'assistant', - toolCallId: 'toolCallId', - toolCalls: [ - { - 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: [ + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, ], + role: 'assistant', }, { - content: 'content', - role: 'assistant', - toolCallId: 'toolCallId', - toolCalls: [ - { - 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: [ + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, ], + role: 'assistant', }, { - content: 'content', - role: 'assistant', - toolCallId: 'toolCallId', - toolCalls: [ - { - 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: [ + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, ], + role: 'assistant', }, ], promptId: 'promptId', @@ -252,70 +126,28 @@ describe('resource evaluations', () => { const response = await promptFoundry.evaluations.update('1212121', { appendedMessages: [ { - content: 'content', - role: 'assistant', - toolCallId: 'toolCallId', - toolCalls: [ - { - 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: [ + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, ], + role: 'assistant', }, { - content: 'content', - role: 'assistant', - toolCallId: 'toolCallId', - toolCalls: [ - { - 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: [ + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, ], + role: 'assistant', }, { - content: 'content', - role: 'assistant', - toolCallId: 'toolCallId', - toolCalls: [ - { - 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: [ + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, ], + role: 'assistant', }, ], promptId: 'promptId', diff --git a/tests/api-resources/prompts.test.ts b/tests/api-resources/prompts.test.ts index 043d444..dc17e2a 100644 --- a/tests/api-resources/prompts.test.ts +++ b/tests/api-resources/prompts.test.ts @@ -13,70 +13,31 @@ describe('resource prompts', () => { const responsePromise = promptFoundry.prompts.create({ messages: [ { - content: 'content', - role: 'assistant', - toolCallId: 'toolCallId', - toolCalls: [ - { - 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: [ + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, ], + role: 'assistant', + promptMessageId: 'promptMessageId', }, { - content: 'content', - role: 'assistant', - toolCallId: 'toolCallId', - toolCalls: [ - { - 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: [ + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, ], + role: 'assistant', + promptMessageId: 'promptMessageId', }, { - content: 'content', - role: 'assistant', - toolCallId: 'toolCallId', - toolCalls: [ - { - 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: [ + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, ], + role: 'assistant', + promptMessageId: 'promptMessageId', }, ], name: 'name', @@ -110,70 +71,31 @@ describe('resource prompts', () => { const response = await promptFoundry.prompts.create({ messages: [ { - content: 'content', - role: 'assistant', - toolCallId: 'toolCallId', - toolCalls: [ - { - 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: [ + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, ], + role: 'assistant', + promptMessageId: 'promptMessageId', }, { - content: 'content', - role: 'assistant', - toolCallId: 'toolCallId', - toolCalls: [ - { - 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: [ + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, ], + role: 'assistant', + promptMessageId: 'promptMessageId', }, { - content: 'content', - role: 'assistant', - toolCallId: 'toolCallId', - toolCalls: [ - { - 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: [ + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, ], + role: 'assistant', + promptMessageId: 'promptMessageId', }, ], name: 'name', @@ -200,70 +122,31 @@ describe('resource prompts', () => { const responsePromise = promptFoundry.prompts.update('1212121', { messages: [ { - content: 'content', - role: 'assistant', - toolCallId: 'toolCallId', - toolCalls: [ - { - 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: [ + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, ], + role: 'assistant', + promptMessageId: 'promptMessageId', }, { - content: 'content', - role: 'assistant', - toolCallId: 'toolCallId', - toolCalls: [ - { - 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: [ + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, ], + role: 'assistant', + promptMessageId: 'promptMessageId', }, { - content: 'content', - role: 'assistant', - toolCallId: 'toolCallId', - toolCalls: [ - { - 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: [ + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, ], + role: 'assistant', + promptMessageId: 'promptMessageId', }, ], name: 'name', @@ -297,70 +180,31 @@ describe('resource prompts', () => { const response = await promptFoundry.prompts.update('1212121', { messages: [ { - content: 'content', - role: 'assistant', - toolCallId: 'toolCallId', - toolCalls: [ - { - 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: [ + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, ], + role: 'assistant', + promptMessageId: 'promptMessageId', }, { - content: 'content', - role: 'assistant', - toolCallId: 'toolCallId', - toolCalls: [ - { - 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: [ + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, ], + role: 'assistant', + promptMessageId: 'promptMessageId', }, { - content: 'content', - role: 'assistant', - toolCallId: 'toolCallId', - toolCalls: [ - { - 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: [ + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, ], + role: 'assistant', + promptMessageId: 'promptMessageId', }, ], name: 'name', @@ -463,138 +307,54 @@ describe('resource prompts', () => { { appendMessages: [ { - content: 'content', - role: 'assistant', - toolCallId: 'toolCallId', - toolCalls: [ - { - 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: [ + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, ], + role: 'assistant', }, { - content: 'content', - role: 'assistant', - toolCallId: 'toolCallId', - toolCalls: [ - { - 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: [ + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, ], + role: 'assistant', }, { - content: 'content', - role: 'assistant', - toolCallId: 'toolCallId', - toolCalls: [ - { - 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: [ + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, ], + role: 'assistant', }, ], overrideMessages: [ { - content: 'content', - role: 'assistant', - toolCallId: 'toolCallId', - toolCalls: [ - { - 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: [ + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, ], + role: 'assistant', }, { - content: 'content', - role: 'assistant', - toolCallId: 'toolCallId', - toolCalls: [ - { - 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: [ + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, ], + role: 'assistant', }, { - content: 'content', - role: 'assistant', - toolCallId: 'toolCallId', - toolCalls: [ - { - 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: [ + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, + { type: 'TEXT', text: 'text' }, ], + role: 'assistant', }, ], user: 'user', From 6d53e0cba5660e0a7c8968d8f5b42a87caceffd9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 16 Jul 2024 23:13:06 +0000 Subject: [PATCH 15/18] feat(api): OpenAPI spec update via Stainless API (#162) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index ddfeae1..da24255 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-441451c27073e45d1bdc832c5b66c26d90bd185bd94bd461b91257fbf0987ef2.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-0042044f00457ff0bf65c07207eea291e4df838e2bdab4dfc602eec8d3517c42.yml From 6470ed7715650a3c347125eb77846c6d846b62f2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 16 Jul 2024 23:28:07 +0000 Subject: [PATCH 16/18] feat(api): OpenAPI spec update via Stainless API (#163) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index da24255..ddfeae1 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-0042044f00457ff0bf65c07207eea291e4df838e2bdab4dfc602eec8d3517c42.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-441451c27073e45d1bdc832c5b66c26d90bd185bd94bd461b91257fbf0987ef2.yml From 9f64698302e6c5db1f18adbbf5c1247a20f9fdd6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 17 Jul 2024 00:12:47 +0000 Subject: [PATCH 17/18] feat(api): OpenAPI spec update via Stainless API (#164) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index ddfeae1..da24255 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-441451c27073e45d1bdc832c5b66c26d90bd185bd94bd461b91257fbf0987ef2.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-0042044f00457ff0bf65c07207eea291e4df838e2bdab4dfc602eec8d3517c42.yml From fff82160da7cc55c2523fc7225b97d33af20d64f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 17 Jul 2024 00:13:00 +0000 Subject: [PATCH 18/18] release: 1.14.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 24 ++++++++++++++++++++++++ package.json | 2 +- src/version.ts | 2 +- 4 files changed, 27 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 23860f9..2ef9a1c 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.13.0" + ".": "1.14.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 730c4af..da39443 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,29 @@ # Changelog +## 1.14.0 (2024-07-17) + +Full Changelog: [v1.13.0...v1.14.0](https://github.com/prompt-foundry/typescript-sdk/compare/v1.13.0...v1.14.0) + +### Features + +* **api:** OpenAPI spec update via Stainless API ([#147](https://github.com/prompt-foundry/typescript-sdk/issues/147)) ([32cb6f9](https://github.com/prompt-foundry/typescript-sdk/commit/32cb6f92b8f7b5efd743d698d113eff2754cd40b)) +* **api:** OpenAPI spec update via Stainless API ([#149](https://github.com/prompt-foundry/typescript-sdk/issues/149)) ([de660c2](https://github.com/prompt-foundry/typescript-sdk/commit/de660c2b31f79be4195159f94c6c3ca112ba6447)) +* **api:** OpenAPI spec update via Stainless API ([#150](https://github.com/prompt-foundry/typescript-sdk/issues/150)) ([b7ef788](https://github.com/prompt-foundry/typescript-sdk/commit/b7ef7880cf87a071c0435cdd2b49ba7cc46f49a0)) +* **api:** OpenAPI spec update via Stainless API ([#151](https://github.com/prompt-foundry/typescript-sdk/issues/151)) ([fb48dbd](https://github.com/prompt-foundry/typescript-sdk/commit/fb48dbd5ff6b29a564f28a289c58e5991386ca40)) +* **api:** OpenAPI spec update via Stainless API ([#152](https://github.com/prompt-foundry/typescript-sdk/issues/152)) ([755a2b3](https://github.com/prompt-foundry/typescript-sdk/commit/755a2b3f28a1d277235a7a7792398fca8a8a2843)) +* **api:** OpenAPI spec update via Stainless API ([#153](https://github.com/prompt-foundry/typescript-sdk/issues/153)) ([93f9555](https://github.com/prompt-foundry/typescript-sdk/commit/93f95551e6a63115efb9f8610b18fa5c9c2831fc)) +* **api:** OpenAPI spec update via Stainless API ([#154](https://github.com/prompt-foundry/typescript-sdk/issues/154)) ([f9dac25](https://github.com/prompt-foundry/typescript-sdk/commit/f9dac25563076648db74238dab095038e970b980)) +* **api:** OpenAPI spec update via Stainless API ([#155](https://github.com/prompt-foundry/typescript-sdk/issues/155)) ([a079c06](https://github.com/prompt-foundry/typescript-sdk/commit/a079c063443fa4d74de035966f455bb92dcd830b)) +* **api:** OpenAPI spec update via Stainless API ([#156](https://github.com/prompt-foundry/typescript-sdk/issues/156)) ([6d54ca4](https://github.com/prompt-foundry/typescript-sdk/commit/6d54ca422b72aadfe3e7ff1022cb576aa962c053)) +* **api:** OpenAPI spec update via Stainless API ([#157](https://github.com/prompt-foundry/typescript-sdk/issues/157)) ([bf8d9d9](https://github.com/prompt-foundry/typescript-sdk/commit/bf8d9d9b83c9cd63e9dfbe0521e87d747131ab17)) +* **api:** OpenAPI spec update via Stainless API ([#158](https://github.com/prompt-foundry/typescript-sdk/issues/158)) ([ffbb0f2](https://github.com/prompt-foundry/typescript-sdk/commit/ffbb0f2567f5cd0569f732e9304b3db74cb364e1)) +* **api:** OpenAPI spec update via Stainless API ([#159](https://github.com/prompt-foundry/typescript-sdk/issues/159)) ([bb2950c](https://github.com/prompt-foundry/typescript-sdk/commit/bb2950c2348f6d1a399d012f0d3b1816a8842c7a)) +* **api:** OpenAPI spec update via Stainless API ([#160](https://github.com/prompt-foundry/typescript-sdk/issues/160)) ([9592662](https://github.com/prompt-foundry/typescript-sdk/commit/95926621f31f6148bbedfc7c2373445cdccb05c9)) +* **api:** OpenAPI spec update via Stainless API ([#162](https://github.com/prompt-foundry/typescript-sdk/issues/162)) ([6d53e0c](https://github.com/prompt-foundry/typescript-sdk/commit/6d53e0cba5660e0a7c8968d8f5b42a87caceffd9)) +* **api:** OpenAPI spec update via Stainless API ([#163](https://github.com/prompt-foundry/typescript-sdk/issues/163)) ([6470ed7](https://github.com/prompt-foundry/typescript-sdk/commit/6470ed7715650a3c347125eb77846c6d846b62f2)) +* **api:** OpenAPI spec update via Stainless API ([#164](https://github.com/prompt-foundry/typescript-sdk/issues/164)) ([9f64698](https://github.com/prompt-foundry/typescript-sdk/commit/9f64698302e6c5db1f18adbbf5c1247a20f9fdd6)) +* **api:** update via SDK Studio ([#161](https://github.com/prompt-foundry/typescript-sdk/issues/161)) ([51f7e7f](https://github.com/prompt-foundry/typescript-sdk/commit/51f7e7f84dc87b602e20743b67f2417e6fe4cb48)) + ## 1.13.0 (2024-07-10) Full Changelog: [v1.12.0...v1.13.0](https://github.com/prompt-foundry/typescript-sdk/compare/v1.12.0...v1.13.0) diff --git a/package.json b/package.json index 06a394e..55c6cd9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@prompt-foundry/typescript-sdk", - "version": "1.13.0", + "version": "1.14.0", "description": "The prompt engineering, prompt management, and prompt evaluation tool for TypeScript, JavaScript, and NodeJS.", "keywords": [ "typescript", diff --git a/src/version.ts b/src/version.ts index 287b358..9fa94e0 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '1.13.0'; // x-release-please-version +export const VERSION = '1.14.0'; // x-release-please-version