Skip to content

Commit

Permalink
Release 7.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Dec 6, 2023
1 parent 227db85 commit 25474af
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 18 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cohere-ai",
"version": "7.5.0",
"version": "7.5.1",
"private": false,
"repository": "https://github.com/cohere-ai/cohere-typescript",
"main": "./index.js",
Expand Down
25 changes: 15 additions & 10 deletions src/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class CohereClient {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.5.0",
"X-Fern-SDK-Version": "7.5.1",
},
body: {
...(await serializers.ChatStreamRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" })),
Expand Down Expand Up @@ -88,7 +88,7 @@ export class CohereClient {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.5.0",
"X-Fern-SDK-Version": "7.5.1",
},
contentType: "application/json",
body: {
Expand Down Expand Up @@ -149,7 +149,7 @@ export class CohereClient {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.5.0",
"X-Fern-SDK-Version": "7.5.1",
},
contentType: "application/json",
body: await serializers.GenerateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
Expand Down Expand Up @@ -218,7 +218,7 @@ export class CohereClient {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.5.0",
"X-Fern-SDK-Version": "7.5.1",
},
contentType: "application/json",
body: await serializers.EmbedRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
Expand Down Expand Up @@ -281,7 +281,7 @@ export class CohereClient {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.5.0",
"X-Fern-SDK-Version": "7.5.1",
},
contentType: "application/json",
body: await serializers.RerankRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
Expand Down Expand Up @@ -340,7 +340,7 @@ export class CohereClient {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.5.0",
"X-Fern-SDK-Version": "7.5.1",
},
contentType: "application/json",
body: await serializers.ClassifyRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
Expand Down Expand Up @@ -388,6 +388,11 @@ export class CohereClient {

/**
* This endpoint identifies which language each of the provided texts is written in.
*
* @example
* await cohere.detectLanguage({
* texts: []
* })
*/
public async detectLanguage(
request: Cohere.DetectLanguageRequest,
Expand All @@ -403,7 +408,7 @@ export class CohereClient {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.5.0",
"X-Fern-SDK-Version": "7.5.1",
},
contentType: "application/json",
body: await serializers.DetectLanguageRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
Expand Down Expand Up @@ -459,7 +464,7 @@ export class CohereClient {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.5.0",
"X-Fern-SDK-Version": "7.5.1",
},
contentType: "application/json",
body: await serializers.SummarizeRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
Expand Down Expand Up @@ -517,7 +522,7 @@ export class CohereClient {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.5.0",
"X-Fern-SDK-Version": "7.5.1",
},
contentType: "application/json",
body: await serializers.TokenizeRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
Expand Down Expand Up @@ -580,7 +585,7 @@ export class CohereClient {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.5.0",
"X-Fern-SDK-Version": "7.5.1",
},
contentType: "application/json",
body: await serializers.DetokenizeRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
Expand Down
6 changes: 6 additions & 0 deletions src/api/client/requests/DetectLanguageRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
* This file was auto-generated by Fern from our API Definition.
*/

/**
* @example
* {
* texts: []
* }
*/
export interface DetectLanguageRequest {
/** List of strings to run the detection on. */
texts: string[];
Expand Down
21 changes: 15 additions & 6 deletions src/api/resources/connectors/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ export class Connectors {
* Returns a list of connectors ordered by descending creation date (newer first).
* @throws {@link Cohere.BadRequestError}
* @throws {@link Cohere.InternalServerError}
*
* @example
* await cohere.connectors.list({})
*/
public async list(
request: Cohere.ListRequest = {},
Expand All @@ -56,7 +59,7 @@ export class Connectors {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.5.0",
"X-Fern-SDK-Version": "7.5.1",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -123,7 +126,7 @@ export class Connectors {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.5.0",
"X-Fern-SDK-Version": "7.5.1",
},
contentType: "application/json",
body: await serializers.CreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
Expand Down Expand Up @@ -188,7 +191,7 @@ export class Connectors {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.5.0",
"X-Fern-SDK-Version": "7.5.1",
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
Expand Down Expand Up @@ -241,6 +244,9 @@ export class Connectors {
* @throws {@link Cohere.ForbiddenError}
* @throws {@link Cohere.NotFoundError}
* @throws {@link Cohere.InternalServerError}
*
* @example
* await cohere.connectors.delete("id")
*/
public async delete(id: string, requestOptions?: Connectors.RequestOptions): Promise<Cohere.DeleteResponse> {
const _response = await core.fetcher({
Expand All @@ -253,7 +259,7 @@ export class Connectors {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.5.0",
"X-Fern-SDK-Version": "7.5.1",
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
Expand Down Expand Up @@ -324,7 +330,7 @@ export class Connectors {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.5.0",
"X-Fern-SDK-Version": "7.5.1",
},
contentType: "application/json",
body: await serializers.UpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
Expand Down Expand Up @@ -379,6 +385,9 @@ export class Connectors {
* @throws {@link Cohere.BadRequestError}
* @throws {@link Cohere.NotFoundError}
* @throws {@link Cohere.InternalServerError}
*
* @example
* await cohere.connectors.oAuthAuthorize("id")
*/
public async oAuthAuthorize(
id: string,
Expand All @@ -394,7 +403,7 @@ export class Connectors {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.5.0",
"X-Fern-SDK-Version": "7.5.1",
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
Expand Down
4 changes: 4 additions & 0 deletions src/api/resources/connectors/client/requests/ListRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
* This file was auto-generated by Fern from our API Definition.
*/

/**
* @example
* {}
*/
export interface ListRequest {
/**
* Maximum number of connectors to return [0, 100].
Expand Down
3 changes: 2 additions & 1 deletion src/core/fetcher/Fetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ async function fetcherImpl<R = unknown>(args: Fetcher.Args): Promise<APIResponse
response.status >= 500
) {
const delay = Math.min(INITIAL_RETRY_DELAY * Math.pow(i, 2), MAX_RETRY_DELAY);
response = await new Promise((resolve) => setTimeout(resolve, delay));
await new Promise((resolve) => setTimeout(resolve, delay));
response = await makeRequest();
} else {
break;
}
Expand Down

0 comments on commit 25474af

Please sign in to comment.