Hej, podpowie, ktoś dlaczego mi to nie działa? Jeśli w funkcji getOutput wyświetle wynik: print_r($output); to się wszystko ładnie wyświetla więc komunikacja z API jest ok. Natomiast ja te dane potrzebuje przekazać do zmiennej output w funkcji isLabel.
Wydaje mi się, że mój problem jest związany z przekazaniem danych do funkcji isLabel (?).Ale od rana nie umiem znaleźć błędu.
Dostaję błąd, że w funkcji isLabel w linijce: $output = $this->getOutput("gota.jpg")->get(); że jest za mało argumentów.
Gorąca prośba o pomoc.
class klasa implements def
{
private $klient;
private function getOutput(string $Path)
{
return $this->klient->detectLabels([
'Image' => [
'Bucket' => 'bucket',
'Bytes' => file_get_contents($Path),
],
'MaxLabels' => 5,
'MinConfidence' => 50,
]);
}
public function isLabel(string $word): bool
{
$output = $this->getOutput("fota.jpg")->get();
print_r($output);
}
}