From b89924a3f90e2bfe915ddb8175a739d6652ee4ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Dvo=C5=99=C3=A1k?= Date: Tue, 28 May 2024 15:50:48 +0200 Subject: [PATCH] feat: schema updates (#104) --- README.md | 2 +- examples/langchain/llm-chat.ts | 2 +- examples/langchain/llm.ts | 11 +- examples/shared/constants.ts | 2 +- src/api/schema.d.ts | 7961 ++++++++++++-------- src/langchain/llm-chat.ts | 4 +- src/langchain/llm.ts | 5 +- src/services/FileService.ts | 6 +- src/services/PromptService.ts | 6 +- src/services/RequestService.ts | 2 +- src/services/text/TextChatService.ts | 4 +- src/services/text/TextEmbeddingService.ts | 2 +- src/services/text/TextGenerationService.ts | 4 +- tests/e2e/client.test.ts | 4 +- tests/e2e/langchain/llm-chat.test.ts | 2 +- 15 files changed, 5048 insertions(+), 2969 deletions(-) diff --git a/README.md b/README.md index b790c0e..b01b0a8 100644 --- a/README.md +++ b/README.md @@ -203,7 +203,7 @@ import { GenAIChatModel } from '@ibm-generative-ai/node-sdk/langchain'; import { SystemMessage, HumanMessage } from '@langchain/core/messages'; const client = new GenAIChatModel({ - model_id: 'meta-llama/llama-2-70b-chat', + model_id: 'meta-llama/llama-3-70b-instruct', client: new Client({ endpoint: process.env.ENDPOINT, apiKey: process.env.API_KEY, diff --git a/examples/langchain/llm-chat.ts b/examples/langchain/llm-chat.ts index 130db81..795acf8 100644 --- a/examples/langchain/llm-chat.ts +++ b/examples/langchain/llm-chat.ts @@ -5,7 +5,7 @@ import { Client } from '../../src/index.js'; const makeClient = () => new GenAIChatModel({ - model_id: 'meta-llama/llama-2-70b-chat', + model_id: 'meta-llama/llama-3-70b-instruct', client: new Client({ endpoint: process.env.ENDPOINT, apiKey: process.env.API_KEY, diff --git a/examples/langchain/llm.ts b/examples/langchain/llm.ts index 00594ee..b39b783 100644 --- a/examples/langchain/llm.ts +++ b/examples/langchain/llm.ts @@ -15,7 +15,16 @@ const makeClient = () => repetition_penalty: 1.5, }, moderations: { - hap: true, + hap: { + input: { + enabled: true, + threshold: 0.75, + }, + output: { + enabled: true, + threshold: 0.75, + }, + }, }, }); diff --git a/examples/shared/constants.ts b/examples/shared/constants.ts index 7184bfc..b336f0d 100644 --- a/examples/shared/constants.ts +++ b/examples/shared/constants.ts @@ -1,2 +1,2 @@ export const MODEL = 'google/flan-ul2'; -export const CHAT_MODEL = 'meta-llama/llama-2-70b-chat'; +export const CHAT_MODEL = 'meta-llama/llama-3-70b-instruct'; diff --git a/src/api/schema.d.ts b/src/api/schema.d.ts index 791cc17..9573d43 100644 --- a/src/api/schema.d.ts +++ b/src/api/schema.d.ts @@ -5,15 +5,11 @@ export interface paths { - "/v2/text/generation/{id}/feedback": { - /** - * @deprecated - * @description Use `/requests/:id/feedback` - */ + "/v2/files/{id}": { get: { parameters: { query: { - version: "2023-11-22"; + version: "2024-05-13"; }; path: { id: string; @@ -25,16 +21,33 @@ export interface paths { content: { "application/json": { result: { - id: number; + id: string; + bytes: number; + file_name: string; + /** @enum {string} */ + storage_provider_location: "us-south" | "us-east"; + /** @enum {string} */ + purpose: "tune" | "template" | "tune_import" | "extraction" | "generic_structured"; /** Format: date-time */ created_at: string; /** Format: date-time */ updated_at: string; - comment?: string | null; - categories: string[]; - api_request: string; - /** @enum {string|null} */ - vote?: "up" | "down" | null; + file_formats?: { + id: number; + name: string; + }[]; + origin?: { + id: string; + }; + descendants?: { + id: string; + }[]; + metadata?: { + stats: { + columns: string[]; + records_count: number; + }; + }; }; }; }; @@ -77,48 +90,19 @@ export interface paths { }; }; }; - /** - * @deprecated - * @description Use `/requests/:id/feedback` - */ - put: { + delete: { parameters: { query: { - version: "2024-02-20"; + version: "2023-11-22"; }; path: { id: string; }; }; - requestBody?: { - content: { - "application/json": { - comment?: string; - categories?: ("inaccurate" | "not_relevant" | "offensive_harmful" | "knowledge_gap" | "other_content" | "too_long" | "too_short" | "wrong_tone" | "wrong_format" | "other_style" | "correct_content" | "correct_style")[]; - /** @enum {string} */ - vote?: "up" | "down"; - }; - }; - }; responses: { - /** @description Default Response */ - 200: { - content: { - "application/json": { - result: { - id: number; - /** Format: date-time */ - created_at: string; - /** Format: date-time */ - updated_at: string; - comment?: string | null; - categories: string[]; - api_request: string; - /** @enum {string|null} */ - vote?: "up" | "down" | null; - }; - }; - }; + /** @description Success */ + 204: { + content: never; }; /** @description Server could not understand the request due to invalid syntax. In most cases relates with the schema validation. */ 400: { @@ -158,26 +142,20 @@ export interface paths { }; }; }; - /** - * @deprecated - * @description Use `/requests/:id/feedback` - */ - post: { + patch: { parameters: { query: { - version: "2024-02-20"; + version: "2023-11-22"; }; path: { id: string; }; }; - requestBody?: { + requestBody: { content: { - "application/json": { - comment?: string; - categories?: ("inaccurate" | "not_relevant" | "offensive_harmful" | "knowledge_gap" | "other_content" | "too_long" | "too_short" | "wrong_tone" | "wrong_format" | "other_style" | "correct_content" | "correct_style")[]; - /** @enum {string} */ - vote?: "up" | "down"; + "multipart/form-data": { + /** Format: binary */ + file: Blob; }; }; }; @@ -187,16 +165,33 @@ export interface paths { content: { "application/json": { result: { - id: number; + id: string; + bytes: number; + file_name: string; + /** @enum {string} */ + storage_provider_location: "us-south" | "us-east"; + /** @enum {string} */ + purpose: "tune" | "template" | "tune_import" | "extraction" | "generic_structured"; /** Format: date-time */ created_at: string; /** Format: date-time */ updated_at: string; - comment?: string | null; - categories: string[]; - api_request: string; - /** @enum {string|null} */ - vote?: "up" | "down" | null; + file_formats?: { + id: number; + name: string; + }[]; + origin?: { + id: string; + }; + descendants?: { + id: string; + }[]; + metadata?: { + stats: { + columns: string[]; + records_count: number; + }; + }; }; }; }; @@ -240,11 +235,18 @@ export interface paths { }; }; }; - "/v2/tuning_types": { + "/v2/files": { get: { parameters: { query: { - version: "2024-01-30"; + limit?: number; + offset?: number; + sort_by?: "name" | "created_at"; + direction?: "asc" | "desc"; + search?: string; + purpose?: "tune" | "template" | "tune_import" | "extraction" | "generic_structured"; + format_id?: number; + version: "2024-05-13"; }; }; responses: { @@ -252,15 +254,36 @@ export interface paths { 200: { content: { "application/json": { - results: { - id?: string; - name?: string; - /** @description JSON Schema */ - schema?: { - [key: string]: unknown; + results: ({ + id: string; + bytes: number; + file_name: string; + /** @enum {string} */ + storage_provider_location: "us-south" | "us-east"; + /** @enum {string} */ + purpose: "tune" | "template" | "tune_import" | "extraction" | "generic_structured"; + /** Format: date-time */ + created_at: string; + /** Format: date-time */ + updated_at: string; + file_formats?: { + id: number; + name: string; + }[]; + origin?: { + id: string; }; - model_ids?: string[]; - }[]; + descendants?: { + id: string; + }[]; + metadata?: { + stats: { + columns: string[]; + records_count: number; + }; + }; + })[]; + total_count: number; }; }; }; @@ -296,15 +319,21 @@ export interface paths { }; }; }; - }; - "/v2/models/{id}": { - get: { + post: { parameters: { query: { - version: "2024-01-30"; + version: "2024-05-13"; }; - path: { - id: string; + }; + requestBody: { + content: { + "multipart/form-data": { + /** @enum {string} */ + purpose: "tune" | "template" | "tune_import" | "extraction" | "generic_structured"; + /** Format: binary */ + file: Blob; + origin_id?: string; + }; }; }; responses: { @@ -313,43 +342,33 @@ export interface paths { content: { "application/json": { result: { - tasks: { - id: string; + id: string; + bytes: number; + file_name: string; + /** @enum {string} */ + storage_provider_location: "us-south" | "us-east"; + /** @enum {string} */ + purpose: "tune" | "template" | "tune_import" | "extraction" | "generic_structured"; + /** Format: date-time */ + created_at: string; + /** Format: date-time */ + updated_at: string; + file_formats?: { + id: number; name: string; - json_example?: string; - jsonl_example?: string; - csv_example?: string; - verbalizer?: string; - file_format_id?: number; - tune: boolean; - categorization: boolean; }[]; - model_family: { - id: number; - name: string; - system_prompt?: string; - prompt_example?: string; - short_description?: string; - description?: string; + origin?: { + id: string; }; - system_prompt?: string; - id: string; - name: string; - developer?: string; - size: string; - label: string; - disabled: boolean; - preferred: boolean; - warning?: string; - description?: string; - tags: string[]; - source_model_id?: string | null; - is_live: boolean; - token_limits: { - beam_width: number; - token_limit: number; + descendants?: { + id: string; }[]; - system_prompt_id?: number; + metadata?: { + stats: { + columns: string[]; + records_count: number; + }; + }; }; }; }; @@ -393,27 +412,22 @@ export interface paths { }; }; }; - "/v2/text/tokenization": { + "/v2/text/embeddings": { post: { parameters: { query: { - version: "2024-01-10"; + version: "2024-04-15"; }; }; - requestBody?: { + requestBody: { content: { "application/json": { - model_id?: string; - prompt_id?: string; - input?: string | string[]; - data?: { - example_file_ids?: string[]; - [key: string]: unknown; - }; + model_id: string; + input: string | string[]; parameters?: ({ + truncate_input_tokens?: boolean | null; return_options?: { input_text?: boolean | null; - tokens?: boolean | null; }; }) | null; }; @@ -425,12 +439,12 @@ export interface paths { content: { "application/json": { model_id: string; + /** Format: date-time */ created_at: string; - results: ({ - token_count: number; - tokens?: string[]; - input_text?: string | null; - })[]; + results: { + embedding: number[]; + input_text?: string; + }[]; }; }; }; @@ -467,24 +481,128 @@ export interface paths { }; }; }; - "/v2/text/generation_stream": { + "/v2/text/moderations": { post: { parameters: { query: { - version: "2024-01-10"; + version: "2024-03-19"; }; }; - requestBody?: { + requestBody: { content: { "application/json": { - data?: { - example_file_ids?: string[]; - [key: string]: unknown; + input: string; + hap?: { + /** @default 0.75 */ + threshold?: number; + /** @default false */ + send_tokens?: boolean; }; - /** - * Input string - * @description The input is the prompt to generate completions, passed as a string. Note: The method tokenizes the input internally. It is recommended not to leave any trailing spaces. - */ + social_bias?: { + /** @default 0.75 */ + threshold?: number; + /** @default false */ + send_tokens?: boolean; + }; + }; + }; + }; + responses: { + /** @description Default Response */ + 200: { + content: { + "application/json": { + results: { + hap?: { + success: boolean; + score: number; + flagged: boolean; + position: { + start: number; + end: number; + }; + tokens?: { + token?: string; + index?: number; + score?: number; + }[]; + }[]; + social_bias?: { + success: boolean; + score: number; + flagged: boolean; + position: { + start: number; + end: number; + }; + tokens?: { + token?: string; + index?: number; + score?: number; + }[]; + }[]; + }[]; + }; + }; + }; + /** @description Server could not understand the request due to invalid syntax. In most cases relates with the schema validation. */ + 400: { + content: { + "application/json": components["schemas"]["BadRequestResponse"]; + }; + }; + /** @description Unauthorized route access. */ + 401: { + content: { + "application/json": components["schemas"]["UnauthorizedResponse"]; + }; + }; + /** @description The server can not find requested resource. */ + 404: { + content: { + "application/json": components["schemas"]["NotFoundResponse"]; + }; + }; + /** @description The user has sent too many requests in a given amount of time ("rate limiting").. */ + 429: { + content: { + "application/json": components["schemas"]["TooManyRequestsResponse"]; + }; + }; + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + content: { + "application/json": components["schemas"]["InternalServerErrorResponse"]; + }; + }; + /** @description The remote server is not ready to handle the request. */ + 503: { + content: { + "application/json": components["schemas"]["UnavailableResponse"]; + }; + }; + }; + }; + }; + "/v2/text/generation_stream": { + post: { + parameters: { + query: { + version: "2024-03-19"; + }; + }; + requestBody?: { + content: { + "application/json": { + data?: { + example_file_ids?: string[]; + [key: string]: unknown; + }; + /** + * Input string + * @description The input is the prompt to generate completions, passed as a string. Note: The method tokenizes the input internally. It is recommended not to leave any trailing spaces. + * @example How are you + */ input?: string; /** * Model ID @@ -596,6 +714,7 @@ export interface paths { /** * Stop sequences * @description Stop sequences are one or more strings which will cause the text generation to stop if/when they are produced as part of the output. Stop sequences encountered prior to the minimum number of tokens being generated will be ignored. + * @example [" and "] */ stop_sequences?: string[] | null; /** @@ -617,50 +736,65 @@ export interface paths { truncate_input_tokens?: number | null; }) | null; moderations?: { - hap?: boolean | { - /** - * @description Detects HAP (hateful, abusive, or profane language). Please see documentation for more info (API Reference -> Moderations -> HAP). - * @default true - */ - input?: boolean; - output?: boolean; - /** - * @description The higher the number, the more confidence that the sentence contains HAP. The threshold allows you to modify how much confidence is needed for the sentence to be flagged as containing HAP. - * @default 0.75 - */ - threshold?: number; - /** @default false */ - send_tokens?: boolean; - }; - stigma?: boolean | { - /** - * @description Detects Stigma. - * @default true - */ - input?: boolean; - output?: boolean; - /** - * @description The higher the number, the more confidence that the sentence contains Stigma. The threshold allows you to modify how much confidence is needed for the sentence to be flagged as containing Stigma. - * @default 0.75 - */ - threshold?: number; - /** @default false */ - send_tokens?: boolean; + hap?: { + input?: { + /** + * @description Detects HAP (hateful, abusive, or profane language). + * @default false + */ + enabled: boolean; + /** + * @description The higher the number, the more confidence that the sentence contains HAP. The threshold allows you to modify how much confidence is needed for the sentence to be flagged as containing HAP. + * @default 0.75 + */ + threshold?: number; + /** @default false */ + send_tokens?: boolean; + }; + output?: { + /** + * @description Detects HAP (hateful, abusive, or profane language). + * @default false + */ + enabled: boolean; + /** + * @description The higher the number, the more confidence that the sentence contains HAP. The threshold allows you to modify how much confidence is needed for the sentence to be flagged as containing HAP. + * @default 0.75 + */ + threshold?: number; + /** @default false */ + send_tokens?: boolean; + }; }; - implicit_hate?: boolean | { - /** - * @description Detects implicit hate. - * @default true - */ - input?: boolean; - output?: boolean; - /** - * @description The higher the number, the more confidence that the sentence contains implicit hate. The threshold allows you to modify how much confidence is needed for the sentence to be flagged as containing implicit hate. - * @default 0.75 - */ - threshold?: number; - /** @default false */ - send_tokens?: boolean; + social_bias?: { + input?: { + /** + * @description Detects social bias. + * @default false + */ + enabled: boolean; + /** + * @description The higher the number, the more confidence that the sentence contains social bias. The threshold allows you to modify how much confidence is needed for the sentence to be flagged as containing social bias. + * @default 0.75 + */ + threshold?: number; + /** @default false */ + send_tokens?: boolean; + }; + output?: { + /** + * @description Detects social bias. + * @default false + */ + enabled: boolean; + /** + * @description The higher the number, the more confidence that the sentence contains social bias. The threshold allows you to modify how much confidence is needed for the sentence to be flagged as containing social bias. + * @default 0.75 + */ + threshold?: number; + /** @default false */ + send_tokens?: boolean; + }; }; }; }; @@ -707,7 +841,7 @@ export interface paths { seed?: number | null; [key: string]: unknown; })[]; - moderation?: { + moderations?: { hap?: { success: boolean; score: number; @@ -722,21 +856,7 @@ export interface paths { score?: number; }[]; }[]; - stigma?: { - success: boolean; - score: number; - flagged: boolean; - position: { - start: number; - end: number; - }; - tokens?: { - token?: string; - index?: number; - score?: number; - }[]; - }[]; - implicit_hate?: { + social_bias?: { success: boolean; score: number; flagged: boolean; @@ -787,202 +907,84 @@ export interface paths { }; }; }; - "/v2/text/generation": { + "/v2/text/generation/output": { post: { parameters: { query: { - version: "2024-01-10"; + version: "2024-03-19"; }; }; requestBody?: { content: { "application/json": { + model_id?: string; + prompt_id?: string; + input?: string; data?: { example_file_ids?: string[]; [key: string]: unknown; }; - /** - * Input string - * @description The input is the prompt to generate completions, passed as a string. Note: The method tokenizes the input internally. It is recommended not to leave any trailing spaces. - */ - input?: string; - /** - * Model ID - * @description The ID of the model or tune to be used for this request. - */ - model_id?: string; - /** Saved prompt Id */ - prompt_id?: string; parameters?: ({ - /** - * Top K - * @description Set the number of highest probability vocabulary tokens to keep for top-k-filtering. Lower values make it less likely the model will go off topic. - */ - top_k?: number | null; - /** - * Top P (nucleus sampling) - * @description If < 1.0, only the smallest set of most probable tokens with probabilities that add up to `top_p` or higher are used. - */ - top_p?: number | null; - /** - * Typical P - * @description Local typicality measures how similar the conditional probability of predicting a target token next is to the expected conditional probability of predicting a random token next, given the partial text already generated. If set to float < 1, the smallest set of the most locally typical tokens with probabilities that add up to typical_p or higher are kept for generation. 1.00 means a neutral value. - */ - typical_p?: number | null; - /** - * Beam width - * @description At each step, or token, the algorithm keeps track of the n (off=1, 2, or 3) most probable sequences (beams) and selects the one with the highest probability. This continues until the stop sequence is met. - */ beam_width?: number | null; - /** - * Time limit - * @description Time limit in milliseconds - if not completed within this time, generation will stop. The text generated so far will be returned along with the `TIME_LIMIT` stop reason. - */ - time_limit?: number | null; - /** - * Random seed - * @description Controls the random sampling of the generated tokens when sampling is enabled. Setting the random seed to a the same number for each generation ensures experimental repeatability. - */ - random_seed?: number | null; - /** - * Temperature - * @description Control the creativity of generated text. Higher values will lead to more randomly generated outputs. - */ - temperature?: number | null; - /** - * Length penalty - * @description Can be used to exponentially increase the likelihood of the text generation terminating once a specified number of tokens have been generated. - */ - length_penalty?: ({ - /** - * Start index - * @description A number of generated tokens after which this should take effect. - */ - start_index?: number | null; - /** - * Decay factor - * @description Represents the factor of exponential decay and must be > 1.0. Larger values correspond to more aggressive decay. - */ - decay_factor?: number | null; - }) | null; - /** - * Max new tokens - * @description Define the maximum number of tokens to generate. - */ + /** @enum {string|null} */ + decoding_method?: "greedy" | "sample" | null; max_new_tokens?: number | null; - /** - * Min new tokens - * @description If stop sequences are given, they are ignored until minimum tokens are generated. - */ min_new_tokens?: number | null; + random_seed?: number | null; + stop_sequences?: string[] | null; + temperature?: number | null; + time_limit?: number | null; + top_k?: number | null; + top_p?: number | null; + typical_p?: number | null; + repetition_penalty?: number | null; + truncate_input_tokens?: number | null; + include_stop_sequence?: boolean; return_options?: ({ - /** - * Input text - * @description Include input text - * @default false - */ + generated_tokens?: boolean | null; input_text?: boolean | null; - /** - * Token ranks - * @description Include rank of each returned token - * @default false - */ - token_ranks?: boolean | null; - /** - * Input Tokens - * @description Include list of input tokens - * @default false - */ input_tokens?: boolean | null; - /** - * Top N tokens - * @description Include top n candidate tokens at the position of each returned token - */ - top_n_tokens?: number | null; - /** - * Token logprobs - * @description Include logprob for each returned token - * @default false - */ + input_parameters?: boolean | null; token_logprobs?: boolean | null; - /** - * Generated Tokens - * @description Include list of individual generated tokens - * @default false - */ - generated_tokens?: boolean | null; - input_parameters?: boolean | null; + token_ranks?: boolean | null; + top_n_tokens?: number | null; + }) | null; + length_penalty?: ({ + decay_factor?: number | null; + start_index?: number | null; }) | null; - /** - * Stop sequences - * @description Stop sequences are one or more strings which will cause the text generation to stop if/when they are produced as part of the output. Stop sequences encountered prior to the minimum number of tokens being generated will be ignored. - */ - stop_sequences?: string[] | null; - /** - * Decoding method - * @description Decoding method used for generation. - * @enum {string|null} - */ - decoding_method?: "greedy" | "sample" | null; - /** - * Repetition penalty - * @description The parameter for repetition penalty. 1.00 means no penalty. - */ - repetition_penalty?: number | null; - include_stop_sequence?: boolean; - /** - * Truncate input tokens - * @description Truncate to this many input tokens. Can be used to avoid requests failing due to input being longer than configured limits. Zero means don't truncate. - */ - truncate_input_tokens?: number | null; }) | null; moderations?: { - hap?: boolean | { - /** - * @description Detects HAP (hateful, abusive, or profane language). Please see documentation for more info (API Reference -> Moderations -> HAP). - * @default true - */ - input?: boolean; - output?: boolean; - /** - * @description The higher the number, the more confidence that the sentence contains HAP. The threshold allows you to modify how much confidence is needed for the sentence to be flagged as containing HAP. - * @default 0.75 - */ - threshold?: number; - /** @default false */ - send_tokens?: boolean; - }; - stigma?: boolean | { - /** - * @description Detects Stigma. - * @default true - */ - input?: boolean; - output?: boolean; - /** - * @description The higher the number, the more confidence that the sentence contains Stigma. The threshold allows you to modify how much confidence is needed for the sentence to be flagged as containing Stigma. - * @default 0.75 - */ - threshold?: number; - /** @default false */ - send_tokens?: boolean; + hap?: { + input?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + output?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; }; - implicit_hate?: boolean | { - /** - * @description Detects implicit hate. - * @default true - */ - input?: boolean; - output?: boolean; - /** - * @description The higher the number, the more confidence that the sentence contains implicit hate. The threshold allows you to modify how much confidence is needed for the sentence to be flagged as containing implicit hate. - * @default 0.75 - */ - threshold?: number; - /** @default false */ - send_tokens?: boolean; + social_bias?: { + input?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + output?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; }; }; + use_default?: boolean | null; }; }; }; @@ -991,45 +993,7 @@ export interface paths { 200: { content: { "application/json": { - id: string | null; - model_id: string; - /** Format: date-time */ - created_at: string; - input_parameters?: { - [key: string]: unknown; - } | null; - results: ({ - input_text?: string | null; - generated_text: string; - generated_token_count: number; - input_token_count?: number | null; - /** @enum {string} */ - stop_reason: "not_finished" | "max_tokens" | "eos_token" | "cancelled" | "time_limit" | "stop_sequence" | "token_limit" | "error"; - stop_sequence?: string | null; - generated_tokens?: (({ - text?: string | null; - logprob?: (number | null) | (string | null); - rank?: number | null; - top_tokens?: (({ - text?: string | null; - logprob?: (number | null) | (string | null); - })[]) | null; - })[]) | null; - input_tokens?: (({ - text?: string | null; - logprob?: (number | null) | (string | null); - rank?: number | null; - top_tokens?: (({ - text?: string | null; - logprob?: (number | null) | (string | null); - })[]) | null; - })[]) | null; - seed?: number | null; - moderation?: { - [key: string]: unknown; - } | null; - [key: string]: unknown; - })[]; + results: string[]; }; }; }; @@ -1051,6 +1015,12 @@ export interface paths { "application/json": components["schemas"]["NotFoundResponse"]; }; }; + /** @description The user has sent too many requests in a given amount of time ("rate limiting").. */ + 429: { + content: { + "application/json": components["schemas"]["TooManyRequestsResponse"]; + }; + }; /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ 500: { content: { @@ -1066,80 +1036,96 @@ export interface paths { }; }; }; - "/v2/text/chat_stream": { + "/v2/text/generation/comparison": { post: { parameters: { query: { - version: "2024-01-10"; + version: "2024-03-19"; }; }; - requestBody?: { + requestBody: { content: { "application/json": { - model_id?: string; - prompt_template_id?: string | null; - moderations?: { - hap?: boolean | { - input?: boolean; - output?: boolean; - threshold?: number; - send_tokens?: boolean; - }; - stigma?: boolean | { - input?: boolean; - output?: boolean; - threshold?: number; - send_tokens?: boolean; + request: { + model_id?: string; + prompt_id?: string; + input: string; + data?: { + example_file_ids?: string[]; + [key: string]: unknown; }; - implicit_hate?: boolean | { - input?: boolean; - output?: boolean; - threshold?: number; - send_tokens?: boolean; + parameters?: ({ + beam_width?: number | null; + /** @enum {string|null} */ + decoding_method?: "greedy" | "sample" | null; + max_new_tokens?: number | null; + min_new_tokens?: number | null; + random_seed?: number | null; + stop_sequences?: string[] | null; + temperature?: number | null; + time_limit?: number | null; + top_k?: number | null; + top_p?: number | null; + typical_p?: number | null; + repetition_penalty?: number | null; + truncate_input_tokens?: number | null; + include_stop_sequence?: boolean; + return_options?: ({ + generated_tokens?: boolean | null; + input_text?: boolean | null; + input_tokens?: boolean | null; + input_parameters?: boolean | null; + token_logprobs?: boolean | null; + token_ranks?: boolean | null; + top_n_tokens?: number | null; + }) | null; + length_penalty?: ({ + decay_factor?: number | null; + start_index?: number | null; + }) | null; + }) | null; + moderations?: { + hap?: { + input?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + output?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + }; + social_bias?: { + input?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + output?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + }; }; + use_default?: boolean | null; + }; + name?: string; + compare_parameters: { + model_id?: string[]; + temperature?: number[]; + top_k?: number[]; + top_p?: number[]; + typical_p?: number[]; + repetition_penalty?: number[]; + length_penalty?: Record[]; }; - messages?: ({ - /** @enum {string} */ - role: "user" | "system" | "assistant"; - content: string; - file_ids?: string[]; - })[]; - conversation_id?: string | null; - parent_id?: string | null; - prompt_id?: string; - /** @enum {string} */ - trim_method?: "floating_window" | "none"; - use_conversation_parameters?: boolean; - parameters?: ({ - beam_width?: number | null; - /** @enum {string|null} */ - decoding_method?: "greedy" | "sample" | null; - max_new_tokens?: number | null; - min_new_tokens?: number | null; - random_seed?: number | null; - stop_sequences?: string[] | null; - temperature?: number | null; - time_limit?: number | null; - top_k?: number | null; - top_p?: number | null; - typical_p?: number | null; - repetition_penalty?: number | null; - truncate_input_tokens?: number | null; - include_stop_sequence?: boolean; - return_options?: ({ - generated_tokens?: boolean | null; - input_text?: boolean | null; - input_tokens?: boolean | null; - input_parameters?: boolean | null; - token_logprobs?: boolean | null; - token_ranks?: boolean | null; - top_n_tokens?: number | null; - }) | null; - length_penalty?: ({ - decay_factor?: number | null; - start_index?: number | null; - }) | null; - }) | null; }; }; }; @@ -1147,88 +1133,2689 @@ export interface paths { /** @description Default Response */ 200: { content: { - "text/event-stream": { - id?: string | null; - model_id?: string; - /** Format: date-time */ - created_at?: string; - input_parameters?: { - [key: string]: unknown; - } | null; - results?: ({ - input_text?: string | null; - generated_text: string; - generated_token_count: number; - input_token_count?: number | null; - /** @enum {string} */ - stop_reason: "not_finished" | "max_tokens" | "eos_token" | "cancelled" | "time_limit" | "stop_sequence" | "token_limit" | "error"; - stop_sequence?: string | null; - generated_tokens?: (({ - text?: string | null; - logprob?: (number | null) | (string | null); - rank?: number | null; - top_tokens?: (({ - text?: string | null; - logprob?: (number | null) | (string | null); - })[]) | null; - })[]) | null; - input_tokens?: (({ - text?: string | null; - logprob?: (number | null) | (string | null); - rank?: number | null; - top_tokens?: (({ - text?: string | null; - logprob?: (number | null) | (string | null); - })[]) | null; - })[]) | null; - seed?: number | null; - [key: string]: unknown; - })[]; - moderation?: { - hap?: { - success: boolean; - score: number; - flagged: boolean; - position: { - start: number; - end: number; - }; - tokens?: { - token?: string; - index?: number; - score?: number; - }[]; - }[]; - stigma?: { - success: boolean; - score: number; - flagged: boolean; - position: { - start: number; - end: number; + "application/json": { + results: ({ + parameters: { + model_id?: string; + temperature?: number; + top_k?: number; + top_p?: number; + typical_p?: number; + repetition_penalty?: number; + length_penalty?: Record; + }; + error?: (({ + status_code: number; + message?: string; + extensions?: { + code?: string; + reason?: string; }; - tokens?: { - token?: string; - index?: number; - score?: number; - }[]; - }[]; - implicit_hate?: { - success: boolean; - score: number; - flagged: boolean; - position: { - start: number; - end: number; + } | null) | ({ + status_code: number; + extensions?: { + code?: string; + reason?: string; }; - tokens?: { - token?: string; - index?: number; - score?: number; - }[]; + } | null)) | null; + result?: ({ + id: string | null; + model_id: string; + /** Format: date-time */ + created_at: string; + input_parameters?: { + [key: string]: unknown; + } | null; + results: ({ + input_text?: string | null; + generated_text: string; + generated_token_count: number; + input_token_count?: number | null; + /** @enum {string} */ + stop_reason: "not_finished" | "max_tokens" | "eos_token" | "cancelled" | "time_limit" | "stop_sequence" | "token_limit" | "error"; + stop_sequence?: string | null; + generated_tokens?: (({ + text?: string | null; + logprob?: (number | null) | (string | null); + rank?: number | null; + top_tokens?: (({ + text?: string | null; + logprob?: (number | null) | (string | null); + })[]) | null; + })[]) | null; + input_tokens?: (({ + text?: string | null; + logprob?: (number | null) | (string | null); + rank?: number | null; + top_tokens?: (({ + text?: string | null; + logprob?: (number | null) | (string | null); + })[]) | null; + })[]) | null; + seed?: number | null; + moderations?: { + hap?: { + success: boolean; + score: number; + flagged: boolean; + position: { + start: number; + end: number; + }; + tokens?: { + token?: string; + index?: number; + score?: number; + }[]; + }[]; + social_bias?: { + success: boolean; + score: number; + flagged: boolean; + position: { + start: number; + end: number; + }; + tokens?: { + token?: string; + index?: number; + score?: number; + }[]; + }[]; + }; + [key: string]: unknown; + })[]; + }) | null; + })[]; + }; + }; + }; + /** @description Server could not understand the request due to invalid syntax. In most cases relates with the schema validation. */ + 400: { + content: { + "application/json": components["schemas"]["BadRequestResponse"]; + }; + }; + /** @description Unauthorized route access. */ + 401: { + content: { + "application/json": components["schemas"]["UnauthorizedResponse"]; + }; + }; + /** @description The server can not find requested resource. */ + 404: { + content: { + "application/json": components["schemas"]["NotFoundResponse"]; + }; + }; + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + content: { + "application/json": components["schemas"]["InternalServerErrorResponse"]; + }; + }; + /** @description The remote server is not ready to handle the request. */ + 503: { + content: { + "application/json": components["schemas"]["UnavailableResponse"]; + }; + }; + }; + }; + }; + "/v2/text/generation": { + post: { + parameters: { + query: { + version: "2024-03-19"; + }; + }; + requestBody?: { + content: { + "application/json": { + data?: { + example_file_ids?: string[]; + [key: string]: unknown; + }; + /** + * Input string + * @description The input is the prompt to generate completions, passed as a string. Note: The method tokenizes the input internally. It is recommended not to leave any trailing spaces. + * @example How are you + */ + input?: string; + /** + * Model ID + * @description The ID of the model or tune to be used for this request. + */ + model_id?: string; + /** Saved prompt Id */ + prompt_id?: string; + parameters?: ({ + /** + * Top K + * @description Set the number of highest probability vocabulary tokens to keep for top-k-filtering. Lower values make it less likely the model will go off topic. + */ + top_k?: number | null; + /** + * Top P (nucleus sampling) + * @description If < 1.0, only the smallest set of most probable tokens with probabilities that add up to `top_p` or higher are used. + */ + top_p?: number | null; + /** + * Typical P + * @description Local typicality measures how similar the conditional probability of predicting a target token next is to the expected conditional probability of predicting a random token next, given the partial text already generated. If set to float < 1, the smallest set of the most locally typical tokens with probabilities that add up to typical_p or higher are kept for generation. 1.00 means a neutral value. + */ + typical_p?: number | null; + /** + * Beam width + * @description At each step, or token, the algorithm keeps track of the n (off=1, 2, or 3) most probable sequences (beams) and selects the one with the highest probability. This continues until the stop sequence is met. + */ + beam_width?: number | null; + /** + * Time limit + * @description Time limit in milliseconds - if not completed within this time, generation will stop. The text generated so far will be returned along with the `TIME_LIMIT` stop reason. + */ + time_limit?: number | null; + /** + * Random seed + * @description Controls the random sampling of the generated tokens when sampling is enabled. Setting the random seed to a the same number for each generation ensures experimental repeatability. + */ + random_seed?: number | null; + /** + * Temperature + * @description Control the creativity of generated text. Higher values will lead to more randomly generated outputs. + */ + temperature?: number | null; + /** + * Length penalty + * @description Can be used to exponentially increase the likelihood of the text generation terminating once a specified number of tokens have been generated. + */ + length_penalty?: ({ + /** + * Start index + * @description A number of generated tokens after which this should take effect. + */ + start_index?: number | null; + /** + * Decay factor + * @description Represents the factor of exponential decay and must be > 1.0. Larger values correspond to more aggressive decay. + */ + decay_factor?: number | null; + }) | null; + /** + * Max new tokens + * @description Define the maximum number of tokens to generate. + */ + max_new_tokens?: number | null; + /** + * Min new tokens + * @description If stop sequences are given, they are ignored until minimum tokens are generated. + */ + min_new_tokens?: number | null; + return_options?: ({ + /** + * Input text + * @description Include input text + * @default false + */ + input_text?: boolean | null; + /** + * Token ranks + * @description Include rank of each returned token + * @default false + */ + token_ranks?: boolean | null; + /** + * Input Tokens + * @description Include list of input tokens + * @default false + */ + input_tokens?: boolean | null; + /** + * Top N tokens + * @description Include top n candidate tokens at the position of each returned token + */ + top_n_tokens?: number | null; + /** + * Token logprobs + * @description Include logprob for each returned token + * @default false + */ + token_logprobs?: boolean | null; + /** + * Generated Tokens + * @description Include list of individual generated tokens + * @default false + */ + generated_tokens?: boolean | null; + input_parameters?: boolean | null; + }) | null; + /** + * Stop sequences + * @description Stop sequences are one or more strings which will cause the text generation to stop if/when they are produced as part of the output. Stop sequences encountered prior to the minimum number of tokens being generated will be ignored. + * @example [" and "] + */ + stop_sequences?: string[] | null; + /** + * Decoding method + * @description Decoding method used for generation. + * @enum {string|null} + */ + decoding_method?: "greedy" | "sample" | null; + /** + * Repetition penalty + * @description The parameter for repetition penalty. 1.00 means no penalty. + */ + repetition_penalty?: number | null; + include_stop_sequence?: boolean; + /** + * Truncate input tokens + * @description Truncate to this many input tokens. Can be used to avoid requests failing due to input being longer than configured limits. Zero means don't truncate. + */ + truncate_input_tokens?: number | null; + }) | null; + moderations?: { + hap?: { + input?: { + /** + * @description Detects HAP (hateful, abusive, or profane language). + * @default false + */ + enabled: boolean; + /** + * @description The higher the number, the more confidence that the sentence contains HAP. The threshold allows you to modify how much confidence is needed for the sentence to be flagged as containing HAP. + * @default 0.75 + */ + threshold?: number; + /** @default false */ + send_tokens?: boolean; + }; + output?: { + /** + * @description Detects HAP (hateful, abusive, or profane language). + * @default false + */ + enabled: boolean; + /** + * @description The higher the number, the more confidence that the sentence contains HAP. The threshold allows you to modify how much confidence is needed for the sentence to be flagged as containing HAP. + * @default 0.75 + */ + threshold?: number; + /** @default false */ + send_tokens?: boolean; + }; + }; + social_bias?: { + input?: { + /** + * @description Detects social bias. + * @default false + */ + enabled: boolean; + /** + * @description The higher the number, the more confidence that the sentence contains social bias. The threshold allows you to modify how much confidence is needed for the sentence to be flagged as containing social bias. + * @default 0.75 + */ + threshold?: number; + /** @default false */ + send_tokens?: boolean; + }; + output?: { + /** + * @description Detects social bias. + * @default false + */ + enabled: boolean; + /** + * @description The higher the number, the more confidence that the sentence contains social bias. The threshold allows you to modify how much confidence is needed for the sentence to be flagged as containing social bias. + * @default 0.75 + */ + threshold?: number; + /** @default false */ + send_tokens?: boolean; + }; + }; + }; + }; + }; + }; + responses: { + /** @description Default Response */ + 200: { + content: { + "application/json": { + id: string | null; + model_id: string; + /** Format: date-time */ + created_at: string; + input_parameters?: { + [key: string]: unknown; + } | null; + results: ({ + input_text?: string | null; + generated_text: string; + generated_token_count: number; + input_token_count?: number | null; + /** @enum {string} */ + stop_reason: "not_finished" | "max_tokens" | "eos_token" | "cancelled" | "time_limit" | "stop_sequence" | "token_limit" | "error"; + stop_sequence?: string | null; + generated_tokens?: (({ + text?: string | null; + logprob?: (number | null) | (string | null); + rank?: number | null; + top_tokens?: (({ + text?: string | null; + logprob?: (number | null) | (string | null); + })[]) | null; + })[]) | null; + input_tokens?: (({ + text?: string | null; + logprob?: (number | null) | (string | null); + rank?: number | null; + top_tokens?: (({ + text?: string | null; + logprob?: (number | null) | (string | null); + })[]) | null; + })[]) | null; + seed?: number | null; + moderations?: { + hap?: { + success: boolean; + score: number; + flagged: boolean; + position: { + start: number; + end: number; + }; + tokens?: { + token?: string; + index?: number; + score?: number; + }[]; + }[]; + social_bias?: { + success: boolean; + score: number; + flagged: boolean; + position: { + start: number; + end: number; + }; + tokens?: { + token?: string; + index?: number; + score?: number; + }[]; + }[]; + }; + [key: string]: unknown; + })[]; + }; + }; + }; + /** @description Server could not understand the request due to invalid syntax. In most cases relates with the schema validation. */ + 400: { + content: { + "application/json": components["schemas"]["BadRequestResponse"]; + }; + }; + /** @description Unauthorized route access. */ + 401: { + content: { + "application/json": components["schemas"]["UnauthorizedResponse"]; + }; + }; + /** @description The server can not find requested resource. */ + 404: { + content: { + "application/json": components["schemas"]["NotFoundResponse"]; + }; + }; + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + content: { + "application/json": components["schemas"]["InternalServerErrorResponse"]; + }; + }; + /** @description The remote server is not ready to handle the request. */ + 503: { + content: { + "application/json": components["schemas"]["UnavailableResponse"]; + }; + }; + }; + }; + }; + "/v2/text/chat_stream": { + post: { + parameters: { + query: { + version: "2024-03-19"; + }; + }; + requestBody?: { + content: { + "application/json": { + model_id?: string; + prompt_template_id?: string | null; + moderations?: { + hap?: { + input?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + output?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + }; + social_bias?: { + input?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + output?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + }; + }; + messages?: ({ + /** @enum {string} */ + role: "user" | "system" | "assistant"; + content: string; + files?: { + id?: string; + content?: string; + }[]; + })[]; + conversation_id?: string | null; + parent_id?: string | null; + prompt_id?: string; + /** @enum {string} */ + trim_method?: "floating_window" | "none"; + use_conversation_parameters?: boolean; + parameters?: ({ + beam_width?: number | null; + /** @enum {string|null} */ + decoding_method?: "greedy" | "sample" | null; + max_new_tokens?: number | null; + min_new_tokens?: number | null; + random_seed?: number | null; + stop_sequences?: string[] | null; + temperature?: number | null; + time_limit?: number | null; + top_k?: number | null; + top_p?: number | null; + typical_p?: number | null; + repetition_penalty?: number | null; + truncate_input_tokens?: number | null; + include_stop_sequence?: boolean; + return_options?: ({ + generated_tokens?: boolean | null; + input_text?: boolean | null; + input_tokens?: boolean | null; + input_parameters?: boolean | null; + token_logprobs?: boolean | null; + token_ranks?: boolean | null; + top_n_tokens?: number | null; + }) | null; + length_penalty?: ({ + decay_factor?: number | null; + start_index?: number | null; + }) | null; + }) | null; + }; + }; + }; + responses: { + /** @description Default Response */ + 200: { + content: { + "text/event-stream": { + id?: string | null; + model_id?: string; + /** Format: date-time */ + created_at?: string; + input_parameters?: { + [key: string]: unknown; + } | null; + results?: ({ + input_text?: string | null; + generated_text: string; + generated_token_count: number; + input_token_count?: number | null; + /** @enum {string} */ + stop_reason: "not_finished" | "max_tokens" | "eos_token" | "cancelled" | "time_limit" | "stop_sequence" | "token_limit" | "error"; + stop_sequence?: string | null; + generated_tokens?: (({ + text?: string | null; + logprob?: (number | null) | (string | null); + rank?: number | null; + top_tokens?: (({ + text?: string | null; + logprob?: (number | null) | (string | null); + })[]) | null; + })[]) | null; + input_tokens?: (({ + text?: string | null; + logprob?: (number | null) | (string | null); + rank?: number | null; + top_tokens?: (({ + text?: string | null; + logprob?: (number | null) | (string | null); + })[]) | null; + })[]) | null; + seed?: number | null; + [key: string]: unknown; + })[]; + moderations?: { + hap?: { + success: boolean; + score: number; + flagged: boolean; + position: { + start: number; + end: number; + }; + tokens?: { + token?: string; + index?: number; + score?: number; + }[]; + }[]; + social_bias?: { + success: boolean; + score: number; + flagged: boolean; + position: { + start: number; + end: number; + }; + tokens?: { + token?: string; + index?: number; + score?: number; + }[]; + }[]; + }; + conversation_id: string; + }; + }; + }; + /** @description Server could not understand the request due to invalid syntax. In most cases relates with the schema validation. */ + 400: { + content: { + "application/json": components["schemas"]["BadRequestResponse"]; + }; + }; + /** @description Unauthorized route access. */ + 401: { + content: { + "application/json": components["schemas"]["UnauthorizedResponse"]; + }; + }; + /** @description The server can not find requested resource. */ + 404: { + content: { + "application/json": components["schemas"]["NotFoundResponse"]; + }; + }; + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + content: { + "application/json": components["schemas"]["InternalServerErrorResponse"]; + }; + }; + /** @description The remote server is not ready to handle the request. */ + 503: { + content: { + "application/json": components["schemas"]["UnavailableResponse"]; + }; + }; + }; + }; + }; + "/v2/text/chat/output": { + post: { + parameters: { + query: { + version: "2024-03-19"; + }; + }; + requestBody?: { + content: { + "application/json": { + model_id?: string; + prompt_template_id?: string | null; + moderations?: { + hap?: { + input?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + output?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + }; + social_bias?: { + input?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + output?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + }; + }; + messages?: ({ + /** @enum {string} */ + role: "user" | "system" | "assistant"; + content: string; + files?: { + id?: string; + content?: string; + }[]; + })[]; + conversation_id?: string | null; + parent_id?: string | null; + prompt_id?: string; + /** @enum {string} */ + trim_method?: "floating_window" | "none"; + use_conversation_parameters?: boolean; + parameters?: ({ + beam_width?: number | null; + /** @enum {string|null} */ + decoding_method?: "greedy" | "sample" | null; + max_new_tokens?: number | null; + min_new_tokens?: number | null; + random_seed?: number | null; + stop_sequences?: string[] | null; + temperature?: number | null; + time_limit?: number | null; + top_k?: number | null; + top_p?: number | null; + typical_p?: number | null; + repetition_penalty?: number | null; + truncate_input_tokens?: number | null; + include_stop_sequence?: boolean; + return_options?: ({ + generated_tokens?: boolean | null; + input_text?: boolean | null; + input_tokens?: boolean | null; + input_parameters?: boolean | null; + token_logprobs?: boolean | null; + token_ranks?: boolean | null; + top_n_tokens?: number | null; + }) | null; + length_penalty?: ({ + decay_factor?: number | null; + start_index?: number | null; + }) | null; + }) | null; + }; + }; + }; + responses: { + /** @description Default Response */ + 200: { + content: { + "application/json": { + result: string; + }; + }; + }; + /** @description Server could not understand the request due to invalid syntax. In most cases relates with the schema validation. */ + 400: { + content: { + "application/json": components["schemas"]["BadRequestResponse"]; + }; + }; + /** @description Unauthorized route access. */ + 401: { + content: { + "application/json": components["schemas"]["UnauthorizedResponse"]; + }; + }; + /** @description The server can not find requested resource. */ + 404: { + content: { + "application/json": components["schemas"]["NotFoundResponse"]; + }; + }; + /** @description The user has sent too many requests in a given amount of time ("rate limiting").. */ + 429: { + content: { + "application/json": components["schemas"]["TooManyRequestsResponse"]; + }; + }; + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + content: { + "application/json": components["schemas"]["InternalServerErrorResponse"]; + }; + }; + /** @description The remote server is not ready to handle the request. */ + 503: { + content: { + "application/json": components["schemas"]["UnavailableResponse"]; + }; + }; + }; + }; + }; + "/v2/text/chat": { + post: { + parameters: { + query: { + version: "2024-03-19"; + }; + }; + requestBody?: { + content: { + "application/json": { + model_id?: string; + prompt_template_id?: string | null; + moderations?: { + hap?: { + input?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + output?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + }; + social_bias?: { + input?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + output?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + }; + }; + messages?: ({ + /** @enum {string} */ + role: "user" | "system" | "assistant"; + content: string; + files?: { + id?: string; + content?: string; + }[]; + })[]; + conversation_id?: string | null; + parent_id?: string | null; + prompt_id?: string; + /** @enum {string} */ + trim_method?: "floating_window" | "none"; + use_conversation_parameters?: boolean; + parameters?: ({ + beam_width?: number | null; + /** @enum {string|null} */ + decoding_method?: "greedy" | "sample" | null; + max_new_tokens?: number | null; + min_new_tokens?: number | null; + random_seed?: number | null; + stop_sequences?: string[] | null; + temperature?: number | null; + time_limit?: number | null; + top_k?: number | null; + top_p?: number | null; + typical_p?: number | null; + repetition_penalty?: number | null; + truncate_input_tokens?: number | null; + include_stop_sequence?: boolean; + return_options?: ({ + generated_tokens?: boolean | null; + input_text?: boolean | null; + input_tokens?: boolean | null; + input_parameters?: boolean | null; + token_logprobs?: boolean | null; + token_ranks?: boolean | null; + top_n_tokens?: number | null; + }) | null; + length_penalty?: ({ + decay_factor?: number | null; + start_index?: number | null; + }) | null; + }) | null; + }; + }; + }; + responses: { + /** @description Default Response */ + 200: { + content: { + "application/json": { + id?: string | null; + model_id?: string; + /** Format: date-time */ + created_at?: string; + input_parameters?: { + [key: string]: unknown; + } | null; + results: ({ + input_text?: string | null; + generated_text: string; + generated_token_count: number; + input_token_count?: number | null; + /** @enum {string} */ + stop_reason: "not_finished" | "max_tokens" | "eos_token" | "cancelled" | "time_limit" | "stop_sequence" | "token_limit" | "error"; + stop_sequence?: string | null; + generated_tokens?: (({ + text?: string | null; + logprob?: (number | null) | (string | null); + rank?: number | null; + top_tokens?: (({ + text?: string | null; + logprob?: (number | null) | (string | null); + })[]) | null; + })[]) | null; + input_tokens?: (({ + text?: string | null; + logprob?: (number | null) | (string | null); + rank?: number | null; + top_tokens?: (({ + text?: string | null; + logprob?: (number | null) | (string | null); + })[]) | null; + })[]) | null; + seed?: number | null; + moderations?: { + hap?: { + success: boolean; + score: number; + flagged: boolean; + position: { + start: number; + end: number; + }; + tokens?: { + token?: string; + index?: number; + score?: number; + }[]; + }[]; + social_bias?: { + success: boolean; + score: number; + flagged: boolean; + position: { + start: number; + end: number; + }; + tokens?: { + token?: string; + index?: number; + score?: number; + }[]; + }[]; + }; + [key: string]: unknown; + })[]; + conversation_id: string; + }; + }; + }; + /** @description Server could not understand the request due to invalid syntax. In most cases relates with the schema validation. */ + 400: { + content: { + "application/json": components["schemas"]["BadRequestResponse"]; + }; + }; + /** @description Unauthorized route access. */ + 401: { + content: { + "application/json": components["schemas"]["UnauthorizedResponse"]; + }; + }; + /** @description The server can not find requested resource. */ + 404: { + content: { + "application/json": components["schemas"]["NotFoundResponse"]; + }; + }; + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + content: { + "application/json": components["schemas"]["InternalServerErrorResponse"]; + }; + }; + /** @description The remote server is not ready to handle the request. */ + 503: { + content: { + "application/json": components["schemas"]["UnavailableResponse"]; + }; + }; + }; + }; + }; + "/v2/requests/chat/{conversation_id}": { + get: { + parameters: { + query: { + version: "2024-03-19"; + }; + path: { + conversation_id: string; + }; + }; + responses: { + /** @description Default Response */ + 200: { + content: { + "application/json": { + results: ({ + id: string; + duration: number; + /** Format: date-time */ + created_at: string; + request: { + [key: string]: unknown; + } | null; + /** @enum {string} */ + status: "success" | "error"; + response: { + [key: string]: unknown; + } | null; + version?: ({ + api?: string | null; + /** Format: date */ + date?: string | null; + }) | null; + parent_id?: string | null; + [key: string]: unknown; + })[]; + }; + }; + }; + /** @description Server could not understand the request due to invalid syntax. In most cases relates with the schema validation. */ + 400: { + content: { + "application/json": components["schemas"]["BadRequestResponse"]; + }; + }; + /** @description Unauthorized route access. */ + 401: { + content: { + "application/json": components["schemas"]["UnauthorizedResponse"]; + }; + }; + /** @description The server can not find requested resource. */ + 404: { + content: { + "application/json": components["schemas"]["NotFoundResponse"]; + }; + }; + /** @description The user has sent too many requests in a given amount of time ("rate limiting").. */ + 429: { + content: { + "application/json": components["schemas"]["TooManyRequestsResponse"]; + }; + }; + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + content: { + "application/json": components["schemas"]["InternalServerErrorResponse"]; + }; + }; + /** @description The remote server is not ready to handle the request. */ + 503: { + content: { + "application/json": components["schemas"]["UnavailableResponse"]; + }; + }; + }; + }; + delete: { + parameters: { + query: { + version: "2023-11-22"; + }; + path: { + conversation_id: string; + }; + }; + responses: { + /** @description Success */ + 204: { + content: never; + }; + /** @description Server could not understand the request due to invalid syntax. In most cases relates with the schema validation. */ + 400: { + content: { + "application/json": components["schemas"]["BadRequestResponse"]; + }; + }; + /** @description Unauthorized route access. */ + 401: { + content: { + "application/json": components["schemas"]["UnauthorizedResponse"]; + }; + }; + /** @description The server can not find requested resource. */ + 404: { + content: { + "application/json": components["schemas"]["NotFoundResponse"]; + }; + }; + /** @description The user has sent too many requests in a given amount of time ("rate limiting").. */ + 429: { + content: { + "application/json": components["schemas"]["TooManyRequestsResponse"]; + }; + }; + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + content: { + "application/json": components["schemas"]["InternalServerErrorResponse"]; + }; + }; + /** @description The remote server is not ready to handle the request. */ + 503: { + content: { + "application/json": components["schemas"]["UnavailableResponse"]; + }; + }; + }; + }; + }; + "/v2/prompts/{id}": { + get: { + parameters: { + query: { + version: "2024-03-19"; + }; + path: { + id: string; + }; + }; + responses: { + /** @description Default Response */ + 200: { + content: { + "application/json": { + result: { + id: string; + name: string; + description?: string; + data?: Record; + input?: string; + output?: string; + model_id?: string; + parameters?: ({ + beam_width?: number | null; + /** @enum {string|null} */ + decoding_method?: "greedy" | "sample" | null; + max_new_tokens?: number | null; + min_new_tokens?: number | null; + random_seed?: number | null; + stop_sequences?: string[] | null; + temperature?: number | null; + time_limit?: number | null; + top_k?: number | null; + top_p?: number | null; + typical_p?: number | null; + repetition_penalty?: number | null; + truncate_input_tokens?: number | null; + include_stop_sequence?: boolean; + return_options?: ({ + generated_tokens?: boolean | null; + input_text?: boolean | null; + input_tokens?: boolean | null; + input_parameters?: boolean | null; + token_logprobs?: boolean | null; + token_ranks?: boolean | null; + top_n_tokens?: number | null; + }) | null; + length_penalty?: ({ + decay_factor?: number | null; + start_index?: number | null; + }) | null; + }) | null; + moderations?: { + hap?: { + input?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + output?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + }; + social_bias?: { + input?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + output?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + }; + stigma?: { + input?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + output?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + }; + implicit_hate?: { + input?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + output?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + }; + } | null; + /** Format: date-time */ + created_at: string; + /** Format: date-time */ + updated_at?: string; + /** @enum {string} */ + type: "private" | "public" | "community" | "example"; + public?: boolean; + prompt_id?: string | null; + metadata?: { + [key: string]: unknown; + }; + tags?: ({ + id: string; + name: string; + /** @enum {string} */ + type: "language" | "industry" | "model_type"; + })[]; + author?: { + id?: number; + first_name?: string; + last_name?: string; + }; + task?: { + id?: string; + name?: string; + icon?: string; + }; + messages?: (({ + /** @enum {string} */ + role: "user" | "system" | "assistant"; + content: string; + files?: { + id?: string; + content?: string; + }[]; + })[]) | null; + folder_id?: string | null; + usage_count: number; + }; + }; + }; + }; + /** @description Server could not understand the request due to invalid syntax. In most cases relates with the schema validation. */ + 400: { + content: { + "application/json": components["schemas"]["BadRequestResponse"]; + }; + }; + /** @description Unauthorized route access. */ + 401: { + content: { + "application/json": components["schemas"]["UnauthorizedResponse"]; + }; + }; + /** @description The server can not find requested resource. */ + 404: { + content: { + "application/json": components["schemas"]["NotFoundResponse"]; + }; + }; + /** @description The user has sent too many requests in a given amount of time ("rate limiting").. */ + 429: { + content: { + "application/json": components["schemas"]["TooManyRequestsResponse"]; + }; + }; + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + content: { + "application/json": components["schemas"]["InternalServerErrorResponse"]; + }; + }; + /** @description The remote server is not ready to handle the request. */ + 503: { + content: { + "application/json": components["schemas"]["UnavailableResponse"]; + }; + }; + }; + }; + put: { + parameters: { + query: { + version: "2024-03-19"; + }; + path: { + id: string; + }; + }; + requestBody: { + content: { + "application/json": { + name: string; + description?: string; + prompt_id?: string; + data?: { + example_file_ids?: string[]; + [key: string]: unknown; + }; + output?: string | null; + parameters?: ({ + beam_width?: number | null; + /** @enum {string|null} */ + decoding_method?: "greedy" | "sample" | null; + max_new_tokens?: number | null; + min_new_tokens?: number | null; + random_seed?: number | null; + stop_sequences?: string[] | null; + temperature?: number | null; + time_limit?: number | null; + top_k?: number | null; + top_p?: number | null; + typical_p?: number | null; + repetition_penalty?: number | null; + truncate_input_tokens?: number | null; + include_stop_sequence?: boolean; + return_options?: ({ + generated_tokens?: boolean | null; + input_text?: boolean | null; + input_tokens?: boolean | null; + input_parameters?: boolean | null; + token_logprobs?: boolean | null; + token_ranks?: boolean | null; + top_n_tokens?: number | null; + }) | null; + length_penalty?: ({ + decay_factor?: number | null; + start_index?: number | null; + }) | null; + }) | null; + moderations?: { + hap?: { + input?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + output?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + }; + social_bias?: { + input?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + output?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + }; + }; + model_id: string; + task_id?: string; + folder_id?: string | null; + industry_id?: string; + language_id?: string; + /** @enum {string} */ + type?: "private" | "public" | "community"; + input?: string; + messages?: (({ + /** @enum {string} */ + role: "user" | "system" | "assistant"; + content: string; + files?: { + id?: string; + content?: string; + }[]; + })[]) | null; + }; + }; + }; + responses: { + /** @description Default Response */ + 200: { + content: { + "application/json": { + result: { + id: string; + name: string; + description?: string; + data?: Record; + input?: string; + output?: string; + model_id?: string; + parameters?: ({ + beam_width?: number | null; + /** @enum {string|null} */ + decoding_method?: "greedy" | "sample" | null; + max_new_tokens?: number | null; + min_new_tokens?: number | null; + random_seed?: number | null; + stop_sequences?: string[] | null; + temperature?: number | null; + time_limit?: number | null; + top_k?: number | null; + top_p?: number | null; + typical_p?: number | null; + repetition_penalty?: number | null; + truncate_input_tokens?: number | null; + include_stop_sequence?: boolean; + return_options?: ({ + generated_tokens?: boolean | null; + input_text?: boolean | null; + input_tokens?: boolean | null; + input_parameters?: boolean | null; + token_logprobs?: boolean | null; + token_ranks?: boolean | null; + top_n_tokens?: number | null; + }) | null; + length_penalty?: ({ + decay_factor?: number | null; + start_index?: number | null; + }) | null; + }) | null; + moderations?: { + hap?: { + input?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + output?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + }; + social_bias?: { + input?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + output?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + }; + stigma?: { + input?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + output?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + }; + implicit_hate?: { + input?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + output?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + }; + } | null; + /** Format: date-time */ + created_at: string; + /** Format: date-time */ + updated_at?: string; + /** @enum {string} */ + type: "private" | "public" | "community" | "example"; + public?: boolean; + prompt_id?: string | null; + metadata?: { + [key: string]: unknown; + }; + tags?: ({ + id: string; + name: string; + /** @enum {string} */ + type: "language" | "industry" | "model_type"; + })[]; + author?: { + id?: number; + first_name?: string; + last_name?: string; + }; + task?: { + id?: string; + name?: string; + icon?: string; + }; + messages?: (({ + /** @enum {string} */ + role: "user" | "system" | "assistant"; + content: string; + files?: { + id?: string; + content?: string; + }[]; + })[]) | null; + folder_id?: string | null; + usage_count: number; + }; + }; + }; + }; + /** @description Server could not understand the request due to invalid syntax. In most cases relates with the schema validation. */ + 400: { + content: { + "application/json": components["schemas"]["BadRequestResponse"]; + }; + }; + /** @description Unauthorized route access. */ + 401: { + content: { + "application/json": components["schemas"]["UnauthorizedResponse"]; + }; + }; + /** @description The server can not find requested resource. */ + 404: { + content: { + "application/json": components["schemas"]["NotFoundResponse"]; + }; + }; + /** @description The user has sent too many requests in a given amount of time ("rate limiting").. */ + 429: { + content: { + "application/json": components["schemas"]["TooManyRequestsResponse"]; + }; + }; + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + content: { + "application/json": components["schemas"]["InternalServerErrorResponse"]; + }; + }; + /** @description The remote server is not ready to handle the request. */ + 503: { + content: { + "application/json": components["schemas"]["UnavailableResponse"]; + }; + }; + }; + }; + delete: { + parameters: { + query: { + version: "2023-11-22"; + }; + path: { + id: string; + }; + }; + responses: { + /** @description Success */ + 204: { + content: never; + }; + /** @description Server could not understand the request due to invalid syntax. In most cases relates with the schema validation. */ + 400: { + content: { + "application/json": components["schemas"]["BadRequestResponse"]; + }; + }; + /** @description Unauthorized route access. */ + 401: { + content: { + "application/json": components["schemas"]["UnauthorizedResponse"]; + }; + }; + /** @description The server can not find requested resource. */ + 404: { + content: { + "application/json": components["schemas"]["NotFoundResponse"]; + }; + }; + /** @description The user has sent too many requests in a given amount of time ("rate limiting").. */ + 429: { + content: { + "application/json": components["schemas"]["TooManyRequestsResponse"]; + }; + }; + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + content: { + "application/json": components["schemas"]["InternalServerErrorResponse"]; + }; + }; + /** @description The remote server is not ready to handle the request. */ + 503: { + content: { + "application/json": components["schemas"]["UnavailableResponse"]; + }; + }; + }; + }; + patch: { + parameters: { + query: { + version: "2024-03-19"; + }; + path: { + id: string; + }; + }; + requestBody?: { + content: { + "application/json": { + /** @enum {string} */ + type?: "private" | "public" | "community"; + folder_id?: string | null; + name?: string; + }; + }; + }; + responses: { + /** @description Default Response */ + 200: { + content: { + "application/json": { + result: { + id: string; + name: string; + description?: string; + data?: Record; + input?: string; + output?: string; + model_id?: string; + parameters?: ({ + beam_width?: number | null; + /** @enum {string|null} */ + decoding_method?: "greedy" | "sample" | null; + max_new_tokens?: number | null; + min_new_tokens?: number | null; + random_seed?: number | null; + stop_sequences?: string[] | null; + temperature?: number | null; + time_limit?: number | null; + top_k?: number | null; + top_p?: number | null; + typical_p?: number | null; + repetition_penalty?: number | null; + truncate_input_tokens?: number | null; + include_stop_sequence?: boolean; + return_options?: ({ + generated_tokens?: boolean | null; + input_text?: boolean | null; + input_tokens?: boolean | null; + input_parameters?: boolean | null; + token_logprobs?: boolean | null; + token_ranks?: boolean | null; + top_n_tokens?: number | null; + }) | null; + length_penalty?: ({ + decay_factor?: number | null; + start_index?: number | null; + }) | null; + }) | null; + moderations?: { + hap?: { + input?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + output?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + }; + social_bias?: { + input?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + output?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + }; + stigma?: { + input?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + output?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + }; + implicit_hate?: { + input?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + output?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + }; + } | null; + /** Format: date-time */ + created_at: string; + /** Format: date-time */ + updated_at?: string; + /** @enum {string} */ + type: "private" | "public" | "community" | "example"; + public?: boolean; + prompt_id?: string | null; + metadata?: { + [key: string]: unknown; + }; + tags?: ({ + id: string; + name: string; + /** @enum {string} */ + type: "language" | "industry" | "model_type"; + })[]; + author?: { + id?: number; + first_name?: string; + last_name?: string; + }; + task?: { + id?: string; + name?: string; + icon?: string; + }; + messages?: (({ + /** @enum {string} */ + role: "user" | "system" | "assistant"; + content: string; + files?: { + id?: string; + content?: string; + }[]; + })[]) | null; + folder_id?: string | null; + usage_count: number; + }; + }; + }; + }; + /** @description Server could not understand the request due to invalid syntax. In most cases relates with the schema validation. */ + 400: { + content: { + "application/json": components["schemas"]["BadRequestResponse"]; + }; + }; + /** @description Unauthorized route access. */ + 401: { + content: { + "application/json": components["schemas"]["UnauthorizedResponse"]; + }; + }; + /** @description The server can not find requested resource. */ + 404: { + content: { + "application/json": components["schemas"]["NotFoundResponse"]; + }; + }; + /** @description The user has sent too many requests in a given amount of time ("rate limiting").. */ + 429: { + content: { + "application/json": components["schemas"]["TooManyRequestsResponse"]; + }; + }; + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + content: { + "application/json": components["schemas"]["InternalServerErrorResponse"]; + }; + }; + /** @description The remote server is not ready to handle the request. */ + 503: { + content: { + "application/json": components["schemas"]["UnavailableResponse"]; + }; + }; + }; + }; + }; + "/v2/prompts": { + get: { + parameters: { + query: { + limit?: number; + offset?: number; + sort_by?: "type" | "model_task" | "updated_at" | "created_at" | "name" | "id" | "model" | "usage_count"; + direction?: "asc" | "desc"; + search?: string; + task_id?: string | string[]; + model_id?: string | string[]; + source?: ("user" | "example" | "community") | (("user" | "example" | "community")[]); + model_family_id?: number; + industry_id?: string | string[]; + prompt_language_id?: string | string[]; + model_type_id?: string | string[]; + avg_time_min?: number; + avg_time_max?: number; + context_window_min?: number; + context_window_max?: number; + folder_id?: string | null; + version: "2024-03-19"; + }; + }; + responses: { + /** @description Default Response */ + 200: { + content: { + "application/json": { + results: ({ + id: string; + name: string; + description?: string; + data?: Record; + input?: string; + output?: string; + model_id?: string; + parameters?: ({ + beam_width?: number | null; + /** @enum {string|null} */ + decoding_method?: "greedy" | "sample" | null; + max_new_tokens?: number | null; + min_new_tokens?: number | null; + random_seed?: number | null; + stop_sequences?: string[] | null; + temperature?: number | null; + time_limit?: number | null; + top_k?: number | null; + top_p?: number | null; + typical_p?: number | null; + repetition_penalty?: number | null; + truncate_input_tokens?: number | null; + include_stop_sequence?: boolean; + return_options?: ({ + generated_tokens?: boolean | null; + input_text?: boolean | null; + input_tokens?: boolean | null; + input_parameters?: boolean | null; + token_logprobs?: boolean | null; + token_ranks?: boolean | null; + top_n_tokens?: number | null; + }) | null; + length_penalty?: ({ + decay_factor?: number | null; + start_index?: number | null; + }) | null; + }) | null; + moderations?: { + hap?: { + input?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + output?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + }; + social_bias?: { + input?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + output?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + }; + stigma?: { + input?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + output?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + }; + implicit_hate?: { + input?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + output?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + }; + } | null; + /** Format: date-time */ + created_at: string; + /** Format: date-time */ + updated_at?: string; + /** @enum {string} */ + type: "private" | "public" | "community" | "example"; + public?: boolean; + prompt_id?: string | null; + metadata?: { + [key: string]: unknown; + }; + tags?: ({ + id: string; + name: string; + /** @enum {string} */ + type: "language" | "industry" | "model_type"; + })[]; + author?: { + id?: number; + first_name?: string; + last_name?: string; + }; + task?: { + id?: string; + name?: string; + icon?: string; + }; + messages?: (({ + /** @enum {string} */ + role: "user" | "system" | "assistant"; + content: string; + files?: { + id?: string; + content?: string; + }[]; + })[]) | null; + folder_id?: string | null; + usage_count: number; + })[]; + total_count: number; + }; + }; + }; + /** @description Server could not understand the request due to invalid syntax. In most cases relates with the schema validation. */ + 400: { + content: { + "application/json": components["schemas"]["BadRequestResponse"]; + }; + }; + /** @description Unauthorized route access. */ + 401: { + content: { + "application/json": components["schemas"]["UnauthorizedResponse"]; + }; + }; + /** @description The user has sent too many requests in a given amount of time ("rate limiting").. */ + 429: { + content: { + "application/json": components["schemas"]["TooManyRequestsResponse"]; + }; + }; + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + content: { + "application/json": components["schemas"]["InternalServerErrorResponse"]; + }; + }; + /** @description The remote server is not ready to handle the request. */ + 503: { + content: { + "application/json": components["schemas"]["UnavailableResponse"]; + }; + }; + }; + }; + post: { + parameters: { + query: { + version: "2024-03-19"; + }; + }; + requestBody: { + content: { + "application/json": { + name: string; + description?: string; + prompt_id?: string; + data?: { + example_file_ids?: string[]; + [key: string]: unknown; + }; + output?: string | null; + parameters?: ({ + beam_width?: number | null; + /** @enum {string|null} */ + decoding_method?: "greedy" | "sample" | null; + max_new_tokens?: number | null; + min_new_tokens?: number | null; + random_seed?: number | null; + stop_sequences?: string[] | null; + temperature?: number | null; + time_limit?: number | null; + top_k?: number | null; + top_p?: number | null; + typical_p?: number | null; + repetition_penalty?: number | null; + truncate_input_tokens?: number | null; + include_stop_sequence?: boolean; + return_options?: ({ + generated_tokens?: boolean | null; + input_text?: boolean | null; + input_tokens?: boolean | null; + input_parameters?: boolean | null; + token_logprobs?: boolean | null; + token_ranks?: boolean | null; + top_n_tokens?: number | null; + }) | null; + length_penalty?: ({ + decay_factor?: number | null; + start_index?: number | null; + }) | null; + }) | null; + moderations?: { + hap?: { + input?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + output?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + }; + social_bias?: { + input?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + output?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + }; + }; + model_id: string; + task_id?: string; + folder_id?: string | null; + industry_id?: string; + language_id?: string; + /** @enum {string} */ + type?: "private" | "public" | "community"; + input?: string; + messages?: (({ + /** @enum {string} */ + role: "user" | "system" | "assistant"; + content: string; + files?: { + id?: string; + content?: string; + }[]; + })[]) | null; + }; + }; + }; + responses: { + /** @description Default Response */ + 200: { + content: { + "application/json": { + result: { + id: string; + name: string; + description?: string; + data?: Record; + input?: string; + output?: string; + model_id?: string; + parameters?: ({ + beam_width?: number | null; + /** @enum {string|null} */ + decoding_method?: "greedy" | "sample" | null; + max_new_tokens?: number | null; + min_new_tokens?: number | null; + random_seed?: number | null; + stop_sequences?: string[] | null; + temperature?: number | null; + time_limit?: number | null; + top_k?: number | null; + top_p?: number | null; + typical_p?: number | null; + repetition_penalty?: number | null; + truncate_input_tokens?: number | null; + include_stop_sequence?: boolean; + return_options?: ({ + generated_tokens?: boolean | null; + input_text?: boolean | null; + input_tokens?: boolean | null; + input_parameters?: boolean | null; + token_logprobs?: boolean | null; + token_ranks?: boolean | null; + top_n_tokens?: number | null; + }) | null; + length_penalty?: ({ + decay_factor?: number | null; + start_index?: number | null; + }) | null; + }) | null; + moderations?: { + hap?: { + input?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + output?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + }; + social_bias?: { + input?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + output?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + }; + stigma?: { + input?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + output?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + }; + implicit_hate?: { + input?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + output?: { + /** @default 0.75 */ + threshold?: number; + send_tokens?: boolean; + enabled: boolean; + }; + }; + } | null; + /** Format: date-time */ + created_at: string; + /** Format: date-time */ + updated_at?: string; + /** @enum {string} */ + type: "private" | "public" | "community" | "example"; + public?: boolean; + prompt_id?: string | null; + metadata?: { + [key: string]: unknown; + }; + tags?: ({ + id: string; + name: string; + /** @enum {string} */ + type: "language" | "industry" | "model_type"; + })[]; + author?: { + id?: number; + first_name?: string; + last_name?: string; + }; + task?: { + id?: string; + name?: string; + icon?: string; + }; + messages?: (({ + /** @enum {string} */ + role: "user" | "system" | "assistant"; + content: string; + files?: { + id?: string; + content?: string; + }[]; + })[]) | null; + folder_id?: string | null; + usage_count: number; + }; + }; + }; + }; + /** @description Server could not understand the request due to invalid syntax. In most cases relates with the schema validation. */ + 400: { + content: { + "application/json": components["schemas"]["BadRequestResponse"]; + }; + }; + /** @description Unauthorized route access. */ + 401: { + content: { + "application/json": components["schemas"]["UnauthorizedResponse"]; + }; + }; + /** @description The server can not find requested resource. */ + 404: { + content: { + "application/json": components["schemas"]["NotFoundResponse"]; + }; + }; + /** @description The user has sent too many requests in a given amount of time ("rate limiting").. */ + 429: { + content: { + "application/json": components["schemas"]["TooManyRequestsResponse"]; + }; + }; + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + content: { + "application/json": components["schemas"]["InternalServerErrorResponse"]; + }; + }; + /** @description The remote server is not ready to handle the request. */ + 503: { + content: { + "application/json": components["schemas"]["UnavailableResponse"]; + }; + }; + }; + }; + }; + "/v2/text/generation/{id}/feedback": { + /** + * @deprecated + * @description Use `/requests/:id/feedback` + */ + get: { + parameters: { + query: { + version: "2023-11-22"; + }; + path: { + id: string; + }; + }; + responses: { + /** @description Default Response */ + 200: { + content: { + "application/json": { + result: { + id: number; + /** Format: date-time */ + created_at: string; + /** Format: date-time */ + updated_at: string; + comment?: string | null; + categories: string[]; + api_request: string; + /** @enum {string|null} */ + vote?: "up" | "down" | null; + contact_consent: boolean; + }; + }; + }; + }; + /** @description Server could not understand the request due to invalid syntax. In most cases relates with the schema validation. */ + 400: { + content: { + "application/json": components["schemas"]["BadRequestResponse"]; + }; + }; + /** @description Unauthorized route access. */ + 401: { + content: { + "application/json": components["schemas"]["UnauthorizedResponse"]; + }; + }; + /** @description The server can not find requested resource. */ + 404: { + content: { + "application/json": components["schemas"]["NotFoundResponse"]; + }; + }; + /** @description The user has sent too many requests in a given amount of time ("rate limiting").. */ + 429: { + content: { + "application/json": components["schemas"]["TooManyRequestsResponse"]; + }; + }; + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + content: { + "application/json": components["schemas"]["InternalServerErrorResponse"]; + }; + }; + /** @description The remote server is not ready to handle the request. */ + 503: { + content: { + "application/json": components["schemas"]["UnavailableResponse"]; + }; + }; + }; + }; + /** + * @deprecated + * @description Use `/requests/:id/feedback` + */ + put: { + parameters: { + query: { + version: "2024-02-20"; + }; + path: { + id: string; + }; + }; + requestBody: { + content: { + "application/json": { + comment?: string; + categories?: ("inaccurate" | "not_relevant" | "offensive_harmful" | "knowledge_gap" | "other_content" | "too_long" | "too_short" | "wrong_tone" | "wrong_format" | "other_style" | "correct_content" | "correct_style")[]; + /** @enum {string} */ + vote?: "up" | "down"; + /** @default false */ + contact_consent: boolean; + }; + }; + }; + responses: { + /** @description Default Response */ + 200: { + content: { + "application/json": { + result: { + id: number; + /** Format: date-time */ + created_at: string; + /** Format: date-time */ + updated_at: string; + comment?: string | null; + categories: string[]; + api_request: string; + /** @enum {string|null} */ + vote?: "up" | "down" | null; + contact_consent: boolean; + }; + }; + }; + }; + /** @description Server could not understand the request due to invalid syntax. In most cases relates with the schema validation. */ + 400: { + content: { + "application/json": components["schemas"]["BadRequestResponse"]; + }; + }; + /** @description Unauthorized route access. */ + 401: { + content: { + "application/json": components["schemas"]["UnauthorizedResponse"]; + }; + }; + /** @description The server can not find requested resource. */ + 404: { + content: { + "application/json": components["schemas"]["NotFoundResponse"]; + }; + }; + /** @description The user has sent too many requests in a given amount of time ("rate limiting").. */ + 429: { + content: { + "application/json": components["schemas"]["TooManyRequestsResponse"]; + }; + }; + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + content: { + "application/json": components["schemas"]["InternalServerErrorResponse"]; + }; + }; + /** @description The remote server is not ready to handle the request. */ + 503: { + content: { + "application/json": components["schemas"]["UnavailableResponse"]; + }; + }; + }; + }; + /** + * @deprecated + * @description Use `/requests/:id/feedback` + */ + post: { + parameters: { + query: { + version: "2024-02-20"; + }; + path: { + id: string; + }; + }; + requestBody: { + content: { + "application/json": { + comment?: string; + categories?: ("inaccurate" | "not_relevant" | "offensive_harmful" | "knowledge_gap" | "other_content" | "too_long" | "too_short" | "wrong_tone" | "wrong_format" | "other_style" | "correct_content" | "correct_style")[]; + /** @enum {string} */ + vote?: "up" | "down"; + /** @default false */ + contact_consent: boolean; + }; + }; + }; + responses: { + /** @description Default Response */ + 200: { + content: { + "application/json": { + result: { + id: number; + /** Format: date-time */ + created_at: string; + /** Format: date-time */ + updated_at: string; + comment?: string | null; + categories: string[]; + api_request: string; + /** @enum {string|null} */ + vote?: "up" | "down" | null; + contact_consent: boolean; + }; + }; + }; + }; + /** @description Server could not understand the request due to invalid syntax. In most cases relates with the schema validation. */ + 400: { + content: { + "application/json": components["schemas"]["BadRequestResponse"]; + }; + }; + /** @description Unauthorized route access. */ + 401: { + content: { + "application/json": components["schemas"]["UnauthorizedResponse"]; + }; + }; + /** @description The server can not find requested resource. */ + 404: { + content: { + "application/json": components["schemas"]["NotFoundResponse"]; + }; + }; + /** @description The user has sent too many requests in a given amount of time ("rate limiting").. */ + 429: { + content: { + "application/json": components["schemas"]["TooManyRequestsResponse"]; + }; + }; + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + content: { + "application/json": components["schemas"]["InternalServerErrorResponse"]; + }; + }; + /** @description The remote server is not ready to handle the request. */ + 503: { + content: { + "application/json": components["schemas"]["UnavailableResponse"]; + }; + }; + }; + }; + }; + "/v2/tuning_types": { + get: { + parameters: { + query: { + version: "2024-01-30"; + }; + }; + responses: { + /** @description Default Response */ + 200: { + content: { + "application/json": { + results: { + id?: string; + name?: string; + /** @description JSON Schema */ + schema?: { + [key: string]: unknown; + }; + model_ids?: string[]; + }[]; + }; + }; + }; + /** @description Server could not understand the request due to invalid syntax. In most cases relates with the schema validation. */ + 400: { + content: { + "application/json": components["schemas"]["BadRequestResponse"]; + }; + }; + /** @description Unauthorized route access. */ + 401: { + content: { + "application/json": components["schemas"]["UnauthorizedResponse"]; + }; + }; + /** @description The user has sent too many requests in a given amount of time ("rate limiting").. */ + 429: { + content: { + "application/json": components["schemas"]["TooManyRequestsResponse"]; + }; + }; + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + content: { + "application/json": components["schemas"]["InternalServerErrorResponse"]; + }; + }; + /** @description The remote server is not ready to handle the request. */ + 503: { + content: { + "application/json": components["schemas"]["UnavailableResponse"]; + }; + }; + }; + }; + }; + "/v2/models/{id}": { + get: { + parameters: { + query: { + version: "2024-01-30"; + }; + path: { + id: string; + }; + }; + responses: { + /** @description Default Response */ + 200: { + content: { + "application/json": { + result: { + tasks: { + id: string; + name: string; + json_example?: string; + jsonl_example?: string; + csv_example?: string; + verbalizer?: string; + file_format_id?: number; + tune: boolean; + categorization: boolean; + }[]; + model_family: { + id: number; + name: string; + system_prompt?: string; + prompt_example?: string; + short_description?: string; + description?: string; + }; + system_prompt?: string; + id: string; + name: string; + developer?: string; + size: string; + label: string; + disabled: boolean; + preferred: boolean; + warning?: string; + description?: string; + tags: string[]; + facets?: ({ + id: string; + name: string; + /** @enum {string} */ + type: "language" | "industry" | "model_type"; + })[]; + source_model_id?: string | null; + is_live: boolean; + token_limits: { + beam_width: number; + token_limit: number; }[]; + prompt_builder_example?: { + [key: string]: unknown; + }; + system_prompt_id?: number; }; - conversation_id: string; }; }; }; @@ -1250,6 +3837,12 @@ export interface paths { "application/json": components["schemas"]["NotFoundResponse"]; }; }; + /** @description The user has sent too many requests in a given amount of time ("rate limiting").. */ + 429: { + content: { + "application/json": components["schemas"]["TooManyRequestsResponse"]; + }; + }; /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ 500: { content: { @@ -1265,7 +3858,7 @@ export interface paths { }; }; }; - "/v2/text/chat/output": { + "/v2/text/tokenization": { post: { parameters: { query: { @@ -1276,68 +3869,17 @@ export interface paths { content: { "application/json": { model_id?: string; - prompt_template_id?: string | null; - moderations?: { - hap?: boolean | { - input?: boolean; - output?: boolean; - threshold?: number; - send_tokens?: boolean; - }; - stigma?: boolean | { - input?: boolean; - output?: boolean; - threshold?: number; - send_tokens?: boolean; - }; - implicit_hate?: boolean | { - input?: boolean; - output?: boolean; - threshold?: number; - send_tokens?: boolean; - }; - }; - messages?: ({ - /** @enum {string} */ - role: "user" | "system" | "assistant"; - content: string; - file_ids?: string[]; - })[]; - conversation_id?: string | null; - parent_id?: string | null; prompt_id?: string; - /** @enum {string} */ - trim_method?: "floating_window" | "none"; - use_conversation_parameters?: boolean; + input?: string | string[]; + data?: { + example_file_ids?: string[]; + [key: string]: unknown; + }; parameters?: ({ - beam_width?: number | null; - /** @enum {string|null} */ - decoding_method?: "greedy" | "sample" | null; - max_new_tokens?: number | null; - min_new_tokens?: number | null; - random_seed?: number | null; - stop_sequences?: string[] | null; - temperature?: number | null; - time_limit?: number | null; - top_k?: number | null; - top_p?: number | null; - typical_p?: number | null; - repetition_penalty?: number | null; - truncate_input_tokens?: number | null; - include_stop_sequence?: boolean; - return_options?: ({ - generated_tokens?: boolean | null; + return_options?: { input_text?: boolean | null; - input_tokens?: boolean | null; - input_parameters?: boolean | null; - token_logprobs?: boolean | null; - token_ranks?: boolean | null; - top_n_tokens?: number | null; - }) | null; - length_penalty?: ({ - decay_factor?: number | null; - start_index?: number | null; - }) | null; + tokens?: boolean | null; + }; }) | null; }; }; @@ -1347,7 +3889,71 @@ export interface paths { 200: { content: { "application/json": { - result: string; + model_id: string; + created_at: string; + results: ({ + token_count: number; + tokens?: string[]; + input_text?: string | null; + })[]; + }; + }; + }; + /** @description Server could not understand the request due to invalid syntax. In most cases relates with the schema validation. */ + 400: { + content: { + "application/json": components["schemas"]["BadRequestResponse"]; + }; + }; + /** @description Unauthorized route access. */ + 401: { + content: { + "application/json": components["schemas"]["UnauthorizedResponse"]; + }; + }; + /** @description The server can not find requested resource. */ + 404: { + content: { + "application/json": components["schemas"]["NotFoundResponse"]; + }; + }; + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + content: { + "application/json": components["schemas"]["InternalServerErrorResponse"]; + }; + }; + /** @description The remote server is not ready to handle the request. */ + 503: { + content: { + "application/json": components["schemas"]["UnavailableResponse"]; + }; + }; + }; + }; + }; + "/v2/folders/{id}": { + get: { + parameters: { + query: { + version: "2023-11-22"; + }; + path: { + id: string; + }; + }; + responses: { + /** @description Default Response */ + 200: { + content: { + "application/json": { + result: { + id: string; + name: string; + /** Format: date-time */ + created_at: string; + prompt_ids?: string[]; + }; }; }; }; @@ -1389,81 +3995,19 @@ export interface paths { }; }; }; - }; - "/v2/text/chat": { - post: { + put: { parameters: { query: { - version: "2024-01-10"; + version: "2023-11-22"; + }; + path: { + id: string; }; }; - requestBody?: { + requestBody: { content: { "application/json": { - model_id?: string; - prompt_template_id?: string | null; - moderations?: { - hap?: boolean | { - input?: boolean; - output?: boolean; - threshold?: number; - send_tokens?: boolean; - }; - stigma?: boolean | { - input?: boolean; - output?: boolean; - threshold?: number; - send_tokens?: boolean; - }; - implicit_hate?: boolean | { - input?: boolean; - output?: boolean; - threshold?: number; - send_tokens?: boolean; - }; - }; - messages?: ({ - /** @enum {string} */ - role: "user" | "system" | "assistant"; - content: string; - file_ids?: string[]; - })[]; - conversation_id?: string | null; - parent_id?: string | null; - prompt_id?: string; - /** @enum {string} */ - trim_method?: "floating_window" | "none"; - use_conversation_parameters?: boolean; - parameters?: ({ - beam_width?: number | null; - /** @enum {string|null} */ - decoding_method?: "greedy" | "sample" | null; - max_new_tokens?: number | null; - min_new_tokens?: number | null; - random_seed?: number | null; - stop_sequences?: string[] | null; - temperature?: number | null; - time_limit?: number | null; - top_k?: number | null; - top_p?: number | null; - typical_p?: number | null; - repetition_penalty?: number | null; - truncate_input_tokens?: number | null; - include_stop_sequence?: boolean; - return_options?: ({ - generated_tokens?: boolean | null; - input_text?: boolean | null; - input_tokens?: boolean | null; - input_parameters?: boolean | null; - token_logprobs?: boolean | null; - token_ranks?: boolean | null; - top_n_tokens?: number | null; - }) | null; - length_penalty?: ({ - decay_factor?: number | null; - start_index?: number | null; - }) | null; - }) | null; + name: string; }; }; }; @@ -1472,46 +4016,13 @@ export interface paths { 200: { content: { "application/json": { - id?: string | null; - model_id?: string; - /** Format: date-time */ - created_at?: string; - input_parameters?: { - [key: string]: unknown; - } | null; - results: ({ - input_text?: string | null; - generated_text: string; - generated_token_count: number; - input_token_count?: number | null; - /** @enum {string} */ - stop_reason: "not_finished" | "max_tokens" | "eos_token" | "cancelled" | "time_limit" | "stop_sequence" | "token_limit" | "error"; - stop_sequence?: string | null; - generated_tokens?: (({ - text?: string | null; - logprob?: (number | null) | (string | null); - rank?: number | null; - top_tokens?: (({ - text?: string | null; - logprob?: (number | null) | (string | null); - })[]) | null; - })[]) | null; - input_tokens?: (({ - text?: string | null; - logprob?: (number | null) | (string | null); - rank?: number | null; - top_tokens?: (({ - text?: string | null; - logprob?: (number | null) | (string | null); - })[]) | null; - })[]) | null; - seed?: number | null; - moderation?: { - [key: string]: unknown; - } | null; - [key: string]: unknown; - })[]; - conversation_id: string; + result: { + id: string; + name: string; + /** Format: date-time */ + created_at: string; + prompt_ids?: string[]; + }; }; }; }; @@ -1530,7 +4041,13 @@ export interface paths { /** @description The server can not find requested resource. */ 404: { content: { - "application/json": components["schemas"]["NotFoundResponse"]; + "application/json": components["schemas"]["NotFoundResponse"]; + }; + }; + /** @description The user has sent too many requests in a given amount of time ("rate limiting").. */ + 429: { + content: { + "application/json": components["schemas"]["TooManyRequestsResponse"]; }; }; /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ @@ -1547,118 +4064,19 @@ export interface paths { }; }; }; - }; - "/v2/prompts/{id}": { - get: { + delete: { parameters: { query: { - version: "2024-01-10"; + version: "2023-11-22"; }; path: { id: string; }; }; responses: { - /** @description Default Response */ - 200: { - content: { - "application/json": { - result: { - id: string; - name: string; - description?: string; - data?: Record; - input?: string; - output?: string; - model_id?: string; - parameters?: ({ - beam_width?: number | null; - /** @enum {string|null} */ - decoding_method?: "greedy" | "sample" | null; - max_new_tokens?: number | null; - min_new_tokens?: number | null; - random_seed?: number | null; - stop_sequences?: string[] | null; - temperature?: number | null; - time_limit?: number | null; - top_k?: number | null; - top_p?: number | null; - typical_p?: number | null; - repetition_penalty?: number | null; - truncate_input_tokens?: number | null; - include_stop_sequence?: boolean; - return_options?: ({ - generated_tokens?: boolean | null; - input_text?: boolean | null; - input_tokens?: boolean | null; - input_parameters?: boolean | null; - token_logprobs?: boolean | null; - token_ranks?: boolean | null; - top_n_tokens?: number | null; - }) | null; - length_penalty?: ({ - decay_factor?: number | null; - start_index?: number | null; - }) | null; - }) | null; - moderations?: ({ - hap?: boolean | { - input?: boolean; - output?: boolean; - threshold?: number; - send_tokens?: boolean; - }; - stigma?: boolean | { - input?: boolean; - output?: boolean; - threshold?: number; - send_tokens?: boolean; - }; - implicit_hate?: boolean | { - input?: boolean; - output?: boolean; - threshold?: number; - send_tokens?: boolean; - }; - }) | null; - /** Format: date-time */ - created_at: string; - /** Format: date-time */ - updated_at?: string; - /** @enum {string} */ - type: "private" | "public" | "community" | "example"; - public?: boolean; - prompt_id?: string | null; - metadata?: { - [key: string]: unknown; - }; - tags?: ({ - id: string; - name: string; - /** @enum {string} */ - type: "language" | "industry" | "model_type"; - })[]; - author?: { - id?: number; - first_name?: string; - last_name?: string; - }; - task?: { - id?: string; - name?: string; - icon?: string; - }; - messages?: (({ - /** @enum {string} */ - role: "user" | "system" | "assistant"; - content: string; - file_ids?: string[]; - })[]) | null; - folder_id?: string | null; - usage_count: number; - }; - }; - }; + /** @description Success */ + 204: { + content: never; }; /** @description Server could not understand the request due to invalid syntax. In most cases relates with the schema validation. */ 400: { @@ -1698,191 +4116,33 @@ export interface paths { }; }; }; - put: { + patch: { parameters: { query: { version: "2024-01-10"; }; path: { - id: string; - }; - }; - requestBody: { - content: { - "application/json": { - name: string; - description?: string; - prompt_id?: string; - data?: { - example_file_ids?: string[]; - [key: string]: unknown; - }; - output?: string | null; - parameters?: ({ - beam_width?: number | null; - /** @enum {string|null} */ - decoding_method?: "greedy" | "sample" | null; - max_new_tokens?: number | null; - min_new_tokens?: number | null; - random_seed?: number | null; - stop_sequences?: string[] | null; - temperature?: number | null; - time_limit?: number | null; - top_k?: number | null; - top_p?: number | null; - typical_p?: number | null; - repetition_penalty?: number | null; - truncate_input_tokens?: number | null; - include_stop_sequence?: boolean; - return_options?: ({ - generated_tokens?: boolean | null; - input_text?: boolean | null; - input_tokens?: boolean | null; - input_parameters?: boolean | null; - token_logprobs?: boolean | null; - token_ranks?: boolean | null; - top_n_tokens?: number | null; - }) | null; - length_penalty?: ({ - decay_factor?: number | null; - start_index?: number | null; - }) | null; - }) | null; - moderations?: { - hap?: boolean | { - input?: boolean; - output?: boolean; - threshold?: number; - send_tokens?: boolean; - }; - stigma?: boolean | { - input?: boolean; - output?: boolean; - threshold?: number; - send_tokens?: boolean; - }; - implicit_hate?: boolean | { - input?: boolean; - output?: boolean; - threshold?: number; - send_tokens?: boolean; - }; - }; - model_id: string; - task_id?: string; - folder_id?: string | null; - industry_id?: string; - language_id?: string; - /** @enum {string} */ - type?: "private" | "public" | "community"; - input?: string; - messages?: (({ - /** @enum {string} */ - role: "user" | "system" | "assistant"; - content: string; - file_ids?: string[]; - })[]) | null; - }; - }; - }; - responses: { - /** @description Default Response */ - 200: { - content: { - "application/json": { - result: { - id: string; - name: string; - description?: string; - data?: Record; - input?: string; - output?: string; - model_id?: string; - parameters?: ({ - beam_width?: number | null; - /** @enum {string|null} */ - decoding_method?: "greedy" | "sample" | null; - max_new_tokens?: number | null; - min_new_tokens?: number | null; - random_seed?: number | null; - stop_sequences?: string[] | null; - temperature?: number | null; - time_limit?: number | null; - top_k?: number | null; - top_p?: number | null; - typical_p?: number | null; - repetition_penalty?: number | null; - truncate_input_tokens?: number | null; - include_stop_sequence?: boolean; - return_options?: ({ - generated_tokens?: boolean | null; - input_text?: boolean | null; - input_tokens?: boolean | null; - input_parameters?: boolean | null; - token_logprobs?: boolean | null; - token_ranks?: boolean | null; - top_n_tokens?: number | null; - }) | null; - length_penalty?: ({ - decay_factor?: number | null; - start_index?: number | null; - }) | null; - }) | null; - moderations?: ({ - hap?: boolean | { - input?: boolean; - output?: boolean; - threshold?: number; - send_tokens?: boolean; - }; - stigma?: boolean | { - input?: boolean; - output?: boolean; - threshold?: number; - send_tokens?: boolean; - }; - implicit_hate?: boolean | { - input?: boolean; - output?: boolean; - threshold?: number; - send_tokens?: boolean; - }; - }) | null; - /** Format: date-time */ - created_at: string; - /** Format: date-time */ - updated_at?: string; - /** @enum {string} */ - type: "private" | "public" | "community" | "example"; - public?: boolean; - prompt_id?: string | null; - metadata?: { - [key: string]: unknown; - }; - tags?: ({ - id: string; - name: string; - /** @enum {string} */ - type: "language" | "industry" | "model_type"; - })[]; - author?: { - id?: number; - first_name?: string; - last_name?: string; - }; - task?: { - id?: string; - name?: string; - icon?: string; - }; - messages?: (({ - /** @enum {string} */ - role: "user" | "system" | "assistant"; - content: string; - file_ids?: string[]; - })[]) | null; - folder_id?: string | null; - usage_count: number; + id: string; + }; + }; + requestBody?: { + content: { + "application/json": { + position?: number; + }; + }; + }; + responses: { + /** @description Default Response */ + 200: { + content: { + "application/json": { + result: { + id: string; + name: string; + /** Format: date-time */ + created_at: string; + prompt_ids?: string[]; }; }; }; @@ -1925,19 +4185,24 @@ export interface paths { }; }; }; - delete: { + }; + "/v2/tunes/{id}/content/{type}": { + get: { parameters: { query: { - version: "2023-11-22"; + version: "2023-12-15"; }; path: { id: string; + type: "vectors" | "logs" | "export"; }; }; responses: { - /** @description Success */ - 204: { - content: never; + /** @description Default Response */ + 200: { + content: { + "application/octet-stream": Blob; + }; }; /** @description Server could not understand the request due to invalid syntax. In most cases relates with the schema validation. */ 400: { @@ -1977,22 +4242,107 @@ export interface paths { }; }; }; - patch: { + }; + "/v2/user": { + get: { parameters: { query: { - version: "2024-01-10"; + version: "2023-11-22"; }; - path: { - id: string; + }; + responses: { + /** @description Default Response */ + 200: { + content: { + "application/json": { + result: { + id: number; + first_name?: string; + last_name?: string; + email: string; + tou_accepted: boolean; + tou_accepted_at?: string; + generate_default?: ({ + model_id?: string; + parameters?: ({ + beam_width?: number | null; + /** @enum {string|null} */ + decoding_method?: "greedy" | "sample" | null; + max_new_tokens?: number | null; + min_new_tokens?: number | null; + random_seed?: number | null; + stop_sequences?: string[] | null; + temperature?: number | null; + time_limit?: number | null; + top_k?: number | null; + top_p?: number | null; + typical_p?: number | null; + repetition_penalty?: number | null; + truncate_input_tokens?: number | null; + include_stop_sequence?: boolean; + return_options?: ({ + generated_tokens?: boolean | null; + input_text?: boolean | null; + input_tokens?: boolean | null; + input_parameters?: boolean | null; + token_logprobs?: boolean | null; + token_ranks?: boolean | null; + top_n_tokens?: number | null; + }) | null; + length_penalty?: ({ + decay_factor?: number | null; + start_index?: number | null; + }) | null; + }) | null; + }) | null; + data_usage_consent: boolean; + }; + }; + }; + }; + /** @description Server could not understand the request due to invalid syntax. In most cases relates with the schema validation. */ + 400: { + content: { + "application/json": components["schemas"]["BadRequestResponse"]; + }; + }; + /** @description Unauthorized route access. */ + 401: { + content: { + "application/json": components["schemas"]["UnauthorizedResponse"]; + }; + }; + /** @description The user has sent too many requests in a given amount of time ("rate limiting").. */ + 429: { + content: { + "application/json": components["schemas"]["TooManyRequestsResponse"]; + }; + }; + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + content: { + "application/json": components["schemas"]["InternalServerErrorResponse"]; + }; + }; + /** @description The remote server is not ready to handle the request. */ + 503: { + content: { + "application/json": components["schemas"]["UnavailableResponse"]; + }; + }; + }; + }; + post: { + parameters: { + query: { + version: "2023-11-22"; }; }; requestBody?: { content: { "application/json": { - /** @enum {string} */ - type?: "private" | "public" | "community"; - folder_id?: string | null; - name?: string; + first_name?: string; + last_name?: string; }; }; }; @@ -2002,98 +4352,54 @@ export interface paths { content: { "application/json": { result: { - id: string; - name: string; - description?: string; - data?: Record; - input?: string; - output?: string; - model_id?: string; - parameters?: ({ - beam_width?: number | null; - /** @enum {string|null} */ - decoding_method?: "greedy" | "sample" | null; - max_new_tokens?: number | null; - min_new_tokens?: number | null; - random_seed?: number | null; - stop_sequences?: string[] | null; - temperature?: number | null; - time_limit?: number | null; - top_k?: number | null; - top_p?: number | null; - typical_p?: number | null; - repetition_penalty?: number | null; - truncate_input_tokens?: number | null; - include_stop_sequence?: boolean; - return_options?: ({ - generated_tokens?: boolean | null; - input_text?: boolean | null; - input_tokens?: boolean | null; - input_parameters?: boolean | null; - token_logprobs?: boolean | null; - token_ranks?: boolean | null; - top_n_tokens?: number | null; - }) | null; - length_penalty?: ({ - decay_factor?: number | null; - start_index?: number | null; - }) | null; - }) | null; - moderations?: ({ - hap?: boolean | { - input?: boolean; - output?: boolean; - threshold?: number; - send_tokens?: boolean; - }; - stigma?: boolean | { - input?: boolean; - output?: boolean; - threshold?: number; - send_tokens?: boolean; - }; - implicit_hate?: boolean | { - input?: boolean; - output?: boolean; - threshold?: number; - send_tokens?: boolean; - }; - }) | null; - /** Format: date-time */ - created_at: string; - /** Format: date-time */ - updated_at?: string; - /** @enum {string} */ - type: "private" | "public" | "community" | "example"; - public?: boolean; - prompt_id?: string | null; - metadata?: { - [key: string]: unknown; - }; - tags?: ({ - id: string; - name: string; - /** @enum {string} */ - type: "language" | "industry" | "model_type"; - })[]; - author?: { - id?: number; - first_name?: string; - last_name?: string; - }; - task?: { - id?: string; - name?: string; - icon?: string; + user_id: string; + api_key: { + value: string; + created_at: string; + generated_at: string; + last_used_at?: string; }; - messages?: (({ - /** @enum {string} */ - role: "user" | "system" | "assistant"; - content: string; - file_ids?: string[]; - })[]) | null; - folder_id?: string | null; - usage_count: number; + id: number; + first_name?: string; + last_name?: string; + email: string; + tou_accepted: boolean; + tou_accepted_at?: string; + generate_default?: ({ + model_id?: string; + parameters?: ({ + beam_width?: number | null; + /** @enum {string|null} */ + decoding_method?: "greedy" | "sample" | null; + max_new_tokens?: number | null; + min_new_tokens?: number | null; + random_seed?: number | null; + stop_sequences?: string[] | null; + temperature?: number | null; + time_limit?: number | null; + top_k?: number | null; + top_p?: number | null; + typical_p?: number | null; + repetition_penalty?: number | null; + truncate_input_tokens?: number | null; + include_stop_sequence?: boolean; + return_options?: ({ + generated_tokens?: boolean | null; + input_text?: boolean | null; + input_tokens?: boolean | null; + input_parameters?: boolean | null; + token_logprobs?: boolean | null; + token_ranks?: boolean | null; + top_n_tokens?: number | null; + }) | null; + length_penalty?: ({ + decay_factor?: number | null; + start_index?: number | null; + }) | null; + }) | null; + }) | null; + data_usage_consent: boolean; + [key: string]: unknown; }; }; }; @@ -2136,133 +4442,16 @@ export interface paths { }; }; }; - }; - "/v2/prompts": { - get: { + delete: { parameters: { query: { - limit?: number; - offset?: number; - sort_by?: "type" | "model_task" | "updated_at" | "created_at" | "name" | "id" | "model" | "usage_count"; - direction?: "asc" | "desc"; - search?: string; - task_id?: string | string[]; - model_id?: string | string[]; - source?: ("user" | "example" | "community") | (("user" | "example" | "community")[]); - model_family_id?: number; - industry_id?: string | string[]; - prompt_language_id?: string | string[]; - model_type_id?: string | string[]; - avg_time_min?: number; - avg_time_max?: number; - context_window_min?: number; - context_window_max?: number; - folder_id?: string | null; - version: "2024-01-10"; + version: "2023-11-22"; }; }; responses: { - /** @description Default Response */ - 200: { - content: { - "application/json": { - results: ({ - id: string; - name: string; - description?: string; - data?: Record; - input?: string; - output?: string; - model_id?: string; - parameters?: ({ - beam_width?: number | null; - /** @enum {string|null} */ - decoding_method?: "greedy" | "sample" | null; - max_new_tokens?: number | null; - min_new_tokens?: number | null; - random_seed?: number | null; - stop_sequences?: string[] | null; - temperature?: number | null; - time_limit?: number | null; - top_k?: number | null; - top_p?: number | null; - typical_p?: number | null; - repetition_penalty?: number | null; - truncate_input_tokens?: number | null; - include_stop_sequence?: boolean; - return_options?: ({ - generated_tokens?: boolean | null; - input_text?: boolean | null; - input_tokens?: boolean | null; - input_parameters?: boolean | null; - token_logprobs?: boolean | null; - token_ranks?: boolean | null; - top_n_tokens?: number | null; - }) | null; - length_penalty?: ({ - decay_factor?: number | null; - start_index?: number | null; - }) | null; - }) | null; - moderations?: ({ - hap?: boolean | { - input?: boolean; - output?: boolean; - threshold?: number; - send_tokens?: boolean; - }; - stigma?: boolean | { - input?: boolean; - output?: boolean; - threshold?: number; - send_tokens?: boolean; - }; - implicit_hate?: boolean | { - input?: boolean; - output?: boolean; - threshold?: number; - send_tokens?: boolean; - }; - }) | null; - /** Format: date-time */ - created_at: string; - /** Format: date-time */ - updated_at?: string; - /** @enum {string} */ - type: "private" | "public" | "community" | "example"; - public?: boolean; - prompt_id?: string | null; - metadata?: { - [key: string]: unknown; - }; - tags?: ({ - id: string; - name: string; - /** @enum {string} */ - type: "language" | "industry" | "model_type"; - })[]; - author?: { - id?: number; - first_name?: string; - last_name?: string; - }; - task?: { - id?: string; - name?: string; - icon?: string; - }; - messages?: (({ - /** @enum {string} */ - role: "user" | "system" | "assistant"; - content: string; - file_ids?: string[]; - })[]) | null; - folder_id?: string | null; - usage_count: number; - })[]; - total_count: number; - }; - }; + /** @description Success */ + 204: { + content: never; }; /** @description Server could not understand the request due to invalid syntax. In most cases relates with the schema validation. */ 400: { @@ -2276,6 +4465,12 @@ export interface paths { "application/json": components["schemas"]["UnauthorizedResponse"]; }; }; + /** @description The server can not find requested resource. */ + 404: { + content: { + "application/json": components["schemas"]["NotFoundResponse"]; + }; + }; /** @description The user has sent too many requests in a given amount of time ("rate limiting").. */ 429: { content: { @@ -2296,87 +4491,17 @@ export interface paths { }; }; }; - post: { + patch: { parameters: { query: { - version: "2024-01-10"; + version: "2023-11-22"; }; }; - requestBody: { + requestBody?: { content: { "application/json": { - name: string; - description?: string; - prompt_id?: string; - data?: { - example_file_ids?: string[]; - [key: string]: unknown; - }; - output?: string | null; - parameters?: ({ - beam_width?: number | null; - /** @enum {string|null} */ - decoding_method?: "greedy" | "sample" | null; - max_new_tokens?: number | null; - min_new_tokens?: number | null; - random_seed?: number | null; - stop_sequences?: string[] | null; - temperature?: number | null; - time_limit?: number | null; - top_k?: number | null; - top_p?: number | null; - typical_p?: number | null; - repetition_penalty?: number | null; - truncate_input_tokens?: number | null; - include_stop_sequence?: boolean; - return_options?: ({ - generated_tokens?: boolean | null; - input_text?: boolean | null; - input_tokens?: boolean | null; - input_parameters?: boolean | null; - token_logprobs?: boolean | null; - token_ranks?: boolean | null; - top_n_tokens?: number | null; - }) | null; - length_penalty?: ({ - decay_factor?: number | null; - start_index?: number | null; - }) | null; - }) | null; - moderations?: { - hap?: boolean | { - input?: boolean; - output?: boolean; - threshold?: number; - send_tokens?: boolean; - }; - stigma?: boolean | { - input?: boolean; - output?: boolean; - threshold?: number; - send_tokens?: boolean; - }; - implicit_hate?: boolean | { - input?: boolean; - output?: boolean; - threshold?: number; - send_tokens?: boolean; - }; - }; - model_id: string; - task_id?: string; - folder_id?: string | null; - industry_id?: string; - language_id?: string; - /** @enum {string} */ - type?: "private" | "public" | "community"; - input?: string; - messages?: (({ - /** @enum {string} */ - role: "user" | "system" | "assistant"; - content: string; - file_ids?: string[]; - })[]) | null; + tou_accepted?: boolean; + data_usage_consent?: boolean; }; }; }; @@ -2386,98 +4511,46 @@ export interface paths { content: { "application/json": { result: { - id: string; - name: string; - description?: string; - data?: Record; - input?: string; - output?: string; - model_id?: string; - parameters?: ({ - beam_width?: number | null; - /** @enum {string|null} */ - decoding_method?: "greedy" | "sample" | null; - max_new_tokens?: number | null; - min_new_tokens?: number | null; - random_seed?: number | null; - stop_sequences?: string[] | null; - temperature?: number | null; - time_limit?: number | null; - top_k?: number | null; - top_p?: number | null; - typical_p?: number | null; - repetition_penalty?: number | null; - truncate_input_tokens?: number | null; - include_stop_sequence?: boolean; - return_options?: ({ - generated_tokens?: boolean | null; - input_text?: boolean | null; - input_tokens?: boolean | null; - input_parameters?: boolean | null; - token_logprobs?: boolean | null; - token_ranks?: boolean | null; - top_n_tokens?: number | null; - }) | null; - length_penalty?: ({ - decay_factor?: number | null; - start_index?: number | null; + id: number; + first_name?: string; + last_name?: string; + email: string; + tou_accepted: boolean; + tou_accepted_at?: string; + generate_default?: ({ + model_id?: string; + parameters?: ({ + beam_width?: number | null; + /** @enum {string|null} */ + decoding_method?: "greedy" | "sample" | null; + max_new_tokens?: number | null; + min_new_tokens?: number | null; + random_seed?: number | null; + stop_sequences?: string[] | null; + temperature?: number | null; + time_limit?: number | null; + top_k?: number | null; + top_p?: number | null; + typical_p?: number | null; + repetition_penalty?: number | null; + truncate_input_tokens?: number | null; + include_stop_sequence?: boolean; + return_options?: ({ + generated_tokens?: boolean | null; + input_text?: boolean | null; + input_tokens?: boolean | null; + input_parameters?: boolean | null; + token_logprobs?: boolean | null; + token_ranks?: boolean | null; + top_n_tokens?: number | null; + }) | null; + length_penalty?: ({ + decay_factor?: number | null; + start_index?: number | null; + }) | null; }) | null; }) | null; - moderations?: ({ - hap?: boolean | { - input?: boolean; - output?: boolean; - threshold?: number; - send_tokens?: boolean; - }; - stigma?: boolean | { - input?: boolean; - output?: boolean; - threshold?: number; - send_tokens?: boolean; - }; - implicit_hate?: boolean | { - input?: boolean; - output?: boolean; - threshold?: number; - send_tokens?: boolean; - }; - }) | null; - /** Format: date-time */ - created_at: string; - /** Format: date-time */ - updated_at?: string; - /** @enum {string} */ - type: "private" | "public" | "community" | "example"; - public?: boolean; - prompt_id?: string | null; - metadata?: { - [key: string]: unknown; - }; - tags?: ({ - id: string; - name: string; - /** @enum {string} */ - type: "language" | "industry" | "model_type"; - })[]; - author?: { - id?: number; - first_name?: string; - last_name?: string; - }; - task?: { - id?: string; - name?: string; - icon?: string; - }; - messages?: (({ - /** @enum {string} */ - role: "user" | "system" | "assistant"; - content: string; - file_ids?: string[]; - })[]) | null; - folder_id?: string | null; - usage_count: number; + data_usage_consent: boolean; }; }; }; @@ -2521,10 +4594,11 @@ export interface paths { }; }; }; - "/v2/folders/{id}": { + "/v2/tunes/{id}/content": { get: { parameters: { query: { + content: string; version: "2023-11-22"; }; path: { @@ -2532,19 +4606,9 @@ export interface paths { }; }; responses: { - /** @description Default Response */ - 200: { - content: { - "application/json": { - result: { - id: string; - name: string; - /** Format: date-time */ - created_at: string; - prompt_ids?: string[]; - }; - }; - }; + /** @description Success */ + 302: { + content: never; }; /** @description Server could not understand the request due to invalid syntax. In most cases relates with the schema validation. */ 400: { @@ -2584,7 +4648,9 @@ export interface paths { }; }; }; - put: { + }; + "/v2/tunes/{id}": { + get: { parameters: { query: { version: "2023-11-22"; @@ -2593,13 +4659,6 @@ export interface paths { id: string; }; }; - requestBody: { - content: { - "application/json": { - name: string; - }; - }; - }; responses: { /** @description Default Response */ 200: { @@ -2608,9 +4667,66 @@ export interface paths { result: { id: string; name: string; + model_id: string; + model_name: string | null; + /** @enum {string} */ + status: "initializing" | "not_started" | "pending" | "halted" | "running" | "queued" | "completed" | "failed"; + status_message?: string | null; + tuning_type: string; + parameters?: Record; + preferred: boolean; + task_id: string; + task_name: string; + /** Format: date-time */ + started_at?: string | null; + /** Format: date-time */ + finished_at?: string | null; + /** Format: date-time */ + last_used_at?: string; /** Format: date-time */ created_at: string; - prompt_ids?: string[]; + validation_files?: { + id: string; + file_name: string; + /** Format: date-time */ + created_at?: string; + }[] | null; + training_files?: { + id: string; + file_name: string; + /** Format: date-time */ + created_at?: string; + }[] | null; + evaluation_files?: { + id: string; + file_name: string; + /** Format: date-time */ + created_at?: string; + }[] | null; + datapoints?: { + loss: { + data: { + value: number; + step?: number; + epoch: number; + }; + /** Format: date-time */ + timestamp: string; + }[]; + validation_loss?: { + data: { + value: number; + step?: number; + epoch: number; + }; + /** Format: date-time */ + timestamp: string; + }[]; + }; + vectors?: string | null; + contents?: { + name: string; + }[]; }; }; }; @@ -2708,7 +4824,7 @@ export interface paths { patch: { parameters: { query: { - version: "2024-01-10"; + version: "2023-11-22"; }; path: { id: string; @@ -2717,7 +4833,8 @@ export interface paths { requestBody?: { content: { "application/json": { - position?: number; + name?: string; + preferred?: boolean; }; }; }; @@ -2729,68 +4846,68 @@ export interface paths { result: { id: string; name: string; + model_id: string; + model_name: string | null; + /** @enum {string} */ + status: "initializing" | "not_started" | "pending" | "halted" | "running" | "queued" | "completed" | "failed"; + status_message?: string | null; + tuning_type: string; + parameters?: Record; + preferred: boolean; + task_id: string; + task_name: string; + /** Format: date-time */ + started_at?: string | null; + /** Format: date-time */ + finished_at?: string | null; + /** Format: date-time */ + last_used_at?: string; /** Format: date-time */ created_at: string; - prompt_ids?: string[]; + validation_files?: { + id: string; + file_name: string; + /** Format: date-time */ + created_at?: string; + }[] | null; + training_files?: { + id: string; + file_name: string; + /** Format: date-time */ + created_at?: string; + }[] | null; + evaluation_files?: { + id: string; + file_name: string; + /** Format: date-time */ + created_at?: string; + }[] | null; + datapoints?: { + loss: { + data: { + value: number; + step?: number; + epoch: number; + }; + /** Format: date-time */ + timestamp: string; + }[]; + validation_loss?: { + data: { + value: number; + step?: number; + epoch: number; + }; + /** Format: date-time */ + timestamp: string; + }[]; + }; + vectors?: string | null; + contents?: { + name: string; + }[]; }; - }; - }; - }; - /** @description Server could not understand the request due to invalid syntax. In most cases relates with the schema validation. */ - 400: { - content: { - "application/json": components["schemas"]["BadRequestResponse"]; - }; - }; - /** @description Unauthorized route access. */ - 401: { - content: { - "application/json": components["schemas"]["UnauthorizedResponse"]; - }; - }; - /** @description The server can not find requested resource. */ - 404: { - content: { - "application/json": components["schemas"]["NotFoundResponse"]; - }; - }; - /** @description The user has sent too many requests in a given amount of time ("rate limiting").. */ - 429: { - content: { - "application/json": components["schemas"]["TooManyRequestsResponse"]; - }; - }; - /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ - 500: { - content: { - "application/json": components["schemas"]["InternalServerErrorResponse"]; - }; - }; - /** @description The remote server is not ready to handle the request. */ - 503: { - content: { - "application/json": components["schemas"]["UnavailableResponse"]; - }; - }; - }; - }; - }; - "/v2/tunes/{id}/content/{type}": { - get: { - parameters: { - query: { - version: "2023-12-15"; - }; - path: { - id: string; - type: "vectors" | "logs" | "export"; - }; - }; - responses: { - /** @description Default Response */ - 200: { - content: { - "application/octet-stream": Blob; + }; }; }; /** @description Server could not understand the request due to invalid syntax. In most cases relates with the schema validation. */ @@ -2832,14 +4949,35 @@ export interface paths { }; }; }; - "/v2/files/{id}": { - get: { + "/v2/tunes/preflight": { + post: { parameters: { query: { - version: "2023-12-15"; + version: "2023-11-22"; }; - path: { - id: string; + }; + requestBody: { + content: { + "application/json": { + name: string; + model_id: string; + task_id: string; + training_file_ids: string[]; + validation_file_ids?: string[] | null; + evaluation_file_ids?: string[] | null; + tuning_type: string; + parameters?: ({ + batch_size?: number | null; + num_epochs?: number | null; + verbalizer?: string | null; + learning_rate?: number | null; + accumulate_steps?: number | null; + max_input_tokens?: number | null; + max_output_tokens?: number | null; + num_virtual_tokens?: number | null; + [key: string]: unknown; + }) | null; + }; }; }; responses: { @@ -2848,18 +4986,11 @@ export interface paths { content: { "application/json": { result: { - id: string; - bytes: number; - file_name: string; - /** @enum {string} */ - storage_provider_location: "us-south" | "us-east"; - /** @enum {string} */ - purpose: "tune" | "template" | "tune_import" | "extraction"; - /** Format: date-time */ - created_at: string; - file_formats?: { - id: number; - name: string; + training_file_preview?: { + [key: string]: unknown; + }[]; + validation_file_preview?: { + [key: string]: unknown; }[]; }; }; @@ -2903,19 +5034,93 @@ export interface paths { }; }; }; - delete: { + }; + "/v2/tunes/import": { + post: { parameters: { query: { version: "2023-11-22"; }; - path: { - id: string; + }; + requestBody: { + content: { + "application/json": { + name: string; + file_id: string; + }; }; }; responses: { - /** @description Success */ - 204: { - content: never; + /** @description Default Response */ + 200: { + content: { + "application/json": { + result: { + id: string; + name: string; + model_id: string; + model_name: string | null; + /** @enum {string} */ + status: "initializing" | "not_started" | "pending" | "halted" | "running" | "queued" | "completed" | "failed"; + status_message?: string | null; + tuning_type: string; + parameters?: Record; + preferred: boolean; + task_id: string; + task_name: string; + /** Format: date-time */ + started_at?: string | null; + /** Format: date-time */ + finished_at?: string | null; + /** Format: date-time */ + last_used_at?: string; + /** Format: date-time */ + created_at: string; + validation_files?: { + id: string; + file_name: string; + /** Format: date-time */ + created_at?: string; + }[] | null; + training_files?: { + id: string; + file_name: string; + /** Format: date-time */ + created_at?: string; + }[] | null; + evaluation_files?: { + id: string; + file_name: string; + /** Format: date-time */ + created_at?: string; + }[] | null; + datapoints?: { + loss: { + data: { + value: number; + step?: number; + epoch: number; + }; + /** Format: date-time */ + timestamp: string; + }[]; + validation_loss?: { + data: { + value: number; + step?: number; + epoch: number; + }; + /** Format: date-time */ + timestamp: string; + }[]; + }; + vectors?: string | null; + contents?: { + name: string; + }[]; + }; + }; + }; }; /** @description Server could not understand the request due to invalid syntax. In most cases relates with the schema validation. */ 400: { @@ -2956,18 +5161,17 @@ export interface paths { }; }; }; - "/v2/files": { + "/v2/tunes": { get: { parameters: { query: { limit?: number; offset?: number; - sort_by?: "name" | "created_at"; + status?: "initializing" | "not_started" | "pending" | "halted" | "running" | "queued" | "completed" | "failed"; + search?: string | null; + sort_by?: "status" | "created_at" | "name" | "id" | "model"; direction?: "asc" | "desc"; - search?: string; - purpose?: "tune" | "template" | "tune_import" | "extraction"; - format_id?: number; - version: "2023-12-15"; + version: "2023-11-22"; }; }; responses: { @@ -2975,93 +5179,71 @@ export interface paths { 200: { content: { "application/json": { + total_count: number; results: ({ id: string; - bytes: number; - file_name: string; - /** @enum {string} */ - storage_provider_location: "us-south" | "us-east"; + name: string; + model_id: string; + model_name: string | null; /** @enum {string} */ - purpose: "tune" | "template" | "tune_import" | "extraction"; + status: "initializing" | "not_started" | "pending" | "halted" | "running" | "queued" | "completed" | "failed"; + status_message?: string | null; + tuning_type: string; + parameters?: Record; + preferred: boolean; + task_id: string; + task_name: string; + /** Format: date-time */ + started_at?: string | null; + /** Format: date-time */ + finished_at?: string | null; + /** Format: date-time */ + last_used_at?: string; /** Format: date-time */ created_at: string; - file_formats?: { - id: number; - name: string; - }[]; - })[]; - total_count: number; - }; - }; - }; - /** @description Server could not understand the request due to invalid syntax. In most cases relates with the schema validation. */ - 400: { - content: { - "application/json": components["schemas"]["BadRequestResponse"]; - }; - }; - /** @description Unauthorized route access. */ - 401: { - content: { - "application/json": components["schemas"]["UnauthorizedResponse"]; - }; - }; - /** @description The user has sent too many requests in a given amount of time ("rate limiting").. */ - 429: { - content: { - "application/json": components["schemas"]["TooManyRequestsResponse"]; - }; - }; - /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ - 500: { - content: { - "application/json": components["schemas"]["InternalServerErrorResponse"]; - }; - }; - /** @description The remote server is not ready to handle the request. */ - 503: { - content: { - "application/json": components["schemas"]["UnavailableResponse"]; - }; - }; - }; - }; - post: { - parameters: { - query: { - version: "2023-12-15"; - }; - }; - requestBody: { - content: { - "multipart/form-data": { - /** @enum {string} */ - purpose: "tune" | "template" | "tune_import" | "extraction"; - /** Format: binary */ - file: Blob; - }; - }; - }; - responses: { - /** @description Default Response */ - 200: { - content: { - "application/json": { - result: { - id: string; - bytes: number; - file_name: string; - /** @enum {string} */ - storage_provider_location: "us-south" | "us-east"; - /** @enum {string} */ - purpose: "tune" | "template" | "tune_import" | "extraction"; - /** Format: date-time */ - created_at: string; - file_formats?: { - id: number; - name: string; - }[]; - }; + validation_files?: { + id: string; + file_name: string; + /** Format: date-time */ + created_at?: string; + }[] | null; + training_files?: { + id: string; + file_name: string; + /** Format: date-time */ + created_at?: string; + }[] | null; + evaluation_files?: { + id: string; + file_name: string; + /** Format: date-time */ + created_at?: string; + }[] | null; + datapoints?: { + loss: { + data: { + value: number; + step?: number; + epoch: number; + }; + /** Format: date-time */ + timestamp: string; + }[]; + validation_loss?: { + data: { + value: number; + step?: number; + epoch: number; + }; + /** Format: date-time */ + timestamp: string; + }[]; + }; + vectors?: string | null; + contents?: { + name: string; + }[]; + })[]; }; }; }; @@ -3077,12 +5259,6 @@ export interface paths { "application/json": components["schemas"]["UnauthorizedResponse"]; }; }; - /** @description The server can not find requested resource. */ - 404: { - content: { - "application/json": components["schemas"]["NotFoundResponse"]; - }; - }; /** @description The user has sent too many requests in a given amount of time ("rate limiting").. */ 429: { content: { @@ -3103,88 +5279,104 @@ export interface paths { }; }; }; - }; - "/v2/user": { - get: { + post: { parameters: { query: { version: "2023-11-22"; }; }; + requestBody: { + content: { + "application/json": { + name: string; + model_id: string; + task_id: string; + training_file_ids: string[]; + validation_file_ids?: string[] | null; + evaluation_file_ids?: string[] | null; + tuning_type: string; + parameters?: ({ + batch_size?: number | null; + num_epochs?: number | null; + verbalizer?: string | null; + learning_rate?: number | null; + accumulate_steps?: number | null; + max_input_tokens?: number | null; + max_output_tokens?: number | null; + num_virtual_tokens?: number | null; + [key: string]: unknown; + }) | null; + }; + }; + }; responses: { /** @description Default Response */ 200: { content: { "application/json": { result: { - id: number; - first_name?: string; - last_name?: string; - tou_accepted: boolean; - tou_accepted_at?: string; - generate_default?: ({ - model_id?: string; - prompt_id?: string; - template?: { - id?: string; - value?: string; - data: { - example_file_ids?: string[]; - [key: string]: unknown; - }; - }; - parameters?: ({ - beam_width?: number | null; - /** @enum {string|null} */ - decoding_method?: "greedy" | "sample" | null; - max_new_tokens?: number | null; - min_new_tokens?: number | null; - random_seed?: number | null; - stop_sequences?: string[] | null; - temperature?: number | null; - time_limit?: number | null; - top_k?: number | null; - top_p?: number | null; - typical_p?: number | null; - repetition_penalty?: number | null; - truncate_input_tokens?: number | null; - include_stop_sequence?: boolean; - return_options?: ({ - generated_tokens?: boolean | null; - input_text?: boolean | null; - input_tokens?: boolean | null; - input_parameters?: boolean | null; - token_logprobs?: boolean | null; - token_ranks?: boolean | null; - top_n_tokens?: number | null; - }) | null; - length_penalty?: ({ - decay_factor?: number | null; - start_index?: number | null; - }) | null; - }) | null; - moderations?: { - hap?: boolean | { - input?: boolean; - output?: boolean; - threshold?: number; - send_tokens?: boolean; - }; - stigma?: boolean | { - input?: boolean; - output?: boolean; - threshold?: number; - send_tokens?: boolean; - }; - implicit_hate?: boolean | { - input?: boolean; - output?: boolean; - threshold?: number; - send_tokens?: boolean; - }; - }; - }) | null; - data_usage_consent: boolean; + id: string; + name: string; + model_id: string; + model_name: string | null; + /** @enum {string} */ + status: "initializing" | "not_started" | "pending" | "halted" | "running" | "queued" | "completed" | "failed"; + status_message?: string | null; + tuning_type: string; + parameters?: Record; + preferred: boolean; + task_id: string; + task_name: string; + /** Format: date-time */ + started_at?: string | null; + /** Format: date-time */ + finished_at?: string | null; + /** Format: date-time */ + last_used_at?: string; + /** Format: date-time */ + created_at: string; + validation_files?: { + id: string; + file_name: string; + /** Format: date-time */ + created_at?: string; + }[] | null; + training_files?: { + id: string; + file_name: string; + /** Format: date-time */ + created_at?: string; + }[] | null; + evaluation_files?: { + id: string; + file_name: string; + /** Format: date-time */ + created_at?: string; + }[] | null; + datapoints?: { + loss: { + data: { + value: number; + step?: number; + epoch: number; + }; + /** Format: date-time */ + timestamp: string; + }[]; + validation_loss?: { + data: { + value: number; + step?: number; + epoch: number; + }; + /** Format: date-time */ + timestamp: string; + }[]; + }; + vectors?: string | null; + contents?: { + name: string; + }[]; }; }; }; @@ -3201,6 +5393,12 @@ export interface paths { "application/json": components["schemas"]["UnauthorizedResponse"]; }; }; + /** @description The server can not find requested resource. */ + 404: { + content: { + "application/json": components["schemas"]["NotFoundResponse"]; + }; + }; /** @description The user has sent too many requests in a given amount of time ("rate limiting").. */ 429: { content: { @@ -3221,102 +5419,24 @@ export interface paths { }; }; }; - post: { + }; + "/v2/text/generation/limits": { + get: { parameters: { query: { version: "2023-11-22"; - }; - }; - requestBody?: { - content: { - "application/json": { - first_name?: string; - last_name?: string; - }; - }; - }; - responses: { - /** @description Default Response */ - 200: { - content: { - "application/json": { - result: { - user_id: string; - api_key: { - value: string; - created_at: string; - generated_at: string; - last_used_at?: string; - }; - id: number; - first_name?: string; - last_name?: string; - tou_accepted: boolean; - tou_accepted_at?: string; - generate_default?: ({ - model_id?: string; - prompt_id?: string; - template?: { - id?: string; - value?: string; - data: { - example_file_ids?: string[]; - [key: string]: unknown; - }; - }; - parameters?: ({ - beam_width?: number | null; - /** @enum {string|null} */ - decoding_method?: "greedy" | "sample" | null; - max_new_tokens?: number | null; - min_new_tokens?: number | null; - random_seed?: number | null; - stop_sequences?: string[] | null; - temperature?: number | null; - time_limit?: number | null; - top_k?: number | null; - top_p?: number | null; - typical_p?: number | null; - repetition_penalty?: number | null; - truncate_input_tokens?: number | null; - include_stop_sequence?: boolean; - return_options?: ({ - generated_tokens?: boolean | null; - input_text?: boolean | null; - input_tokens?: boolean | null; - input_parameters?: boolean | null; - token_logprobs?: boolean | null; - token_ranks?: boolean | null; - top_n_tokens?: number | null; - }) | null; - length_penalty?: ({ - decay_factor?: number | null; - start_index?: number | null; - }) | null; - }) | null; - moderations?: { - hap?: boolean | { - input?: boolean; - output?: boolean; - threshold?: number; - send_tokens?: boolean; - }; - stigma?: boolean | { - input?: boolean; - output?: boolean; - threshold?: number; - send_tokens?: boolean; - }; - implicit_hate?: boolean | { - input?: boolean; - output?: boolean; - threshold?: number; - send_tokens?: boolean; - }; - }; - }) | null; - data_usage_consent: boolean; - [key: string]: unknown; + }; + }; + responses: { + /** @description Default Response */ + 200: { + content: { + "application/json": { + result: { + concurrency: { + limit: number; + remaining: number; + }; }; }; }; @@ -3333,16 +5453,39 @@ export interface paths { "application/json": components["schemas"]["UnauthorizedResponse"]; }; }; - /** @description The server can not find requested resource. */ - 404: { + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { content: { - "application/json": components["schemas"]["NotFoundResponse"]; + "application/json": components["schemas"]["InternalServerErrorResponse"]; }; }; - /** @description The user has sent too many requests in a given amount of time ("rate limiting").. */ - 429: { + /** @description The remote server is not ready to handle the request. */ + 503: { content: { - "application/json": components["schemas"]["TooManyRequestsResponse"]; + "application/json": components["schemas"]["UnavailableResponse"]; + }; + }; + }; + }; + }; + "/v2/text/extraction/limits": { + get: { + parameters: { + query: { + version: "2023-11-22"; + }; + }; + responses: { + /** @description Server could not understand the request due to invalid syntax. In most cases relates with the schema validation. */ + 400: { + content: { + "application/json": components["schemas"]["BadRequestResponse"]; + }; + }; + /** @description Unauthorized route access. */ + 401: { + content: { + "application/json": components["schemas"]["UnauthorizedResponse"]; }; }; /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ @@ -3359,16 +5502,27 @@ export interface paths { }; }; }; - delete: { + }; + "/v2/text/embeddings/limits": { + get: { parameters: { query: { version: "2023-11-22"; }; }; responses: { - /** @description Success */ - 204: { - content: never; + /** @description Default Response */ + 200: { + content: { + "application/json": { + result: { + concurrency: { + limit: number; + remaining: number; + }; + }; + }; + }; }; /** @description Server could not understand the request due to invalid syntax. In most cases relates with the schema validation. */ 400: { @@ -3382,18 +5536,6 @@ export interface paths { "application/json": components["schemas"]["UnauthorizedResponse"]; }; }; - /** @description The server can not find requested resource. */ - 404: { - content: { - "application/json": components["schemas"]["NotFoundResponse"]; - }; - }; - /** @description The user has sent too many requests in a given amount of time ("rate limiting").. */ - 429: { - content: { - "application/json": components["schemas"]["TooManyRequestsResponse"]; - }; - }; /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ 500: { content: { @@ -3408,95 +5550,31 @@ export interface paths { }; }; }; - patch: { + }; + "/v2/tasks": { + get: { parameters: { query: { + tune?: boolean | null; version: "2023-11-22"; }; }; - requestBody?: { - content: { - "application/json": { - tou_accepted?: boolean; - data_usage_consent?: boolean; - }; - }; - }; responses: { /** @description Default Response */ 200: { content: { "application/json": { - result: { - id: number; - first_name?: string; - last_name?: string; - tou_accepted: boolean; - tou_accepted_at?: string; - generate_default?: ({ - model_id?: string; - prompt_id?: string; - template?: { - id?: string; - value?: string; - data: { - example_file_ids?: string[]; - [key: string]: unknown; - }; - }; - parameters?: ({ - beam_width?: number | null; - /** @enum {string|null} */ - decoding_method?: "greedy" | "sample" | null; - max_new_tokens?: number | null; - min_new_tokens?: number | null; - random_seed?: number | null; - stop_sequences?: string[] | null; - temperature?: number | null; - time_limit?: number | null; - top_k?: number | null; - top_p?: number | null; - typical_p?: number | null; - repetition_penalty?: number | null; - truncate_input_tokens?: number | null; - include_stop_sequence?: boolean; - return_options?: ({ - generated_tokens?: boolean | null; - input_text?: boolean | null; - input_tokens?: boolean | null; - input_parameters?: boolean | null; - token_logprobs?: boolean | null; - token_ranks?: boolean | null; - top_n_tokens?: number | null; - }) | null; - length_penalty?: ({ - decay_factor?: number | null; - start_index?: number | null; - }) | null; - }) | null; - moderations?: { - hap?: boolean | { - input?: boolean; - output?: boolean; - threshold?: number; - send_tokens?: boolean; - }; - stigma?: boolean | { - input?: boolean; - output?: boolean; - threshold?: number; - send_tokens?: boolean; - }; - implicit_hate?: boolean | { - input?: boolean; - output?: boolean; - threshold?: number; - send_tokens?: boolean; - }; - }; - }) | null; - data_usage_consent: boolean; - }; + results: { + id: string; + name: string; + json_example?: string; + jsonl_example?: string; + csv_example?: string; + verbalizer?: string; + file_format_id?: number; + tune: boolean; + categorization: boolean; + }[]; }; }; }; @@ -3512,12 +5590,6 @@ export interface paths { "application/json": components["schemas"]["UnauthorizedResponse"]; }; }; - /** @description The server can not find requested resource. */ - 404: { - content: { - "application/json": components["schemas"]["NotFoundResponse"]; - }; - }; /** @description The user has sent too many requests in a given amount of time ("rate limiting").. */ 429: { content: { @@ -3539,71 +5611,27 @@ export interface paths { }; }; }; - "/v2/tunes/{id}": { + "/v2/tags": { get: { parameters: { query: { + limit?: number; + offset?: number; + type?: "language" | "industry" | "model_type"; version: "2023-11-22"; }; - path: { - id: string; - }; }; responses: { /** @description Default Response */ 200: { content: { "application/json": { - result: { - id: string; - name: string; - model_id: string; - model_name: string | null; - /** @enum {string} */ - status: "initializing" | "not_started" | "pending" | "halted" | "running" | "queued" | "completed" | "failed"; - status_message?: string | null; - tuning_type: string; - parameters?: Record; - preferred: boolean; - task_id: string; - task_name: string; - /** Format: date-time */ - started_at?: string | null; - /** Format: date-time */ - finished_at?: string | null; - /** Format: date-time */ - created_at: string; - validation_files?: { - id: string; - file_name: string; - /** Format: date-time */ - created_at?: string; - }[] | null; - training_files?: { - id: string; - file_name: string; - /** Format: date-time */ - created_at?: string; - }[] | null; - evaluation_files?: { - id: string; - file_name: string; - /** Format: date-time */ - created_at?: string; - }[] | null; - datapoints?: { - loss: { - data: { - value: number; - step?: number; - epoch: number; - }; - /** Format: date-time */ - timestamp: string; - }[]; - }; - vectors?: string | null; - }; + results: ({ + id: string; + name: string; + /** @enum {string} */ + type: "language" | "industry" | "model_type"; + })[]; }; }; }; @@ -3619,12 +5647,6 @@ export interface paths { "application/json": components["schemas"]["UnauthorizedResponse"]; }; }; - /** @description The server can not find requested resource. */ - 404: { - content: { - "application/json": components["schemas"]["NotFoundResponse"]; - }; - }; /** @description The user has sent too many requests in a given amount of time ("rate limiting").. */ 429: { content: { @@ -3645,19 +5667,38 @@ export interface paths { }; }; }; - delete: { + }; + "/v2/system_prompts/{id}": { + get: { parameters: { query: { version: "2023-11-22"; }; path: { - id: string; + id: number; }; }; responses: { - /** @description Success */ - 204: { - content: never; + /** @description Default Response */ + 200: { + content: { + "application/json": { + result: { + id: number; + name: string; + content: string; + /** Format: date-time */ + created_at: string; + /** @enum {string} */ + type: "private" | "system"; + author?: { + id: number; + first_name?: string; + last_name?: string; + }; + }; + }; + }; }; /** @description Server could not understand the request due to invalid syntax. In most cases relates with the schema validation. */ 400: { @@ -3697,20 +5738,20 @@ export interface paths { }; }; }; - patch: { + put: { parameters: { query: { version: "2023-11-22"; }; path: { - id: string; + id: number; }; }; - requestBody?: { + requestBody: { content: { "application/json": { - name?: string; - preferred?: boolean; + name: string; + content: string; }; }; }; @@ -3720,54 +5761,18 @@ export interface paths { content: { "application/json": { result: { - id: string; + id: number; name: string; - model_id: string; - model_name: string | null; - /** @enum {string} */ - status: "initializing" | "not_started" | "pending" | "halted" | "running" | "queued" | "completed" | "failed"; - status_message?: string | null; - tuning_type: string; - parameters?: Record; - preferred: boolean; - task_id: string; - task_name: string; - /** Format: date-time */ - started_at?: string | null; - /** Format: date-time */ - finished_at?: string | null; + content: string; /** Format: date-time */ created_at: string; - validation_files?: { - id: string; - file_name: string; - /** Format: date-time */ - created_at?: string; - }[] | null; - training_files?: { - id: string; - file_name: string; - /** Format: date-time */ - created_at?: string; - }[] | null; - evaluation_files?: { - id: string; - file_name: string; - /** Format: date-time */ - created_at?: string; - }[] | null; - datapoints?: { - loss: { - data: { - value: number; - step?: number; - epoch: number; - }; - /** Format: date-time */ - timestamp: string; - }[]; + /** @enum {string} */ + type: "private" | "system"; + author?: { + id: number; + first_name?: string; + last_name?: string; }; - vectors?: string | null; }; }; }; @@ -3810,79 +5815,19 @@ export interface paths { }; }; }; - }; - "/v2/tunes/import": { - post: { + delete: { parameters: { query: { version: "2023-11-22"; }; - }; - requestBody: { - content: { - "application/json": { - name: string; - file_id: string; - }; + path: { + id: number; }; }; responses: { - /** @description Default Response */ - 200: { - content: { - "application/json": { - result: { - id: string; - name: string; - model_id: string; - model_name: string | null; - /** @enum {string} */ - status: "initializing" | "not_started" | "pending" | "halted" | "running" | "queued" | "completed" | "failed"; - status_message?: string | null; - tuning_type: string; - parameters?: Record; - preferred: boolean; - task_id: string; - task_name: string; - /** Format: date-time */ - started_at?: string | null; - /** Format: date-time */ - finished_at?: string | null; - /** Format: date-time */ - created_at: string; - validation_files?: { - id: string; - file_name: string; - /** Format: date-time */ - created_at?: string; - }[] | null; - training_files?: { - id: string; - file_name: string; - /** Format: date-time */ - created_at?: string; - }[] | null; - evaluation_files?: { - id: string; - file_name: string; - /** Format: date-time */ - created_at?: string; - }[] | null; - datapoints?: { - loss: { - data: { - value: number; - step?: number; - epoch: number; - }; - /** Format: date-time */ - timestamp: string; - }[]; - }; - vectors?: string | null; - }; - }; - }; + /** @description Success */ + 204: { + content: never; }; /** @description Server could not understand the request due to invalid syntax. In most cases relates with the schema validation. */ 400: { @@ -3923,16 +5868,12 @@ export interface paths { }; }; }; - "/v2/tunes": { + "/v2/system_prompts": { get: { parameters: { query: { limit?: number; offset?: number; - status?: "initializing" | "not_started" | "pending" | "halted" | "running" | "queued" | "completed" | "failed"; - search?: string | null; - sort_by?: "status" | "created_at" | "name" | "id" | "model"; - direction?: "asc" | "desc"; version: "2023-11-22"; }; }; @@ -3941,57 +5882,89 @@ export interface paths { 200: { content: { "application/json": { - total_count: number; results: ({ - id: string; + id: number; name: string; - model_id: string; - model_name: string | null; - /** @enum {string} */ - status: "initializing" | "not_started" | "pending" | "halted" | "running" | "queued" | "completed" | "failed"; - status_message?: string | null; - tuning_type: string; - parameters?: Record; - preferred: boolean; - task_id: string; - task_name: string; - /** Format: date-time */ - started_at?: string | null; - /** Format: date-time */ - finished_at?: string | null; + content: string; /** Format: date-time */ created_at: string; - validation_files?: { - id: string; - file_name: string; - /** Format: date-time */ - created_at?: string; - }[] | null; - training_files?: { - id: string; - file_name: string; - /** Format: date-time */ - created_at?: string; - }[] | null; - evaluation_files?: { - id: string; - file_name: string; - /** Format: date-time */ - created_at?: string; - }[] | null; - datapoints?: { - loss: { - data: { - value: number; - step?: number; - epoch: number; - }; - /** Format: date-time */ - timestamp: string; - }[]; + /** @enum {string} */ + type: "private" | "system"; + author?: { + id: number; + first_name?: string; + last_name?: string; }; - vectors?: string | null; })[]; + total_count: number; + }; + }; + }; + /** @description Server could not understand the request due to invalid syntax. In most cases relates with the schema validation. */ + 400: { + content: { + "application/json": components["schemas"]["BadRequestResponse"]; + }; + }; + /** @description Unauthorized route access. */ + 401: { + content: { + "application/json": components["schemas"]["UnauthorizedResponse"]; + }; + }; + /** @description The user has sent too many requests in a given amount of time ("rate limiting").. */ + 429: { + content: { + "application/json": components["schemas"]["TooManyRequestsResponse"]; + }; + }; + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + content: { + "application/json": components["schemas"]["InternalServerErrorResponse"]; + }; + }; + /** @description The remote server is not ready to handle the request. */ + 503: { + content: { + "application/json": components["schemas"]["UnavailableResponse"]; + }; + }; + }; + }; + post: { + parameters: { + query: { + version: "2023-11-22"; + }; + }; + requestBody: { + content: { + "application/json": { + name: string; + content: string; + }; + }; + }; + responses: { + /** @description Default Response */ + 200: { + content: { + "application/json": { + result: { + id: number; + name: string; + content: string; + /** Format: date-time */ + created_at: string; + /** @enum {string} */ + type: "private" | "system"; + author?: { + id: number; + first_name?: string; + last_name?: string; + }; + }; }; }; }; @@ -4007,6 +5980,12 @@ export interface paths { "application/json": components["schemas"]["UnauthorizedResponse"]; }; }; + /** @description The server can not find requested resource. */ + 404: { + content: { + "application/json": components["schemas"]["NotFoundResponse"]; + }; + }; /** @description The user has sent too many requests in a given amount of time ("rate limiting").. */ 429: { content: { @@ -4027,34 +6006,15 @@ export interface paths { }; }; }; - post: { + }; + "/v2/requests/{id}/feedback": { + get: { parameters: { query: { version: "2023-11-22"; }; - }; - requestBody: { - content: { - "application/json": { - name: string; - model_id: string; - task_id: string; - training_file_ids: string[]; - validation_file_ids?: string[] | null; - evaluation_file_ids?: string[] | null; - tuning_type: string; - parameters?: ({ - batch_size?: number | null; - num_epochs?: number | null; - verbalizer?: string | null; - learning_rate?: number | null; - accumulate_steps?: number | null; - max_input_tokens?: number | null; - max_output_tokens?: number | null; - num_virtual_tokens?: number | null; - [key: string]: unknown; - }) | null; - }; + path: { + id: string; }; }; responses: { @@ -4063,54 +6023,17 @@ export interface paths { content: { "application/json": { result: { - id: string; - name: string; - model_id: string; - model_name: string | null; - /** @enum {string} */ - status: "initializing" | "not_started" | "pending" | "halted" | "running" | "queued" | "completed" | "failed"; - status_message?: string | null; - tuning_type: string; - parameters?: Record; - preferred: boolean; - task_id: string; - task_name: string; - /** Format: date-time */ - started_at?: string | null; - /** Format: date-time */ - finished_at?: string | null; + id: number; /** Format: date-time */ created_at: string; - validation_files?: { - id: string; - file_name: string; - /** Format: date-time */ - created_at?: string; - }[] | null; - training_files?: { - id: string; - file_name: string; - /** Format: date-time */ - created_at?: string; - }[] | null; - evaluation_files?: { - id: string; - file_name: string; - /** Format: date-time */ - created_at?: string; - }[] | null; - datapoints?: { - loss: { - data: { - value: number; - step?: number; - epoch: number; - }; - /** Format: date-time */ - timestamp: string; - }[]; - }; - vectors?: string | null; + /** Format: date-time */ + updated_at: string; + comment?: string | null; + categories: string[]; + api_request: string; + /** @enum {string|null} */ + vote?: "up" | "down" | null; + contact_consent: boolean; }; }; }; @@ -4153,36 +6076,24 @@ export interface paths { }; }; }; - }; - "/v2/text/moderations": { - post: { + put: { parameters: { query: { version: "2023-11-22"; }; + path: { + id: string; + }; }; requestBody: { content: { "application/json": { - input: string; - hap?: { - /** @default 0.75 */ - threshold?: number; - /** @default false */ - send_tokens?: boolean; - }; - stigma?: { - /** @default 0.75 */ - threshold?: number; - /** @default false */ - send_tokens?: boolean; - }; - implicit_hate?: { - /** @default 0.75 */ - threshold?: number; - /** @default false */ - send_tokens?: boolean; - }; + comment?: string; + categories?: ("inaccurate" | "not_relevant" | "offensive_harmful" | "knowledge_gap" | "other_content" | "too_long" | "too_short" | "wrong_tone" | "wrong_format" | "other_style" | "correct_content" | "correct_style")[]; + /** @enum {string} */ + vote?: "up" | "down"; + /** @default false */ + contact_consent: boolean; }; }; }; @@ -4191,50 +6102,19 @@ export interface paths { 200: { content: { "application/json": { - results: { - hap?: { - success: boolean; - score: number; - flagged: boolean; - position: { - start: number; - end: number; - }; - tokens?: { - token?: string; - index?: number; - score?: number; - }[]; - }[]; - stigma?: { - success: boolean; - score: number; - flagged: boolean; - position: { - start: number; - end: number; - }; - tokens?: { - token?: string; - index?: number; - score?: number; - }[]; - }[]; - implicit_hate?: { - success: boolean; - score: number; - flagged: boolean; - position: { - start: number; - end: number; - }; - tokens?: { - token?: string; - index?: number; - score?: number; - }[]; - }[]; - }[]; + result: { + id: number; + /** Format: date-time */ + created_at: string; + /** Format: date-time */ + updated_at: string; + comment?: string | null; + categories: string[]; + api_request: string; + /** @enum {string|null} */ + vote?: "up" | "down" | null; + contact_consent: boolean; + }; }; }; }; @@ -4276,75 +6156,24 @@ export interface paths { }; }; }; - }; - "/v2/text/generation/output": { post: { parameters: { query: { version: "2023-11-22"; }; + path: { + id: string; + }; }; - requestBody?: { + requestBody: { content: { "application/json": { - model_id?: string; - prompt_id?: string; - input?: string; - data?: { - example_file_ids?: string[]; - [key: string]: unknown; - }; - parameters?: ({ - beam_width?: number | null; - /** @enum {string|null} */ - decoding_method?: "greedy" | "sample" | null; - max_new_tokens?: number | null; - min_new_tokens?: number | null; - random_seed?: number | null; - stop_sequences?: string[] | null; - temperature?: number | null; - time_limit?: number | null; - top_k?: number | null; - top_p?: number | null; - typical_p?: number | null; - repetition_penalty?: number | null; - truncate_input_tokens?: number | null; - include_stop_sequence?: boolean; - return_options?: ({ - generated_tokens?: boolean | null; - input_text?: boolean | null; - input_tokens?: boolean | null; - input_parameters?: boolean | null; - token_logprobs?: boolean | null; - token_ranks?: boolean | null; - top_n_tokens?: number | null; - }) | null; - length_penalty?: ({ - decay_factor?: number | null; - start_index?: number | null; - }) | null; - }) | null; - moderations?: { - hap?: boolean | { - input?: boolean; - output?: boolean; - threshold?: number; - send_tokens?: boolean; - }; - stigma?: boolean | { - input?: boolean; - output?: boolean; - threshold?: number; - send_tokens?: boolean; - }; - implicit_hate?: boolean | { - input?: boolean; - output?: boolean; - threshold?: number; - send_tokens?: boolean; - }; - }; - use_default?: boolean | null; + comment?: string; + categories?: ("inaccurate" | "not_relevant" | "offensive_harmful" | "knowledge_gap" | "other_content" | "too_long" | "too_short" | "wrong_tone" | "wrong_format" | "other_style" | "correct_content" | "correct_style")[]; + /** @enum {string} */ + vote?: "up" | "down"; + /** @default false */ + contact_consent: boolean; }; }; }; @@ -4353,7 +6182,19 @@ export interface paths { 200: { content: { "application/json": { - results: string[]; + result: { + id: number; + /** Format: date-time */ + created_at: string; + /** Format: date-time */ + updated_at: string; + comment?: string | null; + categories: string[]; + api_request: string; + /** @enum {string|null} */ + vote?: "up" | "down" | null; + contact_consent: boolean; + }; }; }; }; @@ -4396,26 +6237,20 @@ export interface paths { }; }; }; - "/v2/text/generation/limits": { - get: { + "/v2/requests/{id}": { + delete: { parameters: { query: { version: "2023-11-22"; }; + path: { + id: string; + }; }; responses: { - /** @description Default Response */ - 200: { - content: { - "application/json": { - result: { - concurrency: { - limit: number; - remaining: number; - }; - }; - }; - }; + /** @description Success */ + 204: { + content: never; }; /** @description Server could not understand the request due to invalid syntax. In most cases relates with the schema validation. */ 400: { @@ -4429,6 +6264,18 @@ export interface paths { "application/json": components["schemas"]["UnauthorizedResponse"]; }; }; + /** @description The server can not find requested resource. */ + 404: { + content: { + "application/json": components["schemas"]["NotFoundResponse"]; + }; + }; + /** @description The user has sent too many requests in a given amount of time ("rate limiting").. */ + 429: { + content: { + "application/json": components["schemas"]["TooManyRequestsResponse"]; + }; + }; /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ 500: { content: { @@ -4444,160 +6291,48 @@ export interface paths { }; }; }; - "/v2/text/generation/comparison": { - post: { + "/v2/requests": { + get: { parameters: { query: { + limit?: number; + offset?: number; + status?: "success" | "error"; + origin?: "api" | "ui"; + before?: string; + after?: string; + endpoint?: ("generate" | "compare" | "chat") | (("generate" | "compare" | "chat")[]); + api?: "v0" | "v1" | "v2"; + date?: string; version: "2023-11-22"; }; }; - requestBody: { - content: { - "application/json": { - request: { - model_id?: string; - prompt_id?: string; - input: string; - data?: { - example_file_ids?: string[]; - [key: string]: unknown; - }; - parameters?: ({ - beam_width?: number | null; - /** @enum {string|null} */ - decoding_method?: "greedy" | "sample" | null; - max_new_tokens?: number | null; - min_new_tokens?: number | null; - random_seed?: number | null; - stop_sequences?: string[] | null; - temperature?: number | null; - time_limit?: number | null; - top_k?: number | null; - top_p?: number | null; - typical_p?: number | null; - repetition_penalty?: number | null; - truncate_input_tokens?: number | null; - include_stop_sequence?: boolean; - return_options?: ({ - generated_tokens?: boolean | null; - input_text?: boolean | null; - input_tokens?: boolean | null; - input_parameters?: boolean | null; - token_logprobs?: boolean | null; - token_ranks?: boolean | null; - top_n_tokens?: number | null; - }) | null; - length_penalty?: ({ - decay_factor?: number | null; - start_index?: number | null; - }) | null; - }) | null; - moderations?: { - hap?: boolean | { - input?: boolean; - output?: boolean; - threshold?: number; - send_tokens?: boolean; - }; - stigma?: boolean | { - input?: boolean; - output?: boolean; - threshold?: number; - send_tokens?: boolean; - }; - implicit_hate?: boolean | { - input?: boolean; - output?: boolean; - threshold?: number; - send_tokens?: boolean; - }; - }; - use_default?: boolean | null; - }; - name?: string; - compare_parameters: { - model_id?: string[]; - temperature?: number[]; - top_k?: number[]; - top_p?: number[]; - typical_p?: number[]; - repetition_penalty?: number[]; - length_penalty?: Record[]; - }; - }; - }; - }; responses: { /** @description Default Response */ 200: { content: { "application/json": { results: ({ - parameters: { - model_id?: string; - temperature?: number; - top_k?: number; - top_p?: number; - typical_p?: number; - repetition_penalty?: number; - length_penalty?: Record; - }; - error?: (({ - status_code: number; - message?: string; - extensions?: { - code?: string; - reason?: string; - }; - } | null) | ({ - status_code: number; - extensions?: { - code?: string; - reason?: string; - }; - } | null)) | null; - result?: ({ - id: string | null; - model_id: string; - /** Format: date-time */ - created_at: string; - input_parameters?: { - [key: string]: unknown; - } | null; - results: ({ - input_text?: string | null; - generated_text: string; - generated_token_count: number; - input_token_count?: number | null; - /** @enum {string} */ - stop_reason: "not_finished" | "max_tokens" | "eos_token" | "cancelled" | "time_limit" | "stop_sequence" | "token_limit" | "error"; - stop_sequence?: string | null; - generated_tokens?: (({ - text?: string | null; - logprob?: (number | null) | (string | null); - rank?: number | null; - top_tokens?: (({ - text?: string | null; - logprob?: (number | null) | (string | null); - })[]) | null; - })[]) | null; - input_tokens?: (({ - text?: string | null; - logprob?: (number | null) | (string | null); - rank?: number | null; - top_tokens?: (({ - text?: string | null; - logprob?: (number | null) | (string | null); - })[]) | null; - })[]) | null; - seed?: number | null; - moderation?: { - [key: string]: unknown; - } | null; - [key: string]: unknown; - })[]; + id: string; + duration: number; + /** Format: date-time */ + created_at: string; + request?: { + [key: string]: unknown; + } | null; + /** @enum {string} */ + status: "success" | "error"; + response?: { + [key: string]: unknown; + } | null; + version?: ({ + api?: string | null; + /** Format: date */ + date?: string | null; }) | null; + [key: string]: unknown; })[]; + total_count: number; }; }; }; @@ -4613,10 +6348,10 @@ export interface paths { "application/json": components["schemas"]["UnauthorizedResponse"]; }; }; - /** @description The server can not find requested resource. */ - 404: { + /** @description The user has sent too many requests in a given amount of time ("rate limiting").. */ + 429: { content: { - "application/json": components["schemas"]["NotFoundResponse"]; + "application/json": components["schemas"]["TooManyRequestsResponse"]; }; }; /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ @@ -4634,14 +6369,45 @@ export interface paths { }; }; }; - "/v2/text/extraction/limits": { + "/v2/models": { get: { parameters: { query: { + limit: number; + offset: number; + type?: "model" | "tune"; version: "2023-11-22"; }; }; responses: { + /** @description Default Response */ + 200: { + content: { + "application/json": { + results: ({ + id: string; + name: string; + size: string; + label: string; + warning?: string; + source_model_id?: string | null; + is_live: boolean; + facets?: ({ + id: string; + name: string; + /** @enum {string} */ + type: "language" | "industry" | "model_type"; + })[]; + token_limits: { + beam_width: number; + token_limit: number; + }[]; + task_ids: string[]; + })[]; + total_count: number; + }; + }; + }; /** @description Server could not understand the request due to invalid syntax. In most cases relates with the schema validation. */ 400: { content: { @@ -4654,6 +6420,12 @@ export interface paths { "application/json": components["schemas"]["UnauthorizedResponse"]; }; }; + /** @description The user has sent too many requests in a given amount of time ("rate limiting").. */ + 429: { + content: { + "application/json": components["schemas"]["TooManyRequestsResponse"]; + }; + }; /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ 500: { content: { @@ -4669,10 +6441,12 @@ export interface paths { }; }; }; - "/v2/text/embeddings/limits": { + "/v2/folders": { get: { parameters: { query: { + limit?: number; + offset?: number; version: "2023-11-22"; }; }; @@ -4681,12 +6455,14 @@ export interface paths { 200: { content: { "application/json": { - result: { - concurrency: { - limit: number; - remaining: number; - }; - }; + results: { + id: string; + name: string; + /** Format: date-time */ + created_at: string; + prompt_ids?: string[]; + }[]; + total_count: number; }; }; }; @@ -4699,7 +6475,13 @@ export interface paths { /** @description Unauthorized route access. */ 401: { content: { - "application/json": components["schemas"]["UnauthorizedResponse"]; + "application/json": components["schemas"]["UnauthorizedResponse"]; + }; + }; + /** @description The user has sent too many requests in a given amount of time ("rate limiting").. */ + 429: { + content: { + "application/json": components["schemas"]["TooManyRequestsResponse"]; }; }; /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ @@ -4716,8 +6498,6 @@ export interface paths { }; }; }; - }; - "/v2/text/embeddings": { post: { parameters: { query: { @@ -4727,11 +6507,7 @@ export interface paths { requestBody: { content: { "application/json": { - model_id: string; - input: string | string[]; - parameters?: ({ - truncate_input_tokens?: boolean | null; - }) | null; + name: string; }; }; }; @@ -4740,7 +6516,13 @@ export interface paths { 200: { content: { "application/json": { - results: number[][]; + result: { + id: string; + name: string; + /** Format: date-time */ + created_at: string; + prompt_ids?: string[]; + }; }; }; }; @@ -4762,6 +6544,12 @@ export interface paths { "application/json": components["schemas"]["NotFoundResponse"]; }; }; + /** @description The user has sent too many requests in a given amount of time ("rate limiting").. */ + 429: { + content: { + "application/json": components["schemas"]["TooManyRequestsResponse"]; + }; + }; /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ 500: { content: { @@ -4777,31 +6565,21 @@ export interface paths { }; }; }; - "/v2/tasks": { + "/v2/files/{id}/content": { get: { parameters: { query: { - tune?: boolean | null; version: "2023-11-22"; }; + path: { + id: string; + }; }; responses: { /** @description Default Response */ 200: { content: { - "application/json": { - results: { - id: string; - name: string; - json_example?: string; - jsonl_example?: string; - csv_example?: string; - verbalizer?: string; - file_format_id?: number; - tune: boolean; - categorization: boolean; - }[]; - }; + "application/octet-stream": Blob; }; }; /** @description Server could not understand the request due to invalid syntax. In most cases relates with the schema validation. */ @@ -4816,6 +6594,12 @@ export interface paths { "application/json": components["schemas"]["UnauthorizedResponse"]; }; }; + /** @description The server can not find requested resource. */ + 404: { + content: { + "application/json": components["schemas"]["NotFoundResponse"]; + }; + }; /** @description The user has sent too many requests in a given amount of time ("rate limiting").. */ 429: { content: { @@ -4837,27 +6621,35 @@ export interface paths { }; }; }; - "/v2/tags": { + "/v2/deployments/{id}": { get: { parameters: { query: { - limit?: number; - offset?: number; - type?: "language" | "industry" | "model_type"; version: "2023-11-22"; }; + path: { + id: string; + }; }; responses: { /** @description Default Response */ 200: { content: { "application/json": { - results: ({ - id: string; - name: string; - /** @enum {string} */ - type: "language" | "industry" | "model_type"; - })[]; + result: { + id: string; + tune_id?: string | null; + /** Format: date-time */ + created_at: string; + /** Format: date-time */ + updated_at: string; + /** Format: date-time */ + deployed_at?: string; + /** @enum {string} */ + status: "queued" | "initializing" | "ready" | "failed" | "expired"; + /** Format: date-time */ + expires_at?: string; + }; }; }; }; @@ -4873,6 +6665,12 @@ export interface paths { "application/json": components["schemas"]["UnauthorizedResponse"]; }; }; + /** @description The server can not find requested resource. */ + 404: { + content: { + "application/json": components["schemas"]["NotFoundResponse"]; + }; + }; /** @description The user has sent too many requests in a given amount of time ("rate limiting").. */ 429: { content: { @@ -4893,38 +6691,19 @@ export interface paths { }; }; }; - }; - "/v2/system_prompts/{id}": { - get: { + delete: { parameters: { query: { version: "2023-11-22"; }; path: { - id: number; + id: string; }; }; responses: { - /** @description Default Response */ - 200: { - content: { - "application/json": { - result: { - id: number; - name: string; - content: string; - /** Format: date-time */ - created_at: string; - /** @enum {string} */ - type: "private" | "system"; - author?: { - id: number; - first_name?: string; - last_name?: string; - }; - }; - }; - }; + /** @description Success */ + 204: { + content: never; }; /** @description Server could not understand the request due to invalid syntax. In most cases relates with the schema validation. */ 400: { @@ -4964,42 +6743,37 @@ export interface paths { }; }; }; - put: { + }; + "/v2/deployments": { + get: { parameters: { query: { + id?: string[] | string; + limit?: number; + offset?: number; version: "2023-11-22"; }; - path: { - id: number; - }; - }; - requestBody: { - content: { - "application/json": { - name: string; - content: string; - }; - }; }; responses: { /** @description Default Response */ 200: { content: { "application/json": { - result: { - id: number; - name: string; - content: string; - /** Format: date-time */ - created_at: string; - /** @enum {string} */ - type: "private" | "system"; - author?: { - id: number; - first_name?: string; - last_name?: string; - }; - }; + results: ({ + id: string; + tune_id?: string | null; + /** Format: date-time */ + created_at: string; + /** Format: date-time */ + updated_at: string; + /** Format: date-time */ + deployed_at?: string; + /** @enum {string} */ + status: "queued" | "initializing" | "ready" | "failed" | "expired"; + /** Format: date-time */ + expires_at?: string; + })[]; + total_count: number; }; }; }; @@ -5015,12 +6789,6 @@ export interface paths { "application/json": components["schemas"]["UnauthorizedResponse"]; }; }; - /** @description The server can not find requested resource. */ - 404: { - content: { - "application/json": components["schemas"]["NotFoundResponse"]; - }; - }; /** @description The user has sent too many requests in a given amount of time ("rate limiting").. */ 429: { content: { @@ -5041,19 +6809,40 @@ export interface paths { }; }; }; - delete: { + post: { parameters: { query: { version: "2023-11-22"; }; - path: { - id: number; + }; + requestBody: { + content: { + "application/json": { + tune_id: string; + }; }; }; responses: { - /** @description Success */ - 204: { - content: never; + /** @description Default Response */ + 201: { + content: { + "application/json": { + result: { + id: string; + tune_id?: string | null; + /** Format: date-time */ + created_at: string; + /** Format: date-time */ + updated_at: string; + /** Format: date-time */ + deployed_at?: string; + /** @enum {string} */ + status: "queued" | "initializing" | "ready" | "failed" | "expired"; + /** Format: date-time */ + expires_at?: string; + }; + }; + }; }; /** @description Server could not understand the request due to invalid syntax. In most cases relates with the schema validation. */ 400: { @@ -5094,12 +6883,10 @@ export interface paths { }; }; }; - "/v2/system_prompts": { + "/v2/beta/time_series/limits": { get: { parameters: { query: { - limit?: number; - offset?: number; version: "2023-11-22"; }; }; @@ -5108,21 +6895,12 @@ export interface paths { 200: { content: { "application/json": { - results: ({ - id: number; - name: string; - content: string; - /** Format: date-time */ - created_at: string; - /** @enum {string} */ - type: "private" | "system"; - author?: { - id: number; - first_name?: string; - last_name?: string; - }; - })[]; - total_count: number; + result: { + concurrency: { + limit: number; + remaining: number; + }; + }; }; }; }; @@ -5138,12 +6916,6 @@ export interface paths { "application/json": components["schemas"]["UnauthorizedResponse"]; }; }; - /** @description The user has sent too many requests in a given amount of time ("rate limiting").. */ - 429: { - content: { - "application/json": components["schemas"]["TooManyRequestsResponse"]; - }; - }; /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ 500: { content: { @@ -5158,6 +6930,8 @@ export interface paths { }; }; }; + }; + "/v2/beta/time_series/forecasting": { post: { parameters: { query: { @@ -5167,29 +6941,75 @@ export interface paths { requestBody: { content: { "application/json": { - name: string; - content: string; + model_id: string; + /** + * Data + * Format: byte + * @description Base64 encoded string of data. + */ + data: string; + /** + * Timestamp Column + * @description A valid column in the data that should be treated as the timestamp. + */ + timestamp_column: string; + /** + * Id Columns + * @description Columns that define a unique key for time series. + */ + id_columns?: string[]; + /** + * Target Columns + * @description An array of column headings which constitute the target variables. + */ + target_columns?: string[]; + /** + * Observable Columns + * @description An optional array of column headings which constitute the observable variables. + */ + observable_columns?: string[]; + /** + * Control Columns + * @description An optional array of column headings which constitute the control variables. + */ + control_columns?: string[]; + /** + * Conditional Columns + * @description An optional array of column headings which constitute the conditional variables. + */ + conditional_columns?: string[]; + /** + * Static Categorical Columns + * @description An optional array of column headings which constitute the static categorical variables. + */ + static_categorical_columns?: string[]; + /** + * Future Data + * Format: byte + * @description Base64 encoded string of data for future supporting features. + */ + future_data?: string; + /** + * Prediction Length + * @description The prediction length for the forecast. + */ + prediction_length?: number; + /** + * Context Length + * @description Context length of the forecast. + */ + context_length?: number; }; }; }; - responses: { - /** @description Default Response */ - 200: { - content: { - "application/json": { - result: { - id: number; - name: string; - content: string; - /** Format: date-time */ - created_at: string; - /** @enum {string} */ - type: "private" | "system"; - author?: { - id: number; - first_name?: string; - last_name?: string; - }; + responses: { + /** @description Default Response */ + 200: { + content: { + "application/json": { + result: { + /** Format: byte */ + predictions: string; }; }; }; @@ -5212,12 +7032,6 @@ export interface paths { "application/json": components["schemas"]["NotFoundResponse"]; }; }; - /** @description The user has sent too many requests in a given amount of time ("rate limiting").. */ - 429: { - content: { - "application/json": components["schemas"]["TooManyRequestsResponse"]; - }; - }; /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ 500: { content: { @@ -5233,14 +7047,23 @@ export interface paths { }; }; }; - "/v2/requests/{id}/feedback": { - get: { + "/v2/beta/text/sentence-similarity": { + post: { parameters: { query: { version: "2023-11-22"; }; - path: { - id: string; + }; + requestBody: { + content: { + "application/json": { + model_id: string; + source_sentence: string; + sentences: string[]; + parameters?: ({ + truncate_input_tokens?: boolean | null; + }) | null; + }; }; }; responses: { @@ -5248,18 +7071,9 @@ export interface paths { 200: { content: { "application/json": { - result: { - id: number; - /** Format: date-time */ - created_at: string; - /** Format: date-time */ - updated_at: string; - comment?: string | null; - categories: string[]; - api_request: string; - /** @enum {string|null} */ - vote?: "up" | "down" | null; - }; + results: { + score: number; + }[]; }; }; }; @@ -5281,12 +7095,6 @@ export interface paths { "application/json": components["schemas"]["NotFoundResponse"]; }; }; - /** @description The user has sent too many requests in a given amount of time ("rate limiting").. */ - 429: { - content: { - "application/json": components["schemas"]["TooManyRequestsResponse"]; - }; - }; /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ 500: { content: { @@ -5301,22 +7109,28 @@ export interface paths { }; }; }; - put: { + }; + "/v2/beta/text/rerank": { + post: { parameters: { query: { version: "2023-11-22"; }; - path: { - id: string; - }; }; - requestBody?: { + requestBody: { content: { "application/json": { - comment?: string; - categories?: ("inaccurate" | "not_relevant" | "offensive_harmful" | "knowledge_gap" | "other_content" | "too_long" | "too_short" | "wrong_tone" | "wrong_format" | "other_style" | "correct_content" | "correct_style")[]; - /** @enum {string} */ - vote?: "up" | "down"; + model_id: string; + query: string; + documents: string[]; + parameters?: ({ + truncate_input_tokens?: boolean | null; + return_options?: { + top_n?: number | null; + query?: boolean | null; + documents?: boolean | null; + }; + }) | null; }; }; }; @@ -5326,16 +7140,10 @@ export interface paths { content: { "application/json": { result: { - id: number; - /** Format: date-time */ - created_at: string; - /** Format: date-time */ - updated_at: string; - comment?: string | null; - categories: string[]; - api_request: string; - /** @enum {string|null} */ - vote?: "up" | "down" | null; + query?: string; + results: { + score: number; + }[]; }; }; }; @@ -5358,12 +7166,6 @@ export interface paths { "application/json": components["schemas"]["NotFoundResponse"]; }; }; - /** @description The user has sent too many requests in a given amount of time ("rate limiting").. */ - 429: { - content: { - "application/json": components["schemas"]["TooManyRequestsResponse"]; - }; - }; /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ 500: { content: { @@ -5378,22 +7180,23 @@ export interface paths { }; }; }; + }; + "/v2/beta/text/classification": { post: { parameters: { query: { version: "2023-11-22"; }; - path: { - id: string; - }; }; - requestBody?: { + requestBody: { content: { "application/json": { - comment?: string; - categories?: ("inaccurate" | "not_relevant" | "offensive_harmful" | "knowledge_gap" | "other_content" | "too_long" | "too_short" | "wrong_tone" | "wrong_format" | "other_style" | "correct_content" | "correct_style")[]; - /** @enum {string} */ - vote?: "up" | "down"; + model_id: string; + input: string; + data: { + text: string; + labels: string[]; + }[]; }; }; }; @@ -5403,16 +7206,14 @@ export interface paths { content: { "application/json": { result: { - id: number; - /** Format: date-time */ - created_at: string; - /** Format: date-time */ - updated_at: string; - comment?: string | null; - categories: string[]; - api_request: string; - /** @enum {string|null} */ - vote?: "up" | "down" | null; + predictions: string[]; + log_likelihood: { + [key: string]: number; + }; + /** @enum {string} */ + classification_type: "multi_class" | "multi_label" | "binary"; + model_input: string; + model_output: string; }; }; }; @@ -5456,10 +7257,12 @@ export interface paths { }; }; }; - "/v2/requests/{id}": { - delete: { + "/v2/beta/evaluations/{id}/instance_results": { + get: { parameters: { query: { + limit?: number; + offset?: number; version: "2023-11-22"; }; path: { @@ -5467,9 +7270,20 @@ export interface paths { }; }; responses: { - /** @description Success */ - 204: { - content: never; + /** @description Default Response */ + 200: { + content: { + "application/json": { + results: ({ + score: { + [key: string]: unknown; + }; + /** Generation Info */ + generation_info?: Record | null; + })[]; + total_count: number; + }; + }; }; /** @description Server could not understand the request due to invalid syntax. In most cases relates with the schema validation. */ 400: { @@ -5510,14 +7324,14 @@ export interface paths { }; }; }; - "/v2/requests/chat/{conversation_id}": { + "/v2/beta/evaluations/{id}": { get: { parameters: { query: { version: "2023-11-22"; }; path: { - conversation_id: string; + id: string; }; }; responses: { @@ -5525,129 +7339,50 @@ export interface paths { 200: { content: { "application/json": { - results: ({ + result: { + id: string; + name: string; + description?: string; + experiment_id: string | null; + model_id: string | null; + /** @enum {string} */ + status: "pending" | "queued" | "running" | "completed" | "failed"; + status_message?: string | null; + parameters?: Record; + prompt: { id: string; - duration: number; + name: string; + input?: string; + metadata?: { + [key: string]: unknown; + }; + }; + template_id: string; + template_name: string; + task_id: string | null; + /** Format: date-time */ + created_at: string; + /** Format: date-time */ + started_at?: string | null; + /** Format: date-time */ + finished_at?: string | null; + result: { + [key: string]: unknown; + } | null; + file: { + id: string; + file_name: string; /** Format: date-time */ created_at: string; - request: { - model_id?: string; - prompt_template_id?: string | null; - moderations?: { - hap?: boolean | { - input?: boolean; - output?: boolean; - threshold?: number; - send_tokens?: boolean; - }; - stigma?: boolean | { - input?: boolean; - output?: boolean; - threshold?: number; - send_tokens?: boolean; - }; - implicit_hate?: boolean | { - input?: boolean; - output?: boolean; - threshold?: number; - send_tokens?: boolean; - }; + bytes: number; + metadata?: { + stats: { + columns: string[]; + records_count: number; }; - messages?: ({ - /** @enum {string} */ - role: "user" | "system" | "assistant"; - content: string; - file_ids?: string[]; - })[]; - conversation_id?: string | null; - parent_id?: string | null; - prompt_id?: string; - /** @enum {string} */ - trim_method?: "floating_window" | "none"; - use_conversation_parameters?: boolean; - parameters?: ({ - beam_width?: number | null; - /** @enum {string|null} */ - decoding_method?: "greedy" | "sample" | null; - max_new_tokens?: number | null; - min_new_tokens?: number | null; - random_seed?: number | null; - stop_sequences?: string[] | null; - temperature?: number | null; - time_limit?: number | null; - top_k?: number | null; - top_p?: number | null; - typical_p?: number | null; - repetition_penalty?: number | null; - truncate_input_tokens?: number | null; - include_stop_sequence?: boolean; - return_options?: ({ - generated_tokens?: boolean | null; - input_text?: boolean | null; - input_tokens?: boolean | null; - input_parameters?: boolean | null; - token_logprobs?: boolean | null; - token_ranks?: boolean | null; - top_n_tokens?: number | null; - }) | null; - length_penalty?: ({ - decay_factor?: number | null; - start_index?: number | null; - }) | null; - }) | null; }; - /** @enum {string} */ - status: "success" | "error"; - response: { - id?: string | null; - model_id?: string; - /** Format: date-time */ - created_at?: string; - input_parameters?: { - [key: string]: unknown; - } | null; - results: ({ - input_text?: string | null; - generated_text: string; - generated_token_count: number; - input_token_count?: number | null; - /** @enum {string} */ - stop_reason: "not_finished" | "max_tokens" | "eos_token" | "cancelled" | "time_limit" | "stop_sequence" | "token_limit" | "error"; - stop_sequence?: string | null; - generated_tokens?: (({ - text?: string | null; - logprob?: (number | null) | (string | null); - rank?: number | null; - top_tokens?: (({ - text?: string | null; - logprob?: (number | null) | (string | null); - })[]) | null; - })[]) | null; - input_tokens?: (({ - text?: string | null; - logprob?: (number | null) | (string | null); - rank?: number | null; - top_tokens?: (({ - text?: string | null; - logprob?: (number | null) | (string | null); - })[]) | null; - })[]) | null; - seed?: number | null; - moderation?: { - [key: string]: unknown; - } | null; - [key: string]: unknown; - })[]; - conversation_id: string; - }; - version?: ({ - api?: string | null; - /** Format: date */ - date?: string | null; - }) | null; - parent_id?: string | null; - [key: string]: unknown; - })[]; + } | null; + }; }; }; }; @@ -5689,19 +7424,94 @@ export interface paths { }; }; }; - delete: { + delete: { + parameters: { + query: { + version: "2023-11-22"; + }; + path: { + id: string; + }; + }; + responses: { + /** @description Success */ + 204: { + content: never; + }; + /** @description Server could not understand the request due to invalid syntax. In most cases relates with the schema validation. */ + 400: { + content: { + "application/json": components["schemas"]["BadRequestResponse"]; + }; + }; + /** @description Unauthorized route access. */ + 401: { + content: { + "application/json": components["schemas"]["UnauthorizedResponse"]; + }; + }; + /** @description The server can not find requested resource. */ + 404: { + content: { + "application/json": components["schemas"]["NotFoundResponse"]; + }; + }; + /** @description The user has sent too many requests in a given amount of time ("rate limiting").. */ + 429: { + content: { + "application/json": components["schemas"]["TooManyRequestsResponse"]; + }; + }; + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + content: { + "application/json": components["schemas"]["InternalServerErrorResponse"]; + }; + }; + /** @description The remote server is not ready to handle the request. */ + 503: { + content: { + "application/json": components["schemas"]["UnavailableResponse"]; + }; + }; + }; + }; + }; + "/v2/beta/evaluations/templates/{id}": { + get: { parameters: { query: { version: "2023-11-22"; }; path: { - conversation_id: string; + id: string; }; }; responses: { - /** @description Success */ - 204: { - content: never; + /** @description Default Response */ + 200: { + content: { + "application/json": { + result: { + id: string; + task?: { + id: string; + name: string; + parent_task?: { + id: string; + name: string; + }; + }; + default_prompt_ids?: string[]; + name: string; + metrics: Record[]; + postprocessors: string[]; + dataset_fields: { + [key: string]: unknown; + }; + }; + }; + }; }; /** @description Server could not understand the request due to invalid syntax. In most cases relates with the schema validation. */ 400: { @@ -5742,19 +7552,10 @@ export interface paths { }; }; }; - "/v2/requests": { + "/v2/beta/evaluations/templates": { get: { parameters: { query: { - limit?: number; - offset?: number; - status?: "success" | "error"; - origin?: "api" | "ui"; - before?: string; - after?: string; - endpoint?: ("generate" | "compare" | "chat") | (("generate" | "compare" | "chat")[]); - api?: "v0" | "v1" | "v2"; - date?: string; version: "2023-11-22"; }; }; @@ -5763,27 +7564,24 @@ export interface paths { 200: { content: { "application/json": { - results: ({ + results: { id: string; - duration: number; - /** Format: date-time */ - created_at: string; - request?: { - [key: string]: unknown; - } | null; - /** @enum {string} */ - status: "success" | "error"; - response?: { + task?: { + id: string; + name: string; + parent_task?: { + id: string; + name: string; + }; + }; + default_prompt_ids?: string[]; + name: string; + metrics: Record[]; + postprocessors: string[]; + dataset_fields: { [key: string]: unknown; - } | null; - version?: ({ - api?: string | null; - /** Format: date */ - date?: string | null; - }) | null; - [key: string]: unknown; - })[]; - total_count: number; + }; + }[]; }; }; }; @@ -5820,40 +7618,75 @@ export interface paths { }; }; }; - "/v2/models": { - get: { + "/v2/beta/evaluations/preview": { + post: { parameters: { query: { - limit: number; - offset: number; - type?: "model" | "tune"; + limit?: number; version: "2023-11-22"; }; }; + requestBody: { + content: { + "application/json": { + name: string; + description?: string; + experiment_id?: string; + template_id: string; + prompt_id: string; + model_id?: string; + parameters?: ({ + beam_width?: number | null; + /** @enum {string|null} */ + decoding_method?: "greedy" | "sample" | null; + max_new_tokens?: number | null; + min_new_tokens?: number | null; + random_seed?: number | null; + stop_sequences?: string[] | null; + temperature?: number | null; + time_limit?: number | null; + top_k?: number | null; + top_p?: number | null; + typical_p?: number | null; + repetition_penalty?: number | null; + truncate_input_tokens?: number | null; + include_stop_sequence?: boolean; + return_options?: ({ + generated_tokens?: boolean | null; + input_text?: boolean | null; + input_tokens?: boolean | null; + input_parameters?: boolean | null; + token_logprobs?: boolean | null; + token_ranks?: boolean | null; + top_n_tokens?: number | null; + }) | null; + length_penalty?: ({ + decay_factor?: number | null; + start_index?: number | null; + }) | null; + }) | null; + dataset_file_id: string; + field_operations?: ({ + /** @enum {string} */ + type: "rename_fields" | "add_fields" | "shuffle"; + [key: string]: unknown; + })[]; + metrics: string[]; + postprocessors?: string[]; + }; + }; + }; responses: { /** @description Default Response */ 200: { content: { "application/json": { results: ({ - id: string; - name: string; - size: string; - label: string; - warning?: string; - source_model_id?: string | null; - is_live: boolean; - facets?: ({ - id: string; - name: string; - /** @enum {string} */ - type: "language" | "industry" | "model_type"; - })[]; - token_limits: { - beam_width: number; - token_limit: number; - }[]; - task_ids: string[]; + score: { + [key: string]: unknown; + }; + /** Generation Info */ + generation_info?: Record | null; })[]; total_count: number; }; @@ -5871,6 +7704,12 @@ export interface paths { "application/json": components["schemas"]["UnauthorizedResponse"]; }; }; + /** @description The server can not find requested resource. */ + 404: { + content: { + "application/json": components["schemas"]["NotFoundResponse"]; + }; + }; /** @description The user has sent too many requests in a given amount of time ("rate limiting").. */ 429: { content: { @@ -5892,12 +7731,10 @@ export interface paths { }; }; }; - "/v2/folders": { + "/v2/beta/evaluations/limits": { get: { parameters: { query: { - limit?: number; - offset?: number; version: "2023-11-22"; }; }; @@ -5906,14 +7743,101 @@ export interface paths { 200: { content: { "application/json": { - results: { + result: { + concurrency: { + limit: number; + remaining: number; + }; + }; + }; + }; + }; + /** @description Server could not understand the request due to invalid syntax. In most cases relates with the schema validation. */ + 400: { + content: { + "application/json": components["schemas"]["BadRequestResponse"]; + }; + }; + /** @description Unauthorized route access. */ + 401: { + content: { + "application/json": components["schemas"]["UnauthorizedResponse"]; + }; + }; + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + content: { + "application/json": components["schemas"]["InternalServerErrorResponse"]; + }; + }; + /** @description The remote server is not ready to handle the request. */ + 503: { + content: { + "application/json": components["schemas"]["UnavailableResponse"]; + }; + }; + }; + }; + }; + "/v2/beta/evaluations/experiments/{id}": { + get: { + parameters: { + query: { + version: "2023-11-22"; + }; + path: { + id: string; + }; + }; + responses: { + /** @description Default Response */ + 200: { + content: { + "application/json": { + result: { + id: string; + name: string; + description?: string; + experiment_id: string | null; + model_id: string | null; + /** @enum {string} */ + status: "pending" | "queued" | "running" | "completed" | "failed"; + status_message?: string | null; + parameters?: Record; + prompt: { id: string; name: string; + input?: string; + metadata?: { + [key: string]: unknown; + }; + }; + template_id: string; + template_name: string; + task_id: string | null; + /** Format: date-time */ + created_at: string; + /** Format: date-time */ + started_at?: string | null; + /** Format: date-time */ + finished_at?: string | null; + result: { + [key: string]: unknown; + } | null; + file: { + id: string; + file_name: string; /** Format: date-time */ created_at: string; - prompt_ids?: string[]; - }[]; - total_count: number; + bytes: number; + metadata?: { + stats: { + columns: string[]; + records_count: number; + }; + }; + } | null; + }; }; }; }; @@ -5929,6 +7853,12 @@ export interface paths { "application/json": components["schemas"]["UnauthorizedResponse"]; }; }; + /** @description The server can not find requested resource. */ + 404: { + content: { + "application/json": components["schemas"]["NotFoundResponse"]; + }; + }; /** @description The user has sent too many requests in a given amount of time ("rate limiting").. */ 429: { content: { @@ -5949,33 +7879,19 @@ export interface paths { }; }; }; - post: { + delete: { parameters: { query: { version: "2023-11-22"; }; - }; - requestBody: { - content: { - "application/json": { - name: string; - }; + path: { + id: string; }; }; responses: { - /** @description Default Response */ - 200: { - content: { - "application/json": { - result: { - id: string; - name: string; - /** Format: date-time */ - created_at: string; - prompt_ids?: string[]; - }; - }; - }; + /** @description Success */ + 204: { + content: never; }; /** @description Server could not understand the request due to invalid syntax. In most cases relates with the schema validation. */ 400: { @@ -6016,21 +7932,54 @@ export interface paths { }; }; }; - "/v2/files/{id}/content": { + "/v2/beta/evaluations/experiments": { get: { parameters: { query: { + limit?: number; + offset?: number; + sort_by?: "name" | "id" | "template"; + direction?: "asc" | "desc"; version: "2023-11-22"; }; - path: { - id: string; - }; }; responses: { /** @description Default Response */ 200: { content: { - "application/octet-stream": Blob; + "application/json": { + results: ({ + id: string; + name: string; + description?: string; + template_id: string; + /** Format: date-time */ + created_at: string; + evaluations_count: number; + file?: { + id: string; + file_name: string; + /** Format: date-time */ + created_at: string; + bytes: number; + metadata?: { + stats: { + columns: string[]; + records_count: number; + }; + }; + } | null; + task: { + id: string; + name: string; + parent_task?: { + id: string; + name: string; + }; + }; + })[]; + total_count: number; + }; }; }; /** @description Server could not understand the request due to invalid syntax. In most cases relates with the schema validation. */ @@ -6045,12 +7994,6 @@ export interface paths { "application/json": components["schemas"]["UnauthorizedResponse"]; }; }; - /** @description The server can not find requested resource. */ - 404: { - content: { - "application/json": components["schemas"]["NotFoundResponse"]; - }; - }; /** @description The user has sent too many requests in a given amount of time ("rate limiting").. */ 429: { content: { @@ -6071,8 +8014,6 @@ export interface paths { }; }; }; - }; - "/v2/beta/text/sentence-similarity": { post: { parameters: { query: { @@ -6082,12 +8023,10 @@ export interface paths { requestBody: { content: { "application/json": { - model_id: string; - source_sentence: string; - sentences: string[]; - parameters?: ({ - truncate_input_tokens?: boolean | null; - }) | null; + name: string; + description?: string; + template_id: string; + dataset_file_id: string; }; }; }; @@ -6096,9 +8035,36 @@ export interface paths { 200: { content: { "application/json": { - results: { - score: number; - }[]; + result: { + id: string; + name: string; + description?: string; + template_id: string; + /** Format: date-time */ + created_at: string; + evaluations_count: number; + file?: { + id: string; + file_name: string; + /** Format: date-time */ + created_at: string; + bytes: number; + metadata?: { + stats: { + columns: string[]; + records_count: number; + }; + }; + } | null; + task: { + id: string; + name: string; + parent_task?: { + id: string; + name: string; + }; + }; + }; }; }; }; @@ -6120,6 +8086,12 @@ export interface paths { "application/json": components["schemas"]["NotFoundResponse"]; }; }; + /** @description The user has sent too many requests in a given amount of time ("rate limiting").. */ + 429: { + content: { + "application/json": components["schemas"]["TooManyRequestsResponse"]; + }; + }; /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ 500: { content: { @@ -6135,41 +8107,68 @@ export interface paths { }; }; }; - "/v2/beta/text/rerank": { - post: { + "/v2/beta/evaluations": { + get: { parameters: { query: { + limit?: number; + offset?: number; + sort_by?: "name" | "id" | "template"; + direction?: "asc" | "desc"; + experiment_id?: string; version: "2023-11-22"; }; }; - requestBody: { - content: { - "application/json": { - model_id: string; - query: string; - documents: string[]; - parameters?: ({ - truncate_input_tokens?: boolean | null; - return_options?: { - top_n?: number | null; - query?: boolean | null; - documents?: boolean | null; - }; - }) | null; - }; - }; - }; responses: { /** @description Default Response */ 200: { content: { "application/json": { - result: { - query?: string; - results: { - score: number; - }[]; - }; + results: ({ + id: string; + name: string; + description?: string; + experiment_id: string | null; + model_id: string | null; + /** @enum {string} */ + status: "pending" | "queued" | "running" | "completed" | "failed"; + status_message?: string | null; + parameters?: Record; + prompt: { + id: string; + name: string; + input?: string; + metadata?: { + [key: string]: unknown; + }; + }; + template_id: string; + template_name: string; + task_id: string | null; + /** Format: date-time */ + created_at: string; + /** Format: date-time */ + started_at?: string | null; + /** Format: date-time */ + finished_at?: string | null; + result: { + [key: string]: unknown; + } | null; + file: { + id: string; + file_name: string; + /** Format: date-time */ + created_at: string; + bytes: number; + metadata?: { + stats: { + columns: string[]; + records_count: number; + }; + }; + } | null; + })[]; + total_count: number; }; }; }; @@ -6185,10 +8184,10 @@ export interface paths { "application/json": components["schemas"]["UnauthorizedResponse"]; }; }; - /** @description The server can not find requested resource. */ - 404: { + /** @description The user has sent too many requests in a given amount of time ("rate limiting").. */ + 429: { content: { - "application/json": components["schemas"]["NotFoundResponse"]; + "application/json": components["schemas"]["TooManyRequestsResponse"]; }; }; /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ @@ -6205,8 +8204,6 @@ export interface paths { }; }; }; - }; - "/v2/beta/text/classification": { post: { parameters: { query: { @@ -6216,12 +8213,50 @@ export interface paths { requestBody: { content: { "application/json": { - model_id: string; - input: string; - data: { - text: string; - labels: string[]; - }[]; + name: string; + description?: string; + experiment_id?: string; + template_id: string; + prompt_id: string; + model_id?: string; + parameters?: ({ + beam_width?: number | null; + /** @enum {string|null} */ + decoding_method?: "greedy" | "sample" | null; + max_new_tokens?: number | null; + min_new_tokens?: number | null; + random_seed?: number | null; + stop_sequences?: string[] | null; + temperature?: number | null; + time_limit?: number | null; + top_k?: number | null; + top_p?: number | null; + typical_p?: number | null; + repetition_penalty?: number | null; + truncate_input_tokens?: number | null; + include_stop_sequence?: boolean; + return_options?: ({ + generated_tokens?: boolean | null; + input_text?: boolean | null; + input_tokens?: boolean | null; + input_parameters?: boolean | null; + token_logprobs?: boolean | null; + token_ranks?: boolean | null; + top_n_tokens?: number | null; + }) | null; + length_penalty?: ({ + decay_factor?: number | null; + start_index?: number | null; + }) | null; + }) | null; + dataset_file_id: string; + field_operations?: ({ + /** @enum {string} */ + type: "rename_fields" | "add_fields" | "shuffle"; + [key: string]: unknown; + })[]; + metrics: string[]; + postprocessors?: string[]; }; }; }; @@ -6231,14 +8266,48 @@ export interface paths { content: { "application/json": { result: { - predictions: string[]; - log_likelihood: { - [key: string]: number; - }; + id: string; + name: string; + description?: string; + experiment_id: string | null; + model_id: string | null; /** @enum {string} */ - classification_type: "multi_class" | "multi_label" | "binary"; - model_input: string; - model_output: string; + status: "pending" | "queued" | "running" | "completed" | "failed"; + status_message?: string | null; + parameters?: Record; + prompt: { + id: string; + name: string; + input?: string; + metadata?: { + [key: string]: unknown; + }; + }; + template_id: string; + template_name: string; + task_id: string | null; + /** Format: date-time */ + created_at: string; + /** Format: date-time */ + started_at?: string | null; + /** Format: date-time */ + finished_at?: string | null; + result: { + [key: string]: unknown; + } | null; + file: { + id: string; + file_name: string; + /** Format: date-time */ + created_at: string; + bytes: number; + metadata?: { + stats: { + columns: string[]; + records_count: number; + }; + }; + } | null; }; }; }; diff --git a/src/langchain/llm-chat.ts b/src/langchain/llm-chat.ts index b655942..8868c9f 100644 --- a/src/langchain/llm-chat.ts +++ b/src/langchain/llm-chat.ts @@ -134,7 +134,7 @@ export class GenAIChatModel extends BaseChatModel { await _runManager?.handleText(result.generated_text); } } - if (output.moderation) { + if (output.moderations) { yield new ChatGenerationChunk({ message: new AIMessageChunk({ content: '', @@ -142,7 +142,7 @@ export class GenAIChatModel extends BaseChatModel { text: '', generationInfo: { conversationId: output.conversation_id, - moderation: output.moderation, + moderation: output.moderations, }, }); await _runManager?.handleText(''); diff --git a/src/langchain/llm.ts b/src/langchain/llm.ts index cfb3f6a..c62afc6 100644 --- a/src/langchain/llm.ts +++ b/src/langchain/llm.ts @@ -122,11 +122,11 @@ export class GenAIModel extends BaseLLM { void runManager?.handleText(generated_text); } } - if (response.moderation) { + if (response.moderations) { yield new GenerationChunk({ text: '', generationInfo: { - moderation: response.moderation, + moderations: response.moderations, }, }); void runManager?.handleText(''); @@ -160,6 +160,7 @@ export class GenAIModel extends BaseLLM { }, { input }, ); + console.info(rest); return { ...(prompt_id ? { prompt_id } : { model_id }), ...rest, diff --git a/src/services/FileService.ts b/src/services/FileService.ts index 9d50c5d..5ec55ef 100644 --- a/src/services/FileService.ts +++ b/src/services/FileService.ts @@ -32,7 +32,7 @@ export class FileService extends BaseService { }, params: { query: { - version: '2023-12-15', + version: '2024-05-13', }, }, }), @@ -49,7 +49,7 @@ export class FileService extends BaseService { params: { path: input, query: { - version: '2023-12-15', + version: '2024-05-13', }, }, }), @@ -101,7 +101,7 @@ export class FileService extends BaseService { params: { query: { ...input, - version: '2023-12-15', + version: '2024-05-13', }, }, }), diff --git a/src/services/PromptService.ts b/src/services/PromptService.ts index 61f77dd..627f03d 100644 --- a/src/services/PromptService.ts +++ b/src/services/PromptService.ts @@ -24,7 +24,7 @@ export class PromptService extends BaseService { params: { query: { ...input, - version: '2024-01-10', + version: '2024-03-19', }, }, }), @@ -40,7 +40,7 @@ export class PromptService extends BaseService { ...opts, params: { query: { - version: '2024-01-10', + version: '2024-03-19', }, path: input, }, @@ -58,7 +58,7 @@ export class PromptService extends BaseService { body: input, params: { query: { - version: '2024-01-10', + version: '2024-03-19', }, }, }), diff --git a/src/services/RequestService.ts b/src/services/RequestService.ts index 4516d97..a8345d7 100644 --- a/src/services/RequestService.ts +++ b/src/services/RequestService.ts @@ -43,7 +43,7 @@ export class RequestService extends BaseService { return clientErrorWrapper( this._client.GET('/v2/requests/chat/{conversation_id}', { ...opts, - params: { path: input, query: { version: '2023-11-22' } }, + params: { path: input, query: { version: '2024-03-19' } }, }), ); } diff --git a/src/services/text/TextChatService.ts b/src/services/text/TextChatService.ts index d361cd7..f752358 100644 --- a/src/services/text/TextChatService.ts +++ b/src/services/text/TextChatService.ts @@ -30,7 +30,7 @@ export class TextChatService extends BaseService { clientErrorWrapper( this._client.POST('/v2/text/chat', { ...opts, - params: { query: { version: '2024-01-10' } }, + params: { query: { version: '2024-03-19' } }, body: input, }), ), @@ -45,7 +45,7 @@ export class TextChatService extends BaseService { return this._limiter.execute( async () => this._streamingClient.stream({ - url: '/v2/text/chat_stream?version=2024-01-10', + url: '/v2/text/chat_stream?version=2024-03-19', body: input, signal: opts?.signal, }), diff --git a/src/services/text/TextEmbeddingService.ts b/src/services/text/TextEmbeddingService.ts index a9e3772..568df4c 100644 --- a/src/services/text/TextEmbeddingService.ts +++ b/src/services/text/TextEmbeddingService.ts @@ -27,7 +27,7 @@ export class TextEmbeddingService extends BaseService { clientErrorWrapper( this._client.POST('/v2/text/embeddings', { ...opts, - params: { query: { version: '2023-11-22' } }, + params: { query: { version: '2024-04-15' } }, body: input, }), ), diff --git a/src/services/text/TextGenerationService.ts b/src/services/text/TextGenerationService.ts index 1d695c5..cf55029 100644 --- a/src/services/text/TextGenerationService.ts +++ b/src/services/text/TextGenerationService.ts @@ -30,7 +30,7 @@ export class TextGenerationService extends BaseService { clientErrorWrapper( this._client.POST('/v2/text/generation', { ...opts, - params: { query: { version: '2024-01-10' } }, + params: { query: { version: '2024-03-19' } }, body: input, }), ), @@ -45,7 +45,7 @@ export class TextGenerationService extends BaseService { return this._limiter.execute( async () => this._streamingClient.stream({ - url: '/v2/text/generation_stream?version=2023-11-22', + url: '/v2/text/generation_stream?version=2024-03-19', body: input, signal: opts?.signal, }), diff --git a/tests/e2e/client.test.ts b/tests/e2e/client.test.ts index d70bc09..a758088 100644 --- a/tests/e2e/client.test.ts +++ b/tests/e2e/client.test.ts @@ -55,7 +55,7 @@ describe('client', () => { expect(result.input_token_count).not.toBeNegative(); expect(result.stop_reason).toSatisfy(isNumberOrNull); }); - expect(chunk.moderation).toBeOneOf([ + expect(chunk.moderations).toBeOneOf([ undefined, expect.objectContaining({ hap: expect.any(Array) }), ]); @@ -76,7 +76,7 @@ describe('client', () => { for await (const chunk of stream) { validateStreamChunk(chunk); - if (chunk.moderation) { + if (chunk.moderations) { return; } } diff --git a/tests/e2e/langchain/llm-chat.test.ts b/tests/e2e/langchain/llm-chat.test.ts index 27602ba..2444380 100644 --- a/tests/e2e/langchain/llm-chat.test.ts +++ b/tests/e2e/langchain/llm-chat.test.ts @@ -6,7 +6,7 @@ import { GenAIChatModel } from '../../../src/langchain/index.js'; describe('LangChain Chat', () => { const makeModel = (conversation_id?: string) => new GenAIChatModel({ - model_id: 'meta-llama/llama-2-70b-chat', + model_id: 'meta-llama/llama-3-70b-instruct', conversation_id, configuration: { endpoint: process.env.ENDPOINT,