Skip to content

Commit

Permalink
Fix variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
JakubKermes committed Apr 27, 2024
1 parent f50cd74 commit 0360e5e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/Services/OpenAIService.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function importRulesForAllCities(bool $force): void
$cityData = [
"cityId" => $city->id,
"countryId" => $city->country_id,
"city_name" => $city->name,
"cityName" => $city->name,
"countryName" => $city->country->name,
];
$jobs[] = new ImportCityRulesJob($cityData, $force);
Expand Down Expand Up @@ -101,7 +101,7 @@ public function importRulesForCity(array $cityData, bool $force): array

$prompt_en = "Act as a helpful assistant. Explain what are the legal limitations for riding electric scooters in $cityName, $countryName? Contain information about: max speed, helmet requirements, allowed ABV, passengers, other relevant details. Be formal, speak English. Don't include city name in your response. If you don't have information answering the question, write 'null'.";
$prompt_pl = "Translate to polish: ";
$currentRulesInCountry = Rules::query()->where("countryId", $countryId)->first();
$currentRulesInCountry = Rules::query()->where("country_id", $countryId)->first();

if (in_array($countryName, $this->countriesKnownToHaveUniformRules, true) && $currentRulesInCountry !== null && $currentRulesInCountry->rules_en !== null && $currentRulesInCountry->rules_pl !== null && !$force) {
$rules_en = $currentRulesInCountry->rules_en;
Expand Down

0 comments on commit 0360e5e

Please sign in to comment.