Skip to content

Commit

Permalink
SDK regeneration (#147)
Browse files Browse the repository at this point in the history
Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com>
  • Loading branch information
fern-api[bot] authored Apr 4, 2024
1 parent c07b47b commit 5188b11
Show file tree
Hide file tree
Showing 38 changed files with 251 additions and 224 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.9.0",
"version": "7.9.1",
"private": false,
"repository": "https://github.com/cohere-ai/cohere-typescript",
"main": "./index.js",
Expand Down
43 changes: 22 additions & 21 deletions src/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class CohereClient {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.9.0",
"X-Fern-SDK-Version": "7.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand All @@ -63,7 +63,7 @@ export class CohereClient {
stream: true,
},
responseType: "streaming",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000,
maxRetries: requestOptions?.maxRetries,
});
if (_response.ok) {
Expand Down Expand Up @@ -147,7 +147,7 @@ export class CohereClient {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.9.0",
"X-Fern-SDK-Version": "7.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand All @@ -156,7 +156,7 @@ export class CohereClient {
...(await serializers.ChatRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" })),
stream: false,
},
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000,
maxRetries: requestOptions?.maxRetries,
});
if (_response.ok) {
Expand Down Expand Up @@ -221,7 +221,7 @@ export class CohereClient {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.9.0",
"X-Fern-SDK-Version": "7.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand All @@ -231,7 +231,7 @@ export class CohereClient {
stream: true,
},
responseType: "streaming",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000,
maxRetries: requestOptions?.maxRetries,
});
if (_response.ok) {
Expand Down Expand Up @@ -316,7 +316,7 @@ export class CohereClient {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.9.0",
"X-Fern-SDK-Version": "7.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand All @@ -325,7 +325,7 @@ export class CohereClient {
...(await serializers.GenerateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" })),
stream: false,
},
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000,
maxRetries: requestOptions?.maxRetries,
});
if (_response.ok) {
Expand Down Expand Up @@ -397,13 +397,13 @@ export class CohereClient {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.9.0",
"X-Fern-SDK-Version": "7.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
contentType: "application/json",
body: await serializers.EmbedRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000,
maxRetries: requestOptions?.maxRetries,
});
if (_response.ok) {
Expand Down Expand Up @@ -476,13 +476,13 @@ export class CohereClient {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.9.0",
"X-Fern-SDK-Version": "7.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
contentType: "application/json",
body: await serializers.RerankRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000,
maxRetries: requestOptions?.maxRetries,
});
if (_response.ok) {
Expand Down Expand Up @@ -584,13 +584,13 @@ export class CohereClient {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.9.0",
"X-Fern-SDK-Version": "7.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
contentType: "application/json",
body: await serializers.ClassifyRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000,
maxRetries: requestOptions?.maxRetries,
});
if (_response.ok) {
Expand Down Expand Up @@ -665,13 +665,13 @@ export class CohereClient {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.9.0",
"X-Fern-SDK-Version": "7.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
contentType: "application/json",
body: await serializers.SummarizeRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000,
maxRetries: requestOptions?.maxRetries,
});
if (_response.ok) {
Expand Down Expand Up @@ -741,13 +741,13 @@ export class CohereClient {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.9.0",
"X-Fern-SDK-Version": "7.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
contentType: "application/json",
body: await serializers.TokenizeRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000,
maxRetries: requestOptions?.maxRetries,
});
if (_response.ok) {
Expand Down Expand Up @@ -797,7 +797,8 @@ export class CohereClient {
*
* @example
* await cohere.detokenize({
* tokens: [10104, 12221, 1315, 34, 1420, 69]
* tokens: [10104, 12221, 1315, 34, 1420, 69],
* model: "command"
* })
*/
public async detokenize(
Expand All @@ -818,13 +819,13 @@ export class CohereClient {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.9.0",
"X-Fern-SDK-Version": "7.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
contentType: "application/json",
body: await serializers.DetokenizeRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000,
maxRetries: requestOptions?.maxRetries,
});
if (_response.ok) {
Expand Down
2 changes: 1 addition & 1 deletion src/api/client/requests/ChatRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export interface ChatRequest {
*/
message: string;
/**
* Defaults to `command`.
* Defaults to `command-r`.
*
* The name of a compatible [Cohere model](https://docs.cohere.com/docs/models) or the ID of a [fine-tuned](https://docs.cohere.com/docs/chat-fine-tuning) model.
*
Expand Down
2 changes: 1 addition & 1 deletion src/api/client/requests/ChatStreamRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export interface ChatStreamRequest {
*/
message: string;
/**
* Defaults to `command`.
* Defaults to `command-r`.
*
* The name of a compatible [Cohere model](https://docs.cohere.com/docs/models) or the ID of a [fine-tuned](https://docs.cohere.com/docs/chat-fine-tuning) model.
*
Expand Down
5 changes: 3 additions & 2 deletions src/api/client/requests/DetokenizeRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
/**
* @example
* {
* tokens: [10104, 12221, 1315, 34, 1420, 69]
* tokens: [10104, 12221, 1315, 34, 1420, 69],
* model: "command"
* }
*/
export interface DetokenizeRequest {
/** The list of tokens to be detokenized. */
tokens: number[];
/** An optional parameter to provide the model name. This will ensure that the detokenization is done by the tokenizer used by that model. */
model?: string;
model: string;
}
2 changes: 1 addition & 1 deletion src/api/client/requests/EmbedRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export interface EmbedRequest {
* * `"binary"`: Use this when you want to get back signed binary embeddings. Valid for only v3 models.
* * `"ubinary"`: Use this when you want to get back unsigned binary embeddings. Valid for only v3 models.
*/
embeddingTypes?: Cohere.EmbedRequestEmbeddingTypesItem[];
embeddingTypes?: Cohere.EmbeddingType[];
/**
* One of `NONE|START|END` to specify how the API will handle inputs longer than the maximum token length.
*
Expand Down
2 changes: 1 addition & 1 deletion src/api/client/requests/TokenizeRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ export interface TokenizeRequest {
/** The string to be tokenized, the minimum text length is 1 character, and the maximum text length is 65536 characters. */
text: string;
/** An optional parameter to provide the model name. This will ensure that the tokenization uses the tokenizer used by that model. */
model?: string;
model: string;
}
24 changes: 12 additions & 12 deletions src/api/resources/connectors/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ export class Connectors {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.9.0",
"X-Fern-SDK-Version": "7.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
contentType: "application/json",
queryParameters: _queryParams,
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000,
maxRetries: requestOptions?.maxRetries,
});
if (_response.ok) {
Expand Down Expand Up @@ -143,13 +143,13 @@ export class Connectors {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.9.0",
"X-Fern-SDK-Version": "7.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
contentType: "application/json",
body: await serializers.CreateConnectorRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000,
maxRetries: requestOptions?.maxRetries,
});
if (_response.ok) {
Expand Down Expand Up @@ -220,12 +220,12 @@ export class Connectors {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.9.0",
"X-Fern-SDK-Version": "7.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000,
maxRetries: requestOptions?.maxRetries,
});
if (_response.ok) {
Expand Down Expand Up @@ -300,12 +300,12 @@ export class Connectors {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.9.0",
"X-Fern-SDK-Version": "7.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000,
maxRetries: requestOptions?.maxRetries,
});
if (_response.ok) {
Expand Down Expand Up @@ -383,13 +383,13 @@ export class Connectors {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.9.0",
"X-Fern-SDK-Version": "7.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
contentType: "application/json",
body: await serializers.UpdateConnectorRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000,
maxRetries: requestOptions?.maxRetries,
});
if (_response.ok) {
Expand Down Expand Up @@ -472,13 +472,13 @@ export class Connectors {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.9.0",
"X-Fern-SDK-Version": "7.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
contentType: "application/json",
queryParameters: _queryParams,
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000,
maxRetries: requestOptions?.maxRetries,
});
if (_response.ok) {
Expand Down
Loading

0 comments on commit 5188b11

Please sign in to comment.