-
Notifications
You must be signed in to change notification settings - Fork 5
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
Change logic to handle async response #50
Conversation
aimon/decorators/detect.py
Outdated
self.publish_response = publish if publish is not None else [] | ||
|
||
# Format or convert detect_response during initialization | ||
if self.async_mode: |
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.
lets keep these as objects when returning.
aimon/decorators/detect.py
Outdated
detect_response_value = ( | ||
detect_response.to_dict() if hasattr(detect_response, 'to_dict') else detect_response | ||
) | ||
self.detect_response = self._format_response_item(detect_response_value) |
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.
remove this from here
aimon/decorators/detect.py
Outdated
return ( | ||
f"DetectResult(\n" | ||
f" status={self.status},\n" | ||
f" detect_response={detect_response_str},\n" | ||
f" detect_response={self.detect_response},\n" |
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.
instead format the object in a pretty string format here using _format_response_item
No description provided.