Kevin CATHALY commited on
Commit
60ddb23
·
unverified ·
1 Parent(s): 640465c

add assistantId in the conversation API (#1154)

Browse files
src/routes/api/conversation/[id]/+server.ts CHANGED
@@ -19,6 +19,7 @@ export async function GET({ locals, params }) {
19
  title: conv.title,
20
  updatedAt: conv.updatedAt,
21
  modelId: conv.model,
 
22
  messages: conv.messages.map((message) => ({
23
  content: message.content,
24
  from: message.from,
 
19
  title: conv.title,
20
  updatedAt: conv.updatedAt,
21
  modelId: conv.model,
22
+ assistantId: conv.assistantId,
23
  messages: conv.messages.map((message) => ({
24
  content: message.content,
25
  from: message.from,
src/routes/api/conversations/+server.ts CHANGED
@@ -12,7 +12,7 @@ export async function GET({ locals, url }) {
12
  .find({
13
  ...authCondition(locals),
14
  })
15
- .project<Pick<Conversation, "_id" | "title" | "updatedAt" | "model">>({
16
  title: 1,
17
  updatedAt: 1,
18
  model: 1,
@@ -27,6 +27,7 @@ export async function GET({ locals, url }) {
27
  title: conv.title,
28
  updatedAt: conv.updatedAt,
29
  modelId: conv.model,
 
30
  }));
31
 
32
  return Response.json(res);
 
12
  .find({
13
  ...authCondition(locals),
14
  })
15
+ .project<Pick<Conversation, "_id" | "title" | "updatedAt" | "model" | "assistantId">>({
16
  title: 1,
17
  updatedAt: 1,
18
  model: 1,
 
27
  title: conv.title,
28
  updatedAt: conv.updatedAt,
29
  modelId: conv.model,
30
+ assistantId: conv.assistantId,
31
  }));
32
 
33
  return Response.json(res);