MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / record

Function record

web/src/llm-api/__tests__/chat-completion-trace.test.ts:78–98  ·  view source on GitHub ↗
(params: {
    body: ChatCompletionRequestBody
    userId?: string
    agentId?: string
    ancestorRunIds?: string[]
  })

Source from the content-addressed store, hash-verified

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({

Callers 1

Calls 3

flushTraceWritesFunction · 0.85
atMethod · 0.80

Tested by

no test coverage detected