Documentation Index
Fetch the complete documentation index at: https://docs.camel-ai.org/llms.txt
Use this file to discover all available pages before exploring further.
TokenLimitTerminator
class TokenLimitTerminator(BaseTerminator):
Terminate agent if number of tokens reached to token limit threshold.
Parameters:
- token_limit (int): Token limit threshold.
init
def __init__(self, token_limit: int):
_validate
is_terminated
def is_terminated(self, num_tokens: int):
Whether terminate the agent by checking number of
used tokens reached to token limit.
Parameters:
- num_tokens (int): Number of tokens.
Returns:
tuple: A tuple containing whether the agent should be
terminated and a string of termination reason.
reset
Reset the terminator.