re-add monitoring

This commit is contained in:
Saxon Fletcher committed 2025-09-30 13:15:32 +10:00
1 parent ca8d0defd8
commit 566b60d421
1 file changed
+10 -1
+10 -1
View File
@@ -1,5 +1,6 @@
import pgMeta from '@supabase/pg-meta'
import { convertToModelMessages, type ModelMessage, stepCountIs, streamText } from 'ai'
import { convertToModelMessages, type ModelMessage, stepCountIs } from 'ai'
import * as ai from 'ai'
import { source } from 'common-tags'
import type { NextApiRequest, NextApiResponse } from 'next'
import z from 'zod'
@@ -22,6 +23,7 @@ import { getTools } from 'lib/ai/tools'
import { sanitizeMessagePart } from 'lib/ai/tools/tool-sanitizer'
import apiWrapper from 'lib/api/apiWrapper'
import { executeQuery } from 'lib/api/self-hosted/query'
import { initLogger, wrapAISDK } from 'braintrust'
export const maxDuration = 120
@@ -29,6 +31,13 @@ export const config = {
api: { bodyParser: true },
}
initLogger({
projectName: process.env.BRAINTRUST_PROJECT_NAME,
apiKey: process.env.BRAINTRUST_API_KEY,
})
const { streamText } = wrapAISDK(ai)
async function handler(req: NextApiRequest, res: NextApiResponse) {
const { method } = req