Spaces:
Sleeping
Sleeping
Download apps/php-sdk/src/Models/JsonFormat.php from s-eto-hub/firecrawl-api: direct link, hf CLI and curl.
- Browser
- Download file 987 Bytes
-
https://huggingface.co/spaces/s-eto-hub/firecrawl-api/resolve/main/apps/php-sdk/src/Models/JsonFormat.php
- Command line
-
hf download hf://spaces/s-eto-hub/firecrawl-api/apps/php-sdk/src/Models/JsonFormat.php
-
curl -L -o JsonFormat.php https://huggingface.co/spaces/s-eto-hub/firecrawl-api/resolve/main/apps/php-sdk/src/Models/JsonFormat.php
987 Bytes
| declare(strict_types=1); | |
| namespace Firecrawl\Models; | |
| final class JsonFormat | |
| { | |
| private function __construct( | |
| private readonly ?string $prompt = null, | |
| /** @var array<string, mixed>|null */ | |
| private readonly ?array $schema = null, | |
| ) {} | |
| /** | |
| * @param array<string, mixed>|null $schema | |
| */ | |
| public static function with( | |
| ?string $prompt = null, | |
| ?array $schema = null, | |
| ): self { | |
| return new self($prompt, $schema); | |
| } | |
| /** @return array<string, mixed> */ | |
| public function toArray(): array | |
| { | |
| return array_filter([ | |
| 'type' => 'json', | |
| 'prompt' => $this->prompt, | |
| 'schema' => $this->schema, | |
| ], fn (mixed $v): bool => $v !== null); | |
| } | |
| public function getPrompt(): ?string | |
| { | |
| return $this->prompt; | |
| } | |
| /** @return array<string, mixed>|null */ | |
| public function getSchema(): ?array | |
| { | |
| return $this->schema; | |
| } | |
| } | |