Troubleshooting
Debugging Requests and Responses
Debugging LLM interactions is essential for troubleshooting and optimizing your applications.
Polyglot debug mode provides a simple way to enable debugging for LLM interactions. Debugging is essential for troubleshooting and optimizing your applications. It allows you to inspect the requests sent to the LLM and the responses received, helping you identify issues and improve performance.
Enabling Debug Mode
Polyglot provides a simple way to enable debug mode:
HTTP Request Inspection with Middleware
You can manually add debugging middleware to inspect raw HTTP requests and responses.
In this example we’re using built-in middleware, but you can also create your own custom middleware.
Event Listeners
Use event listeners to trace the flow of requests and responses:
Logging to Files
For more persistent debugging, you can log to files: