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 Feb 13, 2024
1 parent 450bfce commit e93c65d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/routes/conversation/+server.ts
Expand Up @@ -42,7 +42,7 @@ export const POST: RequestHandler = async ({ locals, request }) => {
embeddingModel = conversation.embeddingModel;
}

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

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

0 comments on commit e93c65d

Please sign in to comment.