[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/php-ai-client/src/Common/Exception/ -> TokenLimitReachedException.php (summary)

(no description)

File Size: 50 lines (1 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

TokenLimitReachedException:: (2 methods):
  __construct()
  getMaxTokens()


Class: TokenLimitReachedException  - X-Ref

Exception thrown when a token limit is reached during prompt fulfillment.

Providers should throw this exception when the token usage for a request
exceeds the allowed limit, whether that is the model's context window
or a configured maximum.

__construct(string $message = '', ?int $maxTokens = null, ?\Throwable $previous = null)   X-Ref
Creates a new TokenLimitReachedException.

param: string         $message   The exception message.
param: int|null       $maxTokens The token limit that was reached, if known.
param: \Throwable|null $previous  The previous throwable used for exception chaining.

getMaxTokens()   X-Ref
Returns the token limit that was reached, if known.

return: int|null The token limit, or null if not provided.



Generated : Sat Jun 13 09:38:55 2026 Cross-referenced by PHPXref