From 6dd3ae078ac5a8305f8d398acd68e9e5369bfd1c Mon Sep 17 00:00:00 2001 From: Nathan Sarrazin Date: Tue, 17 Dec 2024 08:55:20 +0000 Subject: [PATCH] fix: make single step forcing optional on cohere endpoint type --- src/lib/server/endpoints/cohere/endpointCohere.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/server/endpoints/cohere/endpointCohere.ts b/src/lib/server/endpoints/cohere/endpointCohere.ts index 45076d70af3..aa15b75eb42 100644 --- a/src/lib/server/endpoints/cohere/endpointCohere.ts +++ b/src/lib/server/endpoints/cohere/endpointCohere.ts @@ -15,12 +15,14 @@ export const endpointCohereParametersSchema = z.object({ apiKey: z.string().default(env.COHERE_API_TOKEN), clientName: z.string().optional(), raw: z.boolean().default(false), + forceSingleStep: z.boolean().default(true), }); export async function endpointCohere( input: z.input ): Promise { - const { apiKey, clientName, model, raw } = endpointCohereParametersSchema.parse(input); + const { apiKey, clientName, model, raw, forceSingleStep } = + endpointCohereParametersSchema.parse(input); let cohere: CohereClient; @@ -62,7 +64,7 @@ export async function endpointCohere( }); stream = await cohere.chatStream({ - forceSingleStep: true, + forceSingleStep, message: prompt, rawPrompting: true, model: model.id ?? model.name,