Skip to content

Commit

Permalink
SDK regeneration
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Jan 19, 2024
1 parent c7d0298 commit 4b3951c
Show file tree
Hide file tree
Showing 30 changed files with 272 additions and 302 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.7.3",
"version": "7.7.4",
"private": false,
"repository": "https://github.com/cohere-ai/cohere-typescript",
"main": "./index.js",
Expand Down
177 changes: 78 additions & 99 deletions src/Client.ts

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions src/api/client/requests/ChatRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@

import * as Cohere from "../..";

/**
* @example
* {
* message: "string",
* stream: false,
* chatHistory: [{
* role: Cohere.ChatMessageRole.Chatbot,
* message: "string"
* }],
* promptTruncation: Cohere.ChatRequestPromptTruncation.Off,
* connectors: [{
* id: "string"
* }],
* citationQuality: Cohere.ChatRequestCitationQuality.Fast
* }
*/
export interface ChatRequest {
/**
* Accepts a string.
Expand Down
9 changes: 9 additions & 0 deletions src/api/client/requests/ClassifyRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@

import * as Cohere from "../..";

/**
* @example
* {
* inputs: [],
* examples: [{}],
* preset: "my-preset-a58sbd",
* truncate: Cohere.ClassifyRequestTruncate.None
* }
*/
export interface ClassifyRequest {
/**
* A list of up to 96 texts to be classified. Each one must be a non-empty string.
Expand Down
16 changes: 0 additions & 16 deletions src/api/client/requests/DetectLanguageRequest.ts

This file was deleted.

6 changes: 6 additions & 0 deletions src/api/client/requests/DetokenizeRequest.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
* {
* tokens: []
* }
*/
export interface DetokenizeRequest {
/** The list of tokens to be detokenized. */
tokens: number[];
Expand Down
12 changes: 12 additions & 0 deletions src/api/client/requests/GenerateRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@

import * as Cohere from "../..";

/**
* @example
* {
* prompt: "Please explain to me how LLMs work",
* stream: false,
* truncate: Cohere.GenerateRequestTruncate.None,
* preset: "my-preset-a58sbd",
* returnLikelihoods: Cohere.GenerateRequestReturnLikelihoods.Generation
* }
*/
export interface GenerateRequest {
/**
* The input text that serves as the starting point for generating the response.
Expand Down Expand Up @@ -89,4 +99,6 @@ export interface GenerateRequest {
* Note: logit bias may not be supported for all custom models.
*/
logitBias?: Record<string, number>;
/** When enabled, the user's prompt will be sent to the model without any pre-processing. */
rawPrompting?: boolean;
}
2 changes: 2 additions & 0 deletions src/api/client/requests/GenerateStreamRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,6 @@ export interface GenerateStreamRequest {
* Note: logit bias may not be supported for all custom models.
*/
logitBias?: Record<string, number>;
/** When enabled, the user's prompt will be sent to the model without any pre-processing. */
rawPrompting?: boolean;
}
7 changes: 7 additions & 0 deletions src/api/client/requests/RerankRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@

import * as Cohere from "../..";

/**
* @example
* {
* query: "string",
* documents: []
* }
*/
export interface RerankRequest {
/** The identifier of the model to use, one of : `rerank-english-v2.0`, `rerank-multilingual-v2.0` */
model?: string;
Expand Down
9 changes: 9 additions & 0 deletions src/api/client/requests/SummarizeRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@

import * as Cohere from "../..";

/**
* @example
* {
* text: "string",
* length: Cohere.SummarizeRequestLength.Short,
* format: Cohere.SummarizeRequestFormat.Paragraph,
* extractiveness: Cohere.SummarizeRequestExtractiveness.Low
* }
*/
export interface SummarizeRequest {
/** The text to generate a summary for. Can be up to 100,000 characters long. Currently the only supported language is English. */
text: string;
Expand Down
6 changes: 6 additions & 0 deletions src/api/client/requests/TokenizeRequest.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
* {
* text: "string"
* }
*/
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;
Expand Down
1 change: 0 additions & 1 deletion src/api/client/requests/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export { GenerateRequest } from "./GenerateRequest";
export { EmbedRequest } from "./EmbedRequest";
export { RerankRequest } from "./RerankRequest";
export { ClassifyRequest } from "./ClassifyRequest";
export { DetectLanguageRequest } from "./DetectLanguageRequest";
export { SummarizeRequest } from "./SummarizeRequest";
export { TokenizeRequest } from "./TokenizeRequest";
export { DetokenizeRequest } from "./DetokenizeRequest";
51 changes: 37 additions & 14 deletions src/api/resources/connectors/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class Connectors {
const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.CohereEnvironment.Production,
"connectors"
"v1/connectors"
),
method: "GET",
headers: {
Expand All @@ -61,7 +61,7 @@ export class Connectors {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.7.3",
"X-Fern-SDK-Version": "7.7.4",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -112,6 +112,17 @@ export class Connectors {
* @throws {@link Cohere.BadRequestError}
* @throws {@link Cohere.ForbiddenError}
* @throws {@link Cohere.InternalServerError}
*
* @example
* await cohere.connectors.create({
* name: "string",
* url: "string",
* oauth: {},
* serviceAuth: {
* type: Cohere.AuthTokenType.Bearer,
* token: "string"
* }
* })
*/
public async create(
request: Cohere.CreateConnectorRequest,
Expand All @@ -120,7 +131,7 @@ export class Connectors {
const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.CohereEnvironment.Production,
"connectors"
"v1/connectors"
),
method: "POST",
headers: {
Expand All @@ -131,7 +142,7 @@ export class Connectors {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.7.3",
"X-Fern-SDK-Version": "7.7.4",
},
contentType: "application/json",
body: await serializers.CreateConnectorRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
Expand Down Expand Up @@ -184,12 +195,15 @@ export class Connectors {
* @throws {@link Cohere.BadRequestError}
* @throws {@link Cohere.NotFoundError}
* @throws {@link Cohere.InternalServerError}
*
* @example
* await cohere.connectors.get("string")
*/
public async get(id: string, requestOptions?: Connectors.RequestOptions): Promise<Cohere.GetConnectorResponse> {
const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.CohereEnvironment.Production,
`connectors/${id}`
`v1/connectors/${id}`
),
method: "GET",
headers: {
Expand All @@ -200,7 +214,7 @@ export class Connectors {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.7.3",
"X-Fern-SDK-Version": "7.7.4",
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
Expand Down Expand Up @@ -255,7 +269,7 @@ export class Connectors {
* @throws {@link Cohere.InternalServerError}
*
* @example
* await cohere.connectors.delete("id")
* await cohere.connectors.delete("string")
*/
public async delete(
id: string,
Expand All @@ -264,7 +278,7 @@ export class Connectors {
const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.CohereEnvironment.Production,
`connectors/${id}`
`v1/connectors/${id}`
),
method: "DELETE",
headers: {
Expand All @@ -275,7 +289,7 @@ export class Connectors {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.7.3",
"X-Fern-SDK-Version": "7.7.4",
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
Expand Down Expand Up @@ -330,6 +344,15 @@ export class Connectors {
* @throws {@link Cohere.ForbiddenError}
* @throws {@link Cohere.NotFoundError}
* @throws {@link Cohere.InternalServerError}
*
* @example
* await cohere.connectors.update("string", {
* oauth: {},
* serviceAuth: {
* type: Cohere.AuthTokenType.Bearer,
* token: "string"
* }
* })
*/
public async update(
id: string,
Expand All @@ -339,7 +362,7 @@ export class Connectors {
const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.CohereEnvironment.Production,
`connectors/${id}`
`v1/connectors/${id}`
),
method: "PATCH",
headers: {
Expand All @@ -350,7 +373,7 @@ export class Connectors {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.7.3",
"X-Fern-SDK-Version": "7.7.4",
},
contentType: "application/json",
body: await serializers.UpdateConnectorRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
Expand Down Expand Up @@ -407,7 +430,7 @@ export class Connectors {
* @throws {@link Cohere.InternalServerError}
*
* @example
* await cohere.connectors.oAuthAuthorize("id", {})
* await cohere.connectors.oAuthAuthorize("string", {})
*/
public async oAuthAuthorize(
id: string,
Expand All @@ -423,7 +446,7 @@ export class Connectors {
const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.CohereEnvironment.Production,
`connectors/${id}/oauth/authorize`
`v1/connectors/${id}/oauth/authorize`
),
method: "POST",
headers: {
Expand All @@ -434,7 +457,7 @@ export class Connectors {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.7.3",
"X-Fern-SDK-Version": "7.7.4",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@

import * as Cohere from "../../../..";

/**
* @example
* {
* name: "string",
* url: "string",
* oauth: {},
* serviceAuth: {
* type: Cohere.AuthTokenType.Bearer,
* token: "string"
* }
* }
*/
export interface CreateConnectorRequest {
/** A human-readable name for the connector. */
name: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@

import * as Cohere from "../../../..";

/**
* @example
* {
* oauth: {},
* serviceAuth: {
* type: Cohere.AuthTokenType.Bearer,
* token: "string"
* }
* }
*/
export interface UpdateConnectorRequest {
/** A human-readable name for the connector. */
name?: string;
Expand Down
Loading

0 comments on commit 4b3951c

Please sign in to comment.