Skip to content

Commit 22e49f0

Browse files
alaknsarrazin
andauthored
add new parameter in model and conversation api (#1325)
Co-authored-by: Kevin CATHALY <alaknorth@gmail.com> Co-authored-by: Nathan Sarrazin <sarrazin.nathan@gmail.com>
1 parent 4badae1 commit 22e49f0

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

src/routes/api/conversation/[id]/+server.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { collections } from "$lib/server/database";
22
import { authCondition } from "$lib/server/auth";
33
import { z } from "zod";
4+
import { models } from "$lib/server/models";
45
import { ObjectId } from "mongodb";
56

67
export async function GET({ locals, params }) {
@@ -29,6 +30,7 @@ export async function GET({ locals, params }) {
2930
webSearch: message.webSearch,
3031
files: message.files,
3132
})),
33+
modelTools: models.find((m) => m.id == conv.model)?.tools ?? false,
3234
};
3335
return Response.json(res);
3436
} else {

src/routes/api/conversations/+server.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { collections } from "$lib/server/database";
2+
import { models } from "$lib/server/models";
23
import { authCondition } from "$lib/server/auth";
34
import type { Conversation } from "$lib/types/Conversation";
45

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

3436
return Response.json(res);

src/routes/api/models/+server.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export async function GET() {
1818
preprompt: model.preprompt ?? "",
1919
multimodal: model.multimodal ?? false,
2020
unlisted: model.unlisted ?? false,
21+
tools: model.tools ?? false,
2122
}));
2223
return Response.json(res);
2324
}

0 commit comments

Comments
 (0)