Skip to content

Commit

Permalink
Fix model identification when creating conversations
Browse files Browse the repository at this point in the history
PR #181 introduced a model ID field so that models could be switched out
without breaking existing conversations. However, the new conversation
endpoint incorrectly uses the model name instead of ID, so without this
fix it was not possible to have a model with a different ID and name.
  • Loading branch information
zacps committed Mar 11, 2024
1 parent f7db219 commit 619e238
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/routes/conversation/+server.ts
Expand Up @@ -39,7 +39,7 @@ export const POST: RequestHandler = async ({ locals, request }) => {
);
}

const model = models.find((m) => m.name === values.model);
const model = models.find((m) => (m.id || m.name) === values.model);

if (!model) {
throw error(400, "Invalid model");
Expand Down

0 comments on commit 619e238

Please sign in to comment.