Skip to content

Commit c0c0cd8

Browse files
committed
fix doc confidence
1 parent 3709b38 commit c0c0cd8

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

client/src/routes/inbox.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ export default function InboxPage() {
472472
return (
473473
<Accordion.Item
474474
style={{
475-
"border-left": `6px solid ${computeColor(
475+
borderLeft: `6px solid ${computeColor(
476476
// Math.round((document.confidence / 0.8) * 100) / 100
477477
Math.round(document.confidence * 100) / 100,
478478
)}`,

server/models/response.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,14 @@ def map(self):
6767
docs.append(self.documents[cur_idx : cur_idx + num_docs])
6868
cur_idx += num_docs
6969
docs = [[doc.map() for doc in doc_list] for doc_list in docs]
70+
for i, doc_list in enumerate(docs):
71+
for j, doc in enumerate(doc_list):
72+
doc["confidence"] = doc_confs[i][j]
7073
return {
7174
"id": self.id,
7275
"content": self.response,
7376
"questions": self.questions,
7477
"documents": docs,
75-
"document_confidences": doc_confs,
7678
"confidence": self.confidence,
7779
"emailId": self.email_id,
7880
}

0 commit comments

Comments
 (0)