Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new set of cloud tests for the Cohere API, covering various functionalities such as chat, embedding, and reranking. The tests are designed to ensure the API's reliability and functionality, and they are implemented using the Jest testing framework.
Changes:
"bin"
field is added to specify the location of the test script, and a new"cloud-tests"
script is defined to run the cloud tests.chat
andchatStream
methods. It imports the necessary modules, sets up the test environment, and defines test cases to verify the expected behaviour of the chat methods.chatStream
method. It imports the required modules, configures the test environment, and defines test cases to validate the expected behaviour of the chat stream.convict
module, defines an array of testable features, and creates a configuration object with properties likebaseUrl
,apiKey
, andfeaturesToTest
. The configuration is then validated and exported for use in other test files.v2.embed
method. It imports the necessary modules, sets up the test environment, and defines a test case to verify the expected behaviour of the embedding method.embed
method. It imports the required modules, configures the test environment, and defines a test case to validate the expected behaviour of the embedding method.v2.rerank
method. It imports the necessary modules, sets up the test environment, and defines a test case to verify the expected behaviour of the reranking method.rerank
method. It imports the required modules, configures the test environment, and defines a test case to validate the expected behaviour of the reranking method.convict.ts
file, sets environment variables, and then runs the cloud tests using the Jest CLI.CohereClient
class, retrieves configuration values, and exports helper functions likeskipIf
andskipIfTestTypeIsnt
to conditionally skip tests based on the configuration.