Skip to content

Commit

Permalink
Make evalData optional
Browse files Browse the repository at this point in the history
  • Loading branch information
billytrend-cohere committed Jan 18, 2024
1 parent 0ae1954 commit 8066ab7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/api/resources/datasets/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Cohere.DatasetsCreateResponse> {
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,
Expand Down

0 comments on commit 8066ab7

Please sign in to comment.