daytimedrinkingclub / shipstation

Generate landing pages, html templates, portfolios and more using state of the art AI tools. Works most of the times. Works really really well sometimes!
https://shipstation.ai/
67 stars 59 forks source link

Add support for multiple AI providers FIX #21 #33

Closed vikaswakde closed 4 weeks ago

vikaswakde commented 1 month ago

Screenshot from 2024-08-14 17-15-30 This pull request adds support for multiple AI providers, specifically Anthropic and OpenAI. The changes allow users to choose their preferred provider when using their own API key.

Key changes:

  1. Updated AuthContext (client/src/context/AuthContext.jsx):

    • Added provider and setProvider state variables
    • Updated the context value to include these new variables
  2. Modified ChoosePaymentOptionDialog (client/src/components/ChoosePaymentOptionDialog.jsx):

    • Added a Select component for choosing the AI provider
    • Updated the dialog to handle both Anthropic and OpenAI keys
  3. Updated ShipForm (client/src/components/ShipForm.jsx):

    • Modified to use the new provider and setProvider from AuthContext
    • Updated the startProject function to include the provider information
  4. Updated AIService (server/services/AIService.js):

    • Added support for OpenAI in addition to Anthropic
  5. Modified onboardingService (server/services/onboardingService.js):

    • Updated to handle different providers in the startProject event

To merge this request:

  1. Review the changes in AuthContext, ChoosePaymentOptionDialog, and ShipForm components.
  2. Ensure the server-side changes in AIService and onboardingService are correct.
  3. Test the functionality with both Anthropic and OpenAI API keys.
  4. Update any documentation or README files to reflect the new multi-provider support.
  5. Consider adding environment variables for default provider selection if needed.

This change enhances the flexibility of the platform by allowing users to choose between Anthropic and OpenAI as their AI provider, making the service more versatile and user-friendly.

possible fix for #21

vikaswakde commented 1 month ago

e7f068d

Changes Made

Implementation Details

  1. Updated the handleLoginLink function to include an early return if no email is present.
  2. Modified the span element for the login link to:
    • Use conditional styling based on email presence.
    • Only trigger the handleLoginLink function when an email is provide

https://github.com/user-attachments/assets/d72fe2bc-972d-46fa-8755-1f3f3b210d97

ptmaroct commented 1 month ago

@vikaswakde can you rebase and clean up the conflicts? This looks good