animalnots / BetterChatGPT-VISION

An amazing UI for OpenAI's ChatGPT (Website + Windows + MacOS + Linux). SEND PR's
http://bettergpt.chat/
Creative Commons Zero v1.0 Universal
1 stars 0 forks source link

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

Open animalnots opened 2 days ago

animalnots commented 2 days ago

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:

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:

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

animalnots commented 2 days ago

https://github.com/animalnots/BetterChatGPT-VISION/pull/5 should help with this