Internals
Debugging
Instructor offers several ways to debug it’s internal state and execution flow.
Events
Instructor emits events at various points in its lifecycle, which you can listen to and react to. You can use these events to debug execution flow and to inspect data at various stages of processing.
For more details see the Events section.
HTTP Debugging
The Instructor
class has a withDebug()
method that can be used to debug the request and response.
It displays detailed information about the request being sent to LLM API and response received from it, including:
- request headers, URI, method and body,
- response status, headers, and body.
This is useful for debugging the request and response when you are not getting the expected results.