When you need to extract specific numeric information—such as the number of cards, items, or elements on a page—you can use the agent.get() method with an integer (int) response schema.

This approach is useful for validating counts, checking UI state, or making assertions in your tests.

Example Page

Suppose you have the following cards in your application:

Example:

number = agent.get("How many cards do you see?", response_schema=int)
assert number == 6, "There should be 6 cards on the page"

This approach allows you to extract and validate specific numeric values from your application, making your tests more precise and robust.

Tip:
Use clear, unambiguous questions to ensure reliable numeric answers from the agent.