From 8066ab7e44a51bdaa90f5811319b9e13003ab336 Mon Sep 17 00:00:00 2001 From: billytrend-cohere <144115527+billytrend-cohere@users.noreply.github.com> Date: Thu, 18 Jan 2024 10:39:16 +0000 Subject: [PATCH] Make evalData optional --- src/api/resources/datasets/client/Client.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/api/resources/datasets/client/Client.ts b/src/api/resources/datasets/client/Client.ts index 396f144..9236e56 100644 --- a/src/api/resources/datasets/client/Client.ts +++ b/src/api/resources/datasets/client/Client.ts @@ -117,12 +117,14 @@ export class Datasets { */ public async create( data: File | fs.ReadStream, - evalData: File | fs.ReadStream, + evalData?: File | fs.ReadStream, requestOptions?: Datasets.RequestOptions ): Promise { const _request = new FormData(); _request.append("data", data); - _request.append("eval_data", evalData); + if (evalData) { + _request.append("eval_data", evalData); + } const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.CohereEnvironment.Production,