Capture LLM Boundary • AI Agent SDK

capture_llm_boundary: Capture exact state at LLM call boundary.

capture_llm_boundary

Method

</div>

This is a method of the ContextManager class in the manager module.

Capture exact state at LLM call boundary.

Call this immediately before sending to LLM to get exact snapshot.

Signature

python
def capture_llm_boundary(messages: List[Dict[str, Any]], tools: List[Dict[str, Any]]) -> SnapshotHookData

Parameters

ParamField List

Exact messages being sent

ParamField List

Exact tool schemas being sent

Returns

ResponseField SnapshotHookData

SnapshotHookData with hashes for verification

Uses

  • json.dumps
  • hexdigest
  • hashlib.sha256
  • messages_json.encode
  • tools_json.encode
  • SnapshotHookData
  • isoformat
  • datetime.now
  • get_ledger
  • callback

Source

View on GitHub

praisonaiagents/context/manager.py at line 590


Related Documentation