You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
API Server - any project/re pository that uses electro framework in the API mode (the only available mode right now).
Clients - any Discord/WhatsApp/Website/etc. clients that connect to the API and serve as a middleware between the API server and the platforms. Platforms = Discord, WhatsApp, etc.
What?
Whenever the API server wants to send an image to a Client (e.g. WhatsApp client), it sends an URL of that image as a field in the types.MessageToSend schema.
Why?
So that we can share images (and files) from the API Server to the clients.
Later we can have something similar be done in the other direction: whenever a User sends an image to the WhatsApp client, the Client uploads that image to a specific endpoint in the API, API returns the URL, and then the Client sends that URL as a part of the types.Message payload.
How?
Whenever an Image needs to be sent to the Client, it first needs to be uploaded to an S3/AzureBlobStorage instance using await universal_image_storage.upload_image(...) from ./electro/toolkit/images_storage/universal_image_storage.py.
To cover all the cases when an image/file needs to be shared, we can look at all the FilesMixin()._get_files_to_send() method from ./electro/flow_step.py. By looking at all the classes inherited from FilesMixin we can see how the method is being used.
Anything else?
The image URL should ideally be a presigned URL. If that's not possible to achieve for AzureBlobStorage, we can ignore it. It is acceptable to have images URLs be public as long as they're not easily guessable.
Definitions:
electro- this framework.electroframework in the API mode (the only available mode right now).What?
types.MessageToSendschema.Why?
types.Messagepayload.How?
await universal_image_storage.upload_image(...)from./electro/toolkit/images_storage/universal_image_storage.py.FilesMixin()._get_files_to_send()method from./electro/flow_step.py. By looking at all the classes inherited fromFilesMixinwe can see how the method is being used.Anything else?