Skip to main content

agrag.agents.tools.aggregate.compute_over_evidence

compute_over_evidence(operation:Literal['count', 'sum', 'compare'], values:list[float], *, compare_op:Literal['gt', 'lt', 'eq'] | None = None) -> str

Compute a count, a sum, or a comparison over numbers you supply.

Use this instead of doing arithmetic in your head when a question asks how many, how much in total, or whether one figure exceeds another. It never queries the graph: pass the numbers you have already read from earlier tool results.

Parameters:

  • operation (Literal['count', 'sum', 'compare']) – "count" for how many values you supplied, "sum" for their total, "compare" for a comparison between exactly two of them.
  • values (list[float]) – The numbers to compute over, in the order you read them.
  • compare_op (Literal['gt', 'lt', 'eq'] | None) – Required for "compare": "gt" for values[0] greater than values[1], "lt" for less than, "eq" for equal.