Skip to content

Commit e062409

Browse files
committed
improve log
1 parent 8f9c16b commit e062409

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

exercises/06.sampling/02.problem.advanced/src/sampling.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,5 +100,15 @@ Please respond with a proper commendation for yourself.
100100
tagId,
101101
})
102102
}
103-
console.error('Added tags to entry', entry.id, idsToAdd)
103+
const allTags = await agent.db.listTags()
104+
105+
console.error(
106+
'Added tags to entry',
107+
entry.id,
108+
Array.from(idsToAdd)
109+
.map((id) => allTags.find((t) => t.id === id))
110+
.filter(Boolean)
111+
.map((t) => `${t.name} (${t.id})`)
112+
.join(', '),
113+
)
104114
}

exercises/06.sampling/02.solution.advanced/src/sampling.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,5 +95,16 @@ If you have some suggestions, respond with an array of tag objects. Existing tag
9595
tagId,
9696
})
9797
}
98-
console.error('Added tags to entry', entry.id, idsToAdd)
98+
99+
const allTags = await agent.db.listTags()
100+
101+
console.error(
102+
'Added tags to entry',
103+
entry.id,
104+
Array.from(idsToAdd)
105+
.map((id) => allTags.find((t) => t.id === id))
106+
.filter(Boolean)
107+
.map((t) => `${t.name} (${t.id})`)
108+
.join(', '),
109+
)
99110
}

0 commit comments

Comments
 (0)