Get Segment • AI Agent SDK

get_segment: Get token count for a segment.

get_segment

Method

</div>

This is a method of the ContextLedger class in the models module.

Get token count for a segment.

Signature

python
def get_segment(segment: ContextSegment) -> int

Parameters

ParamField ContextSegment

No description available.

Returns

ResponseField int

The result of the operation.

Used By

Source

View on GitHub

praisonaiagents/context/models.py at line 64