julien-c HF staff commited on
Commit
9658717
1 Parent(s): fa3b3b4

Export to parquet: also export score (#265)

Browse files
Files changed (1) hide show
  1. src/routes/admin/export/+server.ts +9 -1
src/routes/admin/export/+server.ts CHANGED
@@ -34,7 +34,14 @@ export async function POST({ request }) {
34
  title: { type: "UTF8" },
35
  created_at: { type: "TIMESTAMP_MILLIS" },
36
  updated_at: { type: "TIMESTAMP_MILLIS" },
37
- messages: { repeated: true, fields: { from: { type: "UTF8" }, content: { type: "UTF8" } } },
 
 
 
 
 
 
 
38
  });
39
 
40
  const fileName = `/tmp/conversations-${new Date().toJSON().slice(0, 10)}-${Date.now()}.parquet`;
@@ -77,6 +84,7 @@ export async function POST({ request }) {
77
  messages: conversation.messages.map((message: Message) => ({
78
  from: message.from,
79
  content: message.content,
 
80
  })),
81
  });
82
  ++count;
 
34
  title: { type: "UTF8" },
35
  created_at: { type: "TIMESTAMP_MILLIS" },
36
  updated_at: { type: "TIMESTAMP_MILLIS" },
37
+ messages: {
38
+ repeated: true,
39
+ fields: {
40
+ from: { type: "UTF8" },
41
+ content: { type: "UTF8" },
42
+ score: { type: "INT_8", optional: true },
43
+ },
44
+ },
45
  });
46
 
47
  const fileName = `/tmp/conversations-${new Date().toJSON().slice(0, 10)}-${Date.now()}.parquet`;
 
84
  messages: conversation.messages.map((message: Message) => ({
85
  from: message.from,
86
  content: message.content,
87
+ ...(message.score ? { score: message.score } : undefined),
88
  })),
89
  });
90
  ++count;