File: /home/xedaptot/be.naniguide.com/vendor/anthropic-ai/sdk/src/Models/ModelListParams.php
<?php
declare(strict_types=1);
namespace Anthropic\Models;
use Anthropic\Beta\AnthropicBeta;
use Anthropic\Core\Attributes\Optional;
use Anthropic\Core\Concerns\SdkModel;
use Anthropic\Core\Concerns\SdkParams;
use Anthropic\Core\Contracts\BaseModel;
/**
* List available models.
*
* The Models API response can be used to determine which models are available for use in the API. More recently released models are listed first.
*
* @see Anthropic\Services\ModelsService::list()
*
* @phpstan-type ModelListParamsShape = array{
* afterID?: string|null,
* beforeID?: string|null,
* limit?: int|null,
* betas?: list<string|AnthropicBeta|value-of<AnthropicBeta>>|null,
* }
*/
final class ModelListParams implements BaseModel
{
/** @use SdkModel<ModelListParamsShape> */
use SdkModel;
use SdkParams;
/**
* ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately after this object.
*/
#[Optional]
public ?string $afterID;
/**
* ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately before this object.
*/
#[Optional]
public ?string $beforeID;
/**
* Number of items to return per page.
*
* Defaults to `20`. Ranges from `1` to `1000`.
*/
#[Optional]
public ?int $limit;
/**
* Optional header to specify the beta version(s) you want to use.
*
* @var list<string|value-of<AnthropicBeta>>|null $betas
*/
#[Optional(list: AnthropicBeta::class)]
public ?array $betas;
public function __construct()
{
$this->initialize();
}
/**
* Construct an instance from the required parameters.
*
* You must use named parameters to construct any parameters with a default value.
*
* @param list<string|AnthropicBeta|value-of<AnthropicBeta>>|null $betas
*/
public static function with(
?string $afterID = null,
?string $beforeID = null,
?int $limit = null,
?array $betas = null,
): self {
$self = new self;
null !== $afterID && $self['afterID'] = $afterID;
null !== $beforeID && $self['beforeID'] = $beforeID;
null !== $limit && $self['limit'] = $limit;
null !== $betas && $self['betas'] = $betas;
return $self;
}
/**
* ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately after this object.
*/
public function withAfterID(string $afterID): self
{
$self = clone $this;
$self['afterID'] = $afterID;
return $self;
}
/**
* ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately before this object.
*/
public function withBeforeID(string $beforeID): self
{
$self = clone $this;
$self['beforeID'] = $beforeID;
return $self;
}
/**
* Number of items to return per page.
*
* Defaults to `20`. Ranges from `1` to `1000`.
*/
public function withLimit(int $limit): self
{
$self = clone $this;
$self['limit'] = $limit;
return $self;
}
/**
* Optional header to specify the beta version(s) you want to use.
*
* @param list<string|AnthropicBeta|value-of<AnthropicBeta>> $betas
*/
public function withBetas(array $betas): self
{
$self = clone $this;
$self['betas'] = $betas;
return $self;
}
}