Summary
Verify that observe() correctly detects and instruments a Groq client instance via duck-typing. Add test coverage.
What to do
- Check
src/observe/provider-detector.ts handles Groq's client shape
- Add a unit test in
src/observe/__tests__/provider-detector.test.ts with a mocked Groq-like object
- If detection fails, add the duck-typing rule for Groq
Context
The provider detector uses duck-typing (checking for specific method signatures) rather than instanceof to identify which LLM provider a client belongs to. Each provider has a unique "signature" the detector looks for.
Groq's SDK is OpenAI-compatible but has slightly different internal structure. We need to ensure it's correctly identified as 'groq' rather than falling through to 'openai'.
Acceptance criteria
Helpful links
Summary
Verify that
observe()correctly detects and instruments a Groq client instance via duck-typing. Add test coverage.What to do
src/observe/provider-detector.tshandles Groq's client shapesrc/observe/__tests__/provider-detector.test.tswith a mocked Groq-like objectContext
The provider detector uses duck-typing (checking for specific method signatures) rather than
instanceofto identify which LLM provider a client belongs to. Each provider has a unique "signature" the detector looks for.Groq's SDK is OpenAI-compatible but has slightly different internal structure. We need to ensure it's correctly identified as
'groq'rather than falling through to'openai'.Acceptance criteria
detectProvider(groqClient)returns the correctProviderSignaturewithprovider: 'groq'src/observe/__tests__/provider-detector.test.tsHelpful links
src/observe/provider-detector.ts__tests__folder for the pattern