Skip to content
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

Merged
merged 12 commits into from
Dec 9, 2024
Merged

Change logic to handle async response #50

merged 12 commits into from
Dec 9, 2024

Conversation

ramoncelestino
Copy link
Collaborator

No description provided.

self.publish_response = publish if publish is not None else []

# Format or convert detect_response during initialization
if self.async_mode:
Copy link
Contributor

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.

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this from here

return (
f"DetectResult(\n"
f" status={self.status},\n"
f" detect_response={detect_response_str},\n"
f" detect_response={self.detect_response},\n"
Copy link
Contributor

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

@pjoshi30 pjoshi30 merged commit 086d2a9 into main Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants