fjffk简单的咖啡店科开发2方法2 环滁皆山也。其西南诸峰,林壑尤美,望之蔚然而深秀者,琅琊也。山行六七里,渐闻水声潺潺,而泻出于两峰之间者,酿泉也 ??????????????????????????????? ??????????????/????????????????? ............/................... .........................../... ??????????????????????????????? >>>>>>>>>>>>>/>>>>>>>>>>>>>>>>> ÿØÿà JFIF    ÿÛ „  ( %!1!%)+//.383,7(-.+  -%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ     ÿÄ J    ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ   ÿÄ *  !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú "SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5 ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍѶ¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e ríV ?> ......................................... ............................................................................. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< >>>>>>>>>>>>>/>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< >>>>>>>>>>>>>>>>>>>>>>>>>>>>>> dsdfhome/nectalco/public_html/app/Domains/Entity/EntityManager.php000064400000007607152667062170020522 0ustar00defaultWordModel(); return $defaultWordModel->value; } /** * @template T * * @returns T & \App\Domains\Entity\BaseDriver */ public function driver($driver = null): BaseDriver { if ($driver && ! $driver instanceof EntityEnum) { throw new InvalidArgumentException('Driver must be an instance of AIModelEnum'); } /** @var BaseDriver $driverInstance */ $driverInstance = parent::driver($driver?->value); return $driverInstance->createDriverReqsIfNeeded(); } /** * This method is used to set another user for the driver. * It is useful when you want to use the driver for a specific user. * Alternatively, you can use the `forUser` method when you want to use the driver for a specific user. * * @template T * * @returns T & \App\Domains\Entity\BaseDriver */ public function driverForUser(int|User $user, ?EntityEnum $driver = null): BaseDriver { return $this->driver($driver)->forUser($user); } public function driverForPlan(Plan $plan, ?EntityEnum $driver = null): BaseDriver { return $this->driver($driver)->forPlan($plan); } public function driverForTeam(Team $team, ?EntityEnum $driver = null): BaseDriver { return $this->driver($driver)->forTeam($team); } public function driverForGuest(?EntityEnum $driver = null): BaseDriver { return $this->driver($driver)->forGuest(); } public function all(?EngineEnum $filterByEngine = null, ?User $user = null, bool $onlyListableCases = false, ?Plan $plan = null, ?Team $team = null): Collection { return once(function () use ($filterByEngine, $user, $onlyListableCases, $plan, $team) { return collect(EntityEnum::cases()) ->when($filterByEngine, static function ($collect) use ($filterByEngine) { return $collect->filter(fn ($entity) => $entity->engine() === $filterByEngine)->values(); }) ->map(function ($entity) use ($user, $plan, $team) { if ($plan) { return $this->driverForPlan($plan, $entity); } if ($team && $team?->allow_seats > 0) { return $this->driverForTeam($team, $entity); } if ($user) { return $this->driverForUser($user, $entity); } return $this->driver($entity); }) ->when($onlyListableCases, static function ($collect) { return $collect->filter(fn ($entity) => $entity->enum() === $entity->creditEnum())->values(); }); }); } private function defaultWordModel(): EntityEnum { $defaultEngine = setting('default_ai_engine'); $setting = Setting::getCache(); return match ($defaultEngine) { EngineEnum::OPEN_AI->slug() => EntityEnum::fromSlug($setting?->openai_default_model ?? EntityEnum::GPT_4_O->slug()), EngineEnum::ANTHROPIC->slug() => EntityEnum::fromSlug(setting('anthropic_default_model', EntityEnum::ANTHROPIC_CLAUDE_3_5_HAIKU->slug())), EngineEnum::GEMINI->slug() => EntityEnum::fromSlug(setting('gemini_default_model', EntityEnum::GEMINI_1_5_FLASH->slug())), default => EntityEnum::GPT_4_O, }; } }