(params: {
body: ChatCompletionRequestBody
userId?: string
agentId?: string
ancestorRunIds?: string[]
})
| 76 | } |
| 77 | |
| 78 | const record = async (params: { |
| 79 | body: ChatCompletionRequestBody |
| 80 | userId?: string |
| 81 | agentId?: string |
| 82 | ancestorRunIds?: string[] |
| 83 | }) => { |
| 84 | recordChatCompletionTrace({ |
| 85 | body: params.body, |
| 86 | userId: params.userId ?? 'user-1', |
| 87 | agentId: params.agentId ?? 'base2-free-deepseek', |
| 88 | ancestorRunIds: params.ancestorRunIds ?? [], |
| 89 | logger: testLogger, |
| 90 | insertChatCompletionTraceBigquery: async ({ row }) => { |
| 91 | rows.push(row) |
| 92 | return true |
| 93 | }, |
| 94 | scheduleTraceWrite, |
| 95 | }) |
| 96 | await flushTraceWrites() |
| 97 | return rows.at(-1)! |
| 98 | } |
| 99 | |
| 100 | it('stores a full snapshot when the trace cache is cold', async () => { |
| 101 | const row = await record({ |
no test coverage detected