(params: {
sessionId?: string
userId?: string
})
| 77 | |
| 78 | // Get telemetry config for streamText |
| 79 | export function getTelemetryConfig(params: { |
| 80 | sessionId?: string |
| 81 | userId?: string |
| 82 | }) { |
| 83 | if (!isLangfuseEnabled()) return undefined |
| 84 | |
| 85 | return { |
| 86 | isEnabled: true, |
| 87 | recordInputs: true, |
| 88 | recordOutputs: true, |
| 89 | metadata: { |
| 90 | sessionId: params.sessionId, |
| 91 | userId: params.userId, |
| 92 | }, |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | // Wrap a handler with Langfuse observe |
| 97 | export function wrapWithObserve<T>( |
no test coverage detected