AI store generator for ecommerce, Malaysia first. Laravel 13 + React + TypeScript.
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

ai.php 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <?php
  2. use App\Ai\Drivers\ClaudeDriver;
  3. use App\Ai\Drivers\FakeDriver;
  4. use App\Ai\Drivers\OpenAiCompatibleDriver;
  5. /*
  6. |--------------------------------------------------------------------------
  7. | AI settings
  8. |--------------------------------------------------------------------------
  9. |
  10. | Every AI call in the app goes through App\Ai\AiManager, which reads this file.
  11. | To change the AI model for a task, change its two lines in .env. No code changes.
  12. |
  13. | To add a new provider:
  14. | 1. Add an entry under "providers" (most providers work with OpenAiCompatibleDriver).
  15. | 2. Put its API key in .env.
  16. | 3. Point a task at it with AI_GENERATE_PROVIDER or AI_EDIT_PROVIDER.
  17. |
  18. */
  19. return [
  20. // Which provider and model each task uses.
  21. 'tasks' => [
  22. // Designing a whole store from the brand description.
  23. 'generate' => [
  24. 'provider' => env('AI_GENERATE_PROVIDER') ?: 'claude',
  25. 'model' => env('AI_GENERATE_MODEL') ?: 'claude-sonnet-5-5',
  26. 'max_tokens' => 16000,
  27. ],
  28. // Small changes asked for by chat ("make the banner darker").
  29. 'edit' => [
  30. 'provider' => env('AI_EDIT_PROVIDER') ?: 'deepseek',
  31. 'model' => env('AI_EDIT_MODEL') ?: 'deepseek-chat',
  32. 'max_tokens' => 6000,
  33. ],
  34. // "Draw with AI" in the Logo box: three simple SVG logos from the brand. Claude draws well.
  35. 'logo' => [
  36. 'provider' => env('AI_LOGO_PROVIDER') ?: 'claude',
  37. 'model' => env('AI_LOGO_MODEL') ?: 'claude-sonnet-5-5',
  38. 'max_tokens' => 12000,
  39. ],
  40. // The short daily note at the top of the dashboard ("Store pulse"). A cheap model is enough.
  41. 'pulse' => [
  42. 'provider' => env('AI_PULSE_PROVIDER') ?: 'deepseek',
  43. 'model' => env('AI_PULSE_MODEL') ?: 'deepseek-chat',
  44. 'max_tokens' => 400,
  45. ],
  46. ],
  47. /*
  48. * The dashboard note is written at most once a day per view (all stores, or one store) and saved,
  49. * so refreshing the dashboard costs nothing. "Write again" asks for a fresh note; this is how many
  50. * times a merchant may press it per day, across all views. It does not count toward AI changes.
  51. */
  52. 'pulse' => [
  53. 'daily_rewrites' => (int) env('AI_PULSE_DAILY_REWRITES', 3),
  54. ],
  55. /*
  56. * "Draw with AI" logos: how many tries each store gets, ever (each try draws 3 logos).
  57. * A try that brings back nothing usable is not counted.
  58. */
  59. 'logo' => [
  60. 'lifetime_tries' => (int) env('AI_LOGO_LIFETIME_TRIES', 3),
  61. ],
  62. 'providers' => [
  63. 'claude' => [
  64. 'driver' => ClaudeDriver::class,
  65. 'api_key' => env('ANTHROPIC_API_KEY'),
  66. // Let Claude think before answering. Better designs, slightly higher cost.
  67. 'thinking' => (bool) env('AI_CLAUDE_THINKING', true),
  68. ],
  69. 'deepseek' => [
  70. 'driver' => OpenAiCompatibleDriver::class,
  71. 'api_key' => env('DEEPSEEK_API_KEY'),
  72. 'base_url' => env('DEEPSEEK_BASE_URL') ?: 'https://api.deepseek.com',
  73. // The most this provider can write in one answer.
  74. 'max_output_tokens' => 8000,
  75. ],
  76. // No real AI. Returns a built-in sample design. For tests and for working without API keys.
  77. 'fake' => [
  78. 'driver' => FakeDriver::class,
  79. // Seconds to wait, so the progress screen can be seen.
  80. 'delay' => (int) env('AI_FAKE_DELAY', 0),
  81. ],
  82. ],
  83. // Seconds to wait for one AI answer before giving up.
  84. 'timeout' => (int) env('AI_TIMEOUT', 240),
  85. ];