Spaces:
Paused
Paused
fix: make single step forcing optional on cohere endpoint type
Browse files
src/lib/server/endpoints/cohere/endpointCohere.ts
CHANGED
|
@@ -15,12 +15,14 @@ export const endpointCohereParametersSchema = z.object({
|
|
| 15 |
apiKey: z.string().default(env.COHERE_API_TOKEN),
|
| 16 |
clientName: z.string().optional(),
|
| 17 |
raw: z.boolean().default(false),
|
|
|
|
| 18 |
});
|
| 19 |
|
| 20 |
export async function endpointCohere(
|
| 21 |
input: z.input<typeof endpointCohereParametersSchema>
|
| 22 |
): Promise<Endpoint> {
|
| 23 |
-
const { apiKey, clientName, model, raw } =
|
|
|
|
| 24 |
|
| 25 |
let cohere: CohereClient;
|
| 26 |
|
|
@@ -62,7 +64,7 @@ export async function endpointCohere(
|
|
| 62 |
});
|
| 63 |
|
| 64 |
stream = await cohere.chatStream({
|
| 65 |
-
forceSingleStep
|
| 66 |
message: prompt,
|
| 67 |
rawPrompting: true,
|
| 68 |
model: model.id ?? model.name,
|
|
|
|
| 15 |
apiKey: z.string().default(env.COHERE_API_TOKEN),
|
| 16 |
clientName: z.string().optional(),
|
| 17 |
raw: z.boolean().default(false),
|
| 18 |
+
forceSingleStep: z.boolean().default(true),
|
| 19 |
});
|
| 20 |
|
| 21 |
export async function endpointCohere(
|
| 22 |
input: z.input<typeof endpointCohereParametersSchema>
|
| 23 |
): Promise<Endpoint> {
|
| 24 |
+
const { apiKey, clientName, model, raw, forceSingleStep } =
|
| 25 |
+
endpointCohereParametersSchema.parse(input);
|
| 26 |
|
| 27 |
let cohere: CohereClient;
|
| 28 |
|
|
|
|
| 64 |
});
|
| 65 |
|
| 66 |
stream = await cohere.chatStream({
|
| 67 |
+
forceSingleStep,
|
| 68 |
message: prompt,
|
| 69 |
rawPrompting: true,
|
| 70 |
model: model.id ?? model.name,
|