adjusts openai schema validation to allow
ull stop sequence
This commit is contained in:
parent
7660ed8b94
commit
ca4321b4cb
|
@ -119,7 +119,8 @@ export const transformOpenAIToAnthropicChat: APIFormatTransformer<
|
||||||
stream: rest.stream,
|
stream: rest.stream,
|
||||||
temperature: rest.temperature,
|
temperature: rest.temperature,
|
||||||
top_p: rest.top_p,
|
top_p: rest.top_p,
|
||||||
stop_sequences: typeof rest.stop === "string" ? [rest.stop] : rest.stop,
|
stop_sequences:
|
||||||
|
typeof rest.stop === "string" ? [rest.stop] : rest.stop || undefined,
|
||||||
...(rest.user ? { metadata: { user_id: rest.user } } : {}),
|
...(rest.user ? { metadata: { user_id: rest.user } } : {}),
|
||||||
// Anthropic supports top_k, but OpenAI does not
|
// Anthropic supports top_k, but OpenAI does not
|
||||||
// OpenAI supports frequency_penalty, presence_penalty, logit_bias, n, seed,
|
// OpenAI supports frequency_penalty, presence_penalty, logit_bias, n, seed,
|
||||||
|
|
|
@ -47,7 +47,7 @@ export const OpenAIV1ChatCompletionSchema = z
|
||||||
stream: z.boolean().optional().default(false),
|
stream: z.boolean().optional().default(false),
|
||||||
stop: z
|
stop: z
|
||||||
.union([z.string().max(500), z.array(z.string().max(500))])
|
.union([z.string().max(500), z.array(z.string().max(500))])
|
||||||
.optional(),
|
.nullish(),
|
||||||
max_tokens: z.coerce
|
max_tokens: z.coerce
|
||||||
.number()
|
.number()
|
||||||
.int()
|
.int()
|
||||||
|
|
Loading…
Reference in New Issue