From deee578971d9ad38c87676368d63121f12848df3 Mon Sep 17 00:00:00 2001 From: kosabogi <105062005+kosabogi@users.noreply.github.com> Date: Tue, 15 Jul 2025 11:13:45 +0200 Subject: [PATCH] Updates Cohere inference API (#4896) (cherry picked from commit a7876a88620687d84e4cf83e9be1323531463d88) --- output/typescript/types.ts | 4 ++-- specification/inference/_types/CommonTypes.ts | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 3d4b61afaf..20a986965a 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -13663,7 +13663,7 @@ export type InferenceCohereInputType = 'classification' | 'clustering' | 'ingest export interface InferenceCohereServiceSettings { api_key: string embedding_type?: InferenceCohereEmbeddingType - model_id?: string + model_id: string rate_limit?: InferenceRateLimitSetting similarity?: InferenceCohereSimilarityType } @@ -13673,7 +13673,7 @@ export type InferenceCohereServiceType = 'cohere' export type InferenceCohereSimilarityType = 'cosine' | 'dot_product' | 'l2_norm' export interface InferenceCohereTaskSettings { - input_type?: InferenceCohereInputType + input_type: InferenceCohereInputType return_documents?: boolean top_n?: integer truncate?: InferenceCohereTruncateType diff --git a/specification/inference/_types/CommonTypes.ts b/specification/inference/_types/CommonTypes.ts index e097e0cd6a..5f26a7675b 100644 --- a/specification/inference/_types/CommonTypes.ts +++ b/specification/inference/_types/CommonTypes.ts @@ -670,10 +670,8 @@ export class CohereServiceSettings { * * For the available `completion` models, refer to the [Cohere command docs](https://docs.cohere.com/docs/models#command). * * For the available `rerank` models, refer to the [Cohere rerank docs](https://docs.cohere.com/reference/rerank-1). * * For the available `text_embedding` models, refer to [Cohere embed docs](https://docs.cohere.com/reference/embed). - * - * The default value for a text embedding task is `embed-english-v2.0`. */ - model_id?: string + model_id: string /** * This setting helps to minimize the number of rate limit errors returned from Cohere. * By default, the `cohere` service sets the number of requests allowed per minute to 10000. @@ -736,7 +734,7 @@ export class CohereTaskSettings { * * IMPORTANT: The `input_type` field is required when using embedding models `v3` and higher. */ - input_type?: CohereInputType + input_type: CohereInputType /** * For a `rerank` task, return doc text within the results. */