mempool weather added

This commit is contained in:
HolgerHatGarKeineNode
2023-03-31 16:03:54 +02:00
parent 12e3f3269b
commit 7973a2032f
3 changed files with 6 additions and 4 deletions

View File

@@ -4,6 +4,7 @@ namespace App\Console\Commands\MempoolSpace;
use Illuminate\Console\Command; use Illuminate\Console\Command;
use Illuminate\Support\Facades\Http; use Illuminate\Support\Facades\Http;
use OpenAI;
class CacheRecommendedFees extends Command class CacheRecommendedFees extends Command
{ {

View File

@@ -33,15 +33,15 @@ class Test extends Command
$result = $client->completions() $result = $client->completions()
->create([ ->create([
'model' => 'text-davinci-003', 'model' => 'text-davinci-003',
'prompt' => sprintf('Erstelle einen Wetterbericht für den Bitcoin Mempool mit folgenden Gebühren: fastestFee: %s sat/vB, halfHourFee: %s sat/vB, hourFee: %s sat/vB, economyFee: %s sat/vB, minimumFee: %s sat/vB. Fasse mit maximal 400 Zeichen zusammen und schreibe im Stile eines Wetterberichtes aus dem Fernsehen um.', 'prompt' => sprintf('Erstelle einen Wetterbericht für den Bitcoin Mempool mit folgenden Gebühren: fastestFee: %s sat/vB, halfHourFee: %s sat/vB, hourFee: %s sat/vB, economyFee: %s sat/vB, minimumFee: %s sat/vB. Fasse mit maximal 400 Zeichen zusammen und schreibe im Stile eines Wetterberichtes aus dem Fernsehen um.',
$result['fastestFee'], $result['fastestFee'],
$result['halfHourFee'], $result['halfHourFee'],
$result['hourFee'], $result['hourFee'],
$result['economyFee'], $result['economyFee'],
$result['minimumFee'] $result['minimumFee']
), ),
'max_tokens' => 400, 'max_tokens' => 400,
'temperature' => 1 'temperature' => 1
]); ]);

View File

@@ -2,6 +2,7 @@
namespace App\Http\Livewire\Banner; namespace App\Http\Livewire\Banner;
use App\Console\Commands\MempoolSpace\CacheRecommendedFees;
use Illuminate\Support\Facades\Artisan; use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Http; use Illuminate\Support\Facades\Http;
use Livewire\Component; use Livewire\Component;
@@ -21,7 +22,7 @@ class MempoolWeather extends Component
if (cache()->has('mempool-weather')) { if (cache()->has('mempool-weather')) {
$this->weather = cache()->get('mempool-weather'); $this->weather = cache()->get('mempool-weather');
} else { } else {
Artisan::call('test'); Artisan::call(CacheRecommendedFees::class);
$this->weather = cache()->get('mempool-weather'); $this->weather = cache()->get('mempool-weather');
} }
$result = Http::get('https://mempool.space/api/v1/fees/recommended'); $result = Http::get('https://mempool.space/api/v1/fees/recommended');