SDK
Log Error
Log LLM errors in order to seamlessly view insights as to why your LLM calls are failing or timing out, trace errors, and identify patterns.
When to use
Use this method when catching errors from failed LLM calls, feeding in your your error object and other additional metadata.
Usage
Function Parameters
error
any
requiredError response from LLM, such as an object or a string. Must be JSON serializable.
messages
array
requiredList of objects, each representing a message in the LLM conversation chain.
metadata
object
Metadata object, as specified here.
Response
The logError
method will return a Promise
that resolves to an object with the following fields:
success
boolean
Whether or not the log was successful.