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

Feature Request: Support for Direct Image Upload via S3 or Azure Blob Storage #4

Open
animalnots opened this issue Jul 2, 2024 · 2 comments
Labels

Comments

@animalnots
Copy link
Owner

Description:
Currently, BetterGPT supports image uploads via base64 encoding. To enhance flexibility and scalability, we propose adding support for direct image uploads via Amazon S3 and Azure Blob Storage. This feature would allow users to automatically upload images to these cloud storage services and provide the URLs directly to the API, improving efficiency for large-scale applications.

Proposed Solution:

  1. S3 Integration:

    • Allow users to configure their AWS credentials (API Key, Secret Key).
    • Provide functionality to upload images directly to an S3 bucket.
    • Generate and use the S3 URL for the image in API requests.
  2. Azure Blob Integration:

    • Allow users to configure their Azure Storage credentials (Account Name, Account Key).
    • Provide functionality to upload images directly to an Azure Blob container.
    • Generate and use the Azure Blob URL for the image in API requests.
  3. API Changes:

    • Modify the existing image upload (via blob64) to accept URLs from these cloud storage services.
    • Add config sections for configuring AWS and Azure credentials.
  4. Library Dependencies:

    • Add relevant libraries for AWS SDK for JavaScript:
      npm install @aws-sdk/client-s3
    • Add relevant libraries for Azure SDK for JavaScript:
      npm install @azure/storage-blob
  5. Documentation Update:

    • Update the API documentation to include examples and guidelines for using S3 and Azure Blob URLs.
    • Provide instructions for setting up AWS and Azure credentials.

Benefits:

  • Scalability: Supports large-scale image processing without the need for base64 encoding.
  • Efficiency: Reduces the overhead of encoding/decoding images.
  • Flexibility: Allows users to leverage existing cloud storage solutions.
  • Automation: Simplifies the process by automatically handling the upload and URL generation.

Example Use Case:

{
  "model": "gpt-4o",
  "messages": [
    {
      "role": "user",
      "content": [
        { "type": "text", "text": "What’s in this image?" },
        { "type": "image_url", "url": "https://example.com/path-to-image.jpg" }
      ]
    }
  ],
}

Configuration Endpoints:

  1. AWS S3 Configuration:

    {
      "aws_access_key_id": "YOUR_AWS_ACCESS_KEY_ID",
      "aws_secret_access_key": "YOUR_AWS_SECRET_ACCESS_KEY",
      "s3_bucket_name": "YOUR_S3_BUCKET_NAME"
    }
  2. Azure Blob Configuration:

    {
      "azure_account_name": "YOUR_AZURE_ACCOUNT_NAME",
      "azure_account_key": "YOUR_AZURE_ACCOUNT_KEY",
      "azure_container_name": "YOUR_AZURE_CONTAINER_NAME"
    }

Additional Information:

  • Ensure security measures are in place to handle S3 and Azure Blob URLs.
  • Validate the URLs to prevent unauthorized access.
  • Handle error cases where the upload to S3 or Azure Blob fails.

Implementing this feature will significantly enhance the user experience and broaden the use cases for BetterGPT's vision capabilities.

@animalnots
Copy link
Owner Author

animalnots commented Jul 2, 2024

#5 should help with this

Copy link

canny bot commented Jul 8, 2024

This issue has been linked to a Canny post: Feature Request: Support for Direct Image Upload via S3 or Azure Blob Storage 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant