mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
mempool weather added
This commit is contained in:
@@ -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
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|||||||
@@ -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');
|
||||||
|
|||||||
Reference in New Issue
Block a user