instructor_ex
instructor_ex copied to clipboard
Add telemetry for Instructor.chat_completion
Here is a quick way to add telemetry to Instructor.chat_completion. It provides the following benefits:
- A standard Elixir way to do telemetry
- Captures all relevant information, including raw LLM response and time it took to respond, to help with debugging
- Can add additional measurement (e.g., number of tokens consumed) but that would require adjusting the
Instructor.Adapterbehavior
Let me know if you want me to modify it in any way.