(args: Args, sessions: TraceSession[])
| 301 | } |
| 302 | |
| 303 | function printSummary(args: Args, sessions: TraceSession[]) { |
| 304 | console.log( |
| 305 | `Fetched ${sessions.length} trace session(s) from ${args.dataset}.chat_completion_traces`, |
| 306 | ) |
| 307 | console.log(`Lookback: ${args.lookbackHours} hour(s)`) |
| 308 | |
| 309 | for (const session of sessions) { |
| 310 | console.log('') |
| 311 | console.log(`Trace session: ${session.trace_session_id}`) |
| 312 | console.log(` messages=${session.messages.length}`) |
| 313 | console.log( |
| 314 | ` first=${session.first_created_at} last=${session.last_created_at}`, |
| 315 | ) |
| 316 | console.log( |
| 317 | ` agents=${session.agent_ids.join(', ')}${session.incomplete ? ' incomplete=true' : ''}`, |
| 318 | ) |
| 319 | console.log(` last_message=${getMessagePreview(session.messages.at(-1))}`) |
| 320 | } |
| 321 | } |
| 322 | |
| 323 | function buildIndexEntry(session: TraceSession): TraceSessionIndexEntry { |
| 324 | return { |
no test coverage detected