Skip to content

Commit

Permalink
Merge pull request #123 from cohere-ai/fern-bot/01-30-2024-0120PM
Browse files Browse the repository at this point in the history
🌿 Fern Regeneration -- January 30, 2024
  • Loading branch information
billytrend-cohere authored Jan 30, 2024
2 parents c7d0298 + e227fca commit 086ec84
Show file tree
Hide file tree
Showing 47 changed files with 524 additions and 278 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
179 changes: 80 additions & 99 deletions src/Client.ts

Large diffs are not rendered by default.

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

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,
* searchOptions: {},
* promptOverride: {}
* }
*/
export interface ChatRequest {
/**
* Accepts a string.
Expand Down Expand Up @@ -79,6 +97,15 @@ export interface ChatRequest {
*
* A non-negative float that tunes the degree of randomness in generation. Lower temperatures mean less random generations, and higher temperatures mean more random generations.
*
* Randomness can be further maximized by increasing the value of the `p` parameter.
*
*/
temperature?: number;
/**
* Used to reduce repetitiveness of generated tokens. The higher the value, the stronger a penalty is applied to previously present tokens, proportional to how many times they have already appeared in the prompt or prior generation.
*
*/
frequencyPenalty?: number;
/** Defaults to `0.0`, min value of `0.0`, max value of `1.0`. Can be used to reduce repetitiveness of generated tokens. Similar to `frequency_penalty`, except that this penalty is applied equally to all tokens that have already appeared, regardless of their exact frequencies. */
presencePenalty?: number;
}
9 changes: 9 additions & 0 deletions src/api/client/requests/ChatStreamRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,15 @@ export interface ChatStreamRequest {
*
* A non-negative float that tunes the degree of randomness in generation. Lower temperatures mean less random generations, and higher temperatures mean more random generations.
*
* Randomness can be further maximized by increasing the value of the `p` parameter.
*
*/
temperature?: number;
/**
* Used to reduce repetitiveness of generated tokens. The higher the value, the stronger a penalty is applied to previously present tokens, proportional to how many times they have already appeared in the prompt or prior generation.
*
*/
frequencyPenalty?: number;
/** Defaults to `0.0`, min value of `0.0`, max value of `1.0`. Can be used to reduce repetitiveness of generated tokens. Similar to `frequency_penalty`, except that this penalty is applied equally to all tokens that have already appeared, regardless of their exact frequencies. */
presencePenalty?: number;
}
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
29 changes: 25 additions & 4 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 @@ -67,11 +77,20 @@ export interface GenerateRequest {
*/
p?: number;
/**
* Used to reduce repetitiveness of generated tokens. The higher the value, the stronger a penalty is applied to previously present tokens, proportional to how many times they have already appeared in the prompt or prior generation.'
* Used to reduce repetitiveness of generated tokens. The higher the value, the stronger a penalty is applied to previously present tokens, proportional to how many times they have already appeared in the prompt or prior generation.
*
* Using `frequency_penalty` in combination with `presence_penalty` is not supported on newer models.
*
*/
frequencyPenalty?: number;
/** Defaults to `0.0`, min value of `0.0`, max value of `1.0`. Can be used to reduce repetitiveness of generated tokens. Similar to `frequency_penalty`, except that this penalty is applied equally to all tokens that have already appeared, regardless of their exact frequencies. */
/**
* Defaults to `0.0`, min value of `0.0`, max value of `1.0`.
*
* Can be used to reduce repetitiveness of generated tokens. Similar to `frequency_penalty`, except that this penalty is applied equally to all tokens that have already appeared, regardless of their exact frequencies.
*
* Using `frequency_penalty` in combination with `presence_penalty` is not supported on newer models.
*
*/
presencePenalty?: number;
/**
* One of `GENERATION|ALL|NONE` to specify how and if the token likelihoods are returned with the response. Defaults to `NONE`.
Expand All @@ -82,11 +101,13 @@ export interface GenerateRequest {
*/
returnLikelihoods?: Cohere.GenerateRequestReturnLikelihoods;
/**
* Certain models support the `logit_bias` parameter.
*
* Used to prevent the model from generating unwanted tokens or to incentivize it to include desired tokens. The format is `{token_id: bias}` where bias is a float between -10 and 10. Tokens can be obtained from text using [Tokenize](/reference/tokenize).
*
* For example, if the value `{'11': -10}` is provided, the model will be very unlikely to include the token 11 (`"\n"`, the newline character) anywhere in the generated text. In contrast `{'11': 10}` will result in generations that nearly only contain that token. Values between -10 and 10 will proportionally affect the likelihood of the token appearing in the generated text.
*
* 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;
}
19 changes: 15 additions & 4 deletions src/api/client/requests/GenerateStreamRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,20 @@ export interface GenerateStreamRequest {
*/
p?: number;
/**
* Used to reduce repetitiveness of generated tokens. The higher the value, the stronger a penalty is applied to previously present tokens, proportional to how many times they have already appeared in the prompt or prior generation.'
* Used to reduce repetitiveness of generated tokens. The higher the value, the stronger a penalty is applied to previously present tokens, proportional to how many times they have already appeared in the prompt or prior generation.
*
* Using `frequency_penalty` in combination with `presence_penalty` is not supported on newer models.
*
*/
frequencyPenalty?: number;
/** Defaults to `0.0`, min value of `0.0`, max value of `1.0`. Can be used to reduce repetitiveness of generated tokens. Similar to `frequency_penalty`, except that this penalty is applied equally to all tokens that have already appeared, regardless of their exact frequencies. */
/**
* Defaults to `0.0`, min value of `0.0`, max value of `1.0`.
*
* Can be used to reduce repetitiveness of generated tokens. Similar to `frequency_penalty`, except that this penalty is applied equally to all tokens that have already appeared, regardless of their exact frequencies.
*
* Using `frequency_penalty` in combination with `presence_penalty` is not supported on newer models.
*
*/
presencePenalty?: number;
/**
* One of `GENERATION|ALL|NONE` to specify how and if the token likelihoods are returned with the response. Defaults to `NONE`.
Expand All @@ -82,11 +91,13 @@ export interface GenerateStreamRequest {
*/
returnLikelihoods?: Cohere.GenerateStreamRequestReturnLikelihoods;
/**
* Certain models support the `logit_bias` parameter.
*
* Used to prevent the model from generating unwanted tokens or to incentivize it to include desired tokens. The format is `{token_id: bias}` where bias is a float between -10 and 10. Tokens can be obtained from text using [Tokenize](/reference/tokenize).
*
* For example, if the value `{'11': -10}` is provided, the model will be very unlikely to include the token 11 (`"\n"`, the newline character) anywhere in the generated text. In contrast `{'11': 10}` will result in generations that nearly only contain that token. Values between -10 and 10 will proportionally affect the likelihood of the token appearing in the generated text.
*
* 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";
Loading

0 comments on commit 086ec84

Please sign in to comment.