This PR introduces a new CustomClient class that extends the CohereClient class. The CustomClient class includes a constructor that performs a check on the _options.environment value, removing any trailing "/v1" for backward compatibility.
Code Changes:
Added a new file, CustomClient.ts, which contains the CustomClient class definition.
Updated the import statement in index.ts to import CustomClient from CustomClient.ts and export it as CohereClient.
Added a new test file, client.test.ts, with corresponding snapshot file client.test.ts.snap, to test the backward compatibility of the CohereClient class.
Updated the import statement in tests.test.ts to import CohereClient from index.ts.
This PR introduces a new
CustomClient
class that extends theCohereClient
class. TheCustomClient
class includes a constructor that performs a check on the_options.environment
value, removing any trailing "/v1" for backward compatibility.Code Changes:
CustomClient.ts
, which contains theCustomClient
class definition.CustomClient
fromCustomClient.ts
and export it asCohereClient
.client.test.ts
, with corresponding snapshot fileclient.test.ts.snap
, to test the backward compatibility of theCohereClient
class.tests.test.ts
to importCohereClient
fromindex.ts
.