-
Notifications
You must be signed in to change notification settings - Fork 230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Better ErrorEvents #155
Conversation
@@ -80,7 +80,7 @@ def on_llm_error( | |||
llm_event: LLMEvent = self.events.llm[str(run_id)] | |||
self.ao_client.record(llm_event) | |||
|
|||
error_event = ErrorEvent(trigger_event=llm_event, details=str(error), timestamp=get_ISO_time()) | |||
error_event = ErrorEvent(trigger_event=llm_event, error_type=type(error).__name__, details=str(error), timestamp=get_ISO_time()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking more like
error_event = ErrorEvent(trigger_event=llm_event, error=error)
and then the ErrorEvent constructor does the rest:
def __init__(self, trigger_event, error):
self.error_type = error_type=type(error).__name__
self.details = str(error)
self.timestamp = get_ISO_time()
it's less work for the developer to have to do. more magic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or actually maybe like this
def __init__(self, trigger_event, error, error_type = None, details = None, timestamp = None):
self.error_type = error_type or error_type=type(error).__name__
self.details = details or str(error)
self.timestamp = timestamp or get_ISO_time()
Howard is doing a better version |
📥 Pull Request
📘 Description
We are currently not recording the error types anywhere and instead loading it into the details field. This change makes use of the error types field and automatically captures stack traces.
Need recommendations for names for the Langchain handler!
@HowieG, are all of the fields in ErrorEvent sent to the API server? Is there a way for us to create an exceptions field that auto populates the error_type and details fields (if they aren't provided)?