From b894027be6e71c5bc1ce3139a294cbfdb002a29b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugues=20de=20Saxc=C3=A9?= Date: Wed, 12 Jun 2024 18:15:57 +0200 Subject: [PATCH 1/5] fix: type -> promptType on dataset item metadata and in createGeneration return type --- src/api.ts | 8 ++++++-- tests/integration/api.test.ts | 6 +++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/api.ts b/src/api.ts index 28f256a..c0c738f 100644 --- a/src/api.ts +++ b/src/api.ts @@ -760,7 +760,7 @@ export class API { mutation CreateGeneration($generation: GenerationPayloadInput!) { createGeneration(generation: $generation) { id, - type + promptType } } `; @@ -770,7 +770,11 @@ export class API { }; const response = await this.makeGqlCall(mutation, variables); - return response.data.createGeneration as PersistedGeneration; + const stepGeneration = response.data.createGeneration; + return { + id: stepGeneration.id, + promptType: stepGeneration.promptType + } as PersistedGeneration; } // Thread diff --git a/tests/integration/api.test.ts b/tests/integration/api.test.ts index 442bfb3..b271134 100644 --- a/tests/integration/api.test.ts +++ b/tests/integration/api.test.ts @@ -546,8 +546,8 @@ describe('End to end tests for the SDK', function () { await step .step({ - name: 'gpt-4', - type: 'llm', + name: 'agent', + type: 'run', input: { content: 'hello' }, output: { content: 'hello!' } }) @@ -598,7 +598,7 @@ describe('End to end tests for the SDK', function () { expect(datasetItem.createdAt).not.toBeNull(); expect(datasetItem.input).not.toBeNull(); expect(datasetItem.expectedOutput).not.toBeNull(); - expect(datasetItem.metadata.type).toBe('CHAT'); + expect(datasetItem.metadata.promptType).toBe('CHAT'); }); }); From 9afbac48246d30e5a515294fc1673f7a51a875f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugues=20de=20Saxc=C3=A9?= Date: Thu, 13 Jun 2024 14:45:32 +0200 Subject: [PATCH 2/5] fix: map to type instead of promptType Co-authored-by: Damien BUTY --- src/api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api.ts b/src/api.ts index c0c738f..ace1fdd 100644 --- a/src/api.ts +++ b/src/api.ts @@ -773,7 +773,7 @@ export class API { const stepGeneration = response.data.createGeneration; return { id: stepGeneration.id, - promptType: stepGeneration.promptType + type: stepGeneration.promptType } as PersistedGeneration; } From 490efe7cdcaeb9d550ae216b37a29a5213a5dd6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugues=20de=20Saxc=C3=A9?= Date: Thu, 13 Jun 2024 16:36:58 +0200 Subject: [PATCH 3/5] fix: revert back to llm --- tests/integration/api.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/integration/api.test.ts b/tests/integration/api.test.ts index b271134..905688f 100644 --- a/tests/integration/api.test.ts +++ b/tests/integration/api.test.ts @@ -546,8 +546,8 @@ describe('End to end tests for the SDK', function () { await step .step({ - name: 'agent', - type: 'run', + name: 'gpt-4o', + type: 'llm', input: { content: 'hello' }, output: { content: 'hello!' } }) From 39a8304d056889ba87bc9b67f7962e4e4dd918dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugues=20de=20Saxc=C3=A9?= Date: Fri, 14 Jun 2024 11:39:41 +0200 Subject: [PATCH 4/5] fix: revert type/promptType breaking change --- src/api.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/api.ts b/src/api.ts index ace1fdd..e0031e0 100644 --- a/src/api.ts +++ b/src/api.ts @@ -760,7 +760,7 @@ export class API { mutation CreateGeneration($generation: GenerationPayloadInput!) { createGeneration(generation: $generation) { id, - promptType + type } } `; @@ -770,11 +770,7 @@ export class API { }; const response = await this.makeGqlCall(mutation, variables); - const stepGeneration = response.data.createGeneration; - return { - id: stepGeneration.id, - type: stepGeneration.promptType - } as PersistedGeneration; + return response.data.createGeneration as PersistedGeneration; } // Thread From 3d799604aee79355f6ae415b52fa9ea54dcb2f50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugues=20de=20Saxc=C3=A9?= Date: Tue, 18 Jun 2024 10:07:04 +0200 Subject: [PATCH 5/5] fix: revert blankspace --- src/api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api.ts b/src/api.ts index e0031e0..28f256a 100644 --- a/src/api.ts +++ b/src/api.ts @@ -760,7 +760,7 @@ export class API { mutation CreateGeneration($generation: GenerationPayloadInput!) { createGeneration(generation: $generation) { id, - type + type } } `;