AI store generator for ecommerce, Malaysia first. Laravel 13 + React + TypeScript.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

ai.php 3.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. // The short daily note at the top of the dashboard ("Store pulse"). A cheap model is enough.
  35. 'pulse' => [
  36. 'provider' => env('AI_PULSE_PROVIDER') ?: 'deepseek',
  37. 'model' => env('AI_PULSE_MODEL') ?: 'deepseek-chat',
  38. 'max_tokens' => 400,
  39. ],
  40. ],
  41. /*
  42. * The dashboard note is written at most once a day per view (all stores, or one store) and saved,
  43. * so refreshing the dashboard costs nothing. "Write again" asks for a fresh note; this is how many
  44. * times a merchant may press it per day, across all views. It does not count toward AI changes.
  45. */
  46. 'pulse' => [
  47. 'daily_rewrites' => (int) env('AI_PULSE_DAILY_REWRITES', 3),
  48. ],
  49. 'providers' => [
  50. 'claude' => [
  51. 'driver' => ClaudeDriver::class,
  52. 'api_key' => env('ANTHROPIC_API_KEY'),
  53. // Let Claude think before answering. Better designs, slightly higher cost.
  54. 'thinking' => (bool) env('AI_CLAUDE_THINKING', true),
  55. ],
  56. 'deepseek' => [
  57. 'driver' => OpenAiCompatibleDriver::class,
  58. 'api_key' => env('DEEPSEEK_API_KEY'),
  59. 'base_url' => env('DEEPSEEK_BASE_URL') ?: 'https://api.deepseek.com',
  60. // The most this provider can write in one answer.
  61. 'max_output_tokens' => 8000,
  62. ],
  63. // No real AI. Returns a built-in sample design. For tests and for working without API keys.
  64. 'fake' => [
  65. 'driver' => FakeDriver::class,
  66. // Seconds to wait, so the progress screen can be seen.
  67. 'delay' => (int) env('AI_FAKE_DELAY', 0),
  68. ],
  69. ],
  70. // Seconds to wait for one AI answer before giving up.
  71. 'timeout' => (int) env('AI_TIMEOUT', 240),
  72. ];