dexaai / dexter

LLM tools used in production at Dexa
https://dexter.dexa.ai
MIT License
69 stars 4 forks source link

Add telemetry abstraction to remove Sentry dep (round 2) #47

Closed rileytomasek closed 1 month ago

rileytomasek commented 1 month ago

This is a simplified version of #46. It was easier to copy the important parts and start clean than try and delete all of the generics code.

Replace the direct dependency on Sentry with the abstract Telemetry interface from @transitive-bullshit. This should have no impact on users who weren't using the Sentry integration, and requires passing Sentry as an argument when creating a model instance.

import { ChatModel } from '@dexaai/dexter'
import * as Sentry from '@sentry/node'

const model = new ChatModel({ telemetry: Sentry })

I also added an example of using Sentry for tracing.

Example Trace

screenshot-2024-08-08 -T-11-31 png

vercel[bot] commented 1 month ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
dexter ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 9, 2024 0:29am
rileytomasek commented 1 month ago

@transitive-bullshit i'll merge this when you approve and then master will be in a point where we can make a full 3.0.0 release with telemetry and openai structured responses.