-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Definitions:
electro- this framework.- API Server - any project/re pository that uses
electroframework 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.MessageToSendschema.
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.Messagepayload.
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 fromFilesMixinwe 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.
Metadata
Metadata
Assignees
Labels
No labels