Skip to content

Commit

Permalink
add new parameter in model and conversation api (#1325)
Browse files Browse the repository at this point in the history
Co-authored-by: Kevin CATHALY <[email protected]>
Co-authored-by: Nathan Sarrazin <[email protected]>
  • Loading branch information
alak and nsarrazin authored Jul 4, 2024
1 parent 4badae1 commit 22e49f0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/routes/api/conversation/[id]/+server.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { collections } from "$lib/server/database";
import { authCondition } from "$lib/server/auth";
import { z } from "zod";
import { models } from "$lib/server/models";
import { ObjectId } from "mongodb";

export async function GET({ locals, params }) {
Expand Down Expand Up @@ -29,6 +30,7 @@ export async function GET({ locals, params }) {
webSearch: message.webSearch,
files: message.files,
})),
modelTools: models.find((m) => m.id == conv.model)?.tools ?? false,
};
return Response.json(res);
} else {
Expand Down
2 changes: 2 additions & 0 deletions src/routes/api/conversations/+server.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { collections } from "$lib/server/database";
import { models } from "$lib/server/models";
import { authCondition } from "$lib/server/auth";
import type { Conversation } from "$lib/types/Conversation";

Expand Down Expand Up @@ -29,6 +30,7 @@ export async function GET({ locals, url }) {
updatedAt: conv.updatedAt,
modelId: conv.model,
assistantId: conv.assistantId,
modelTools: models.find((m) => m.id == conv.model)?.tools ?? false,
}));

return Response.json(res);
Expand Down
1 change: 1 addition & 0 deletions src/routes/api/models/+server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export async function GET() {
preprompt: model.preprompt ?? "",
multimodal: model.multimodal ?? false,
unlisted: model.unlisted ?? false,
tools: model.tools ?? false,
}));
return Response.json(res);
}

0 comments on commit 22e49f0

Please sign in to comment.