Skip to content

Commit

Permalink
fix: make parameter default to false and fix type checks
Browse files Browse the repository at this point in the history
  • Loading branch information
nsarrazin committed Dec 9, 2024
1 parent 6f3ee74 commit a0e6a77
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/lib/server/endpoints/openai/endpointOai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export const endpointOAIParametersSchema = z.object({
})
.default({}),
/* enable use of max_completion_tokens in place of max_tokens */
useCompletionTokens: z.boolean().default(true),
useCompletionTokens: z.boolean().default(false),
});

export async function endpointOai(
Expand Down Expand Up @@ -204,7 +204,10 @@ export async function endpointOai(

// if system role is not supported, convert first message to a user message.
if (!model.systemRoleSupported && messagesOpenAI?.[0]?.role === "system") {
messagesOpenAI[0].role = "user";
messagesOpenAI[0] = {
...messagesOpenAI[0],
role: "user",
};
}

if (toolResults && toolResults.length > 0) {
Expand Down

0 comments on commit a0e6a77

Please sign in to comment.