Skip to content

SampledSequence

Source code in docs_src/capo_sagemakertrainingsessionruntime/types/sampled_sequence.py
class SampledSequence(TypedDict, closed=True):
    stop_reason: "capo_sagemakertrainingsessionruntime.types.stop_reason.StopReason"
    """<p>The reason why generation stopped. A value of <code>stop</code> indicates a stop sequence was encountered. A value of <code>length</code> indicates the maximum token limit was reached.</p>"""
    tokens: "capo_sagemakertrainingsessionruntime.types.integer_list.IntegerList"
    """<p>The token IDs of the generated sequence.</p>"""
    logprobs: NotRequired[
        "capo_sagemakertrainingsessionruntime.types.double_list.DoubleList"
    ]
    """<p>The per-token log-probabilities for the generated tokens.</p>"""
    token_usage: NotRequired[
        "capo_sagemakertrainingsessionruntime.types.sample_token_usage.SampleTokenUsage"
    ]
    """<p>The token usage statistics for this individual sample.</p>"""

logprobs instance-attribute

logprobs: NotRequired[DoubleList]

The per-token log-probabilities for the generated tokens.

stop_reason instance-attribute

stop_reason: StopReason

The reason why generation stopped. A value of stop indicates a stop sequence was encountered. A value of length indicates the maximum token limit was reached.

token_usage instance-attribute

token_usage: NotRequired[SampleTokenUsage]

The token usage statistics for this individual sample.

tokens instance-attribute

tokens: IntegerList

The token IDs of the generated sequence.