IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).

Python class

Range

Range​

class max.pipelines.context.Range(start, end)

source

Bases: object

Represents a range with start and end indices.

Parameters:

  • start (int) – The inclusive start index.
  • end (int) – The exclusive end index.

advance()​

advance()

source

Advance the range to the next token.

Return type:

None

bump_end()​

bump_end(amount)

source

Bump the end index by the given amount.

Parameters:

amount (int) – The amount to bump the end index by.

Return type:

None

bump_start()​

bump_start(amount)

source

Bump the start index by the given amount.

Parameters:

amount (int) – The amount to bump the start index by.

Raises:

ValueError – If the new start index would exceed the end index.

Return type:

None

end​

end: int

source

start​

start: int

source