Documentation Index
Fetch the complete documentation index at: https://reagent-ai.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Installation
Setup
Wrap your Anthropic client withpatch():
patch() wraps client.messages.create to automatically log tool_use content blocks into the active reagent-flow session.
Basic usage
Tool result capture
When you thread tool results back as user messages withtool_result content blocks, the adapter captures them automatically:
The adapter handles both string content and list-of-text-blocks content in
tool_result blocks. JSON-encoded content is automatically decoded for schema validation.What gets captured
| Data | Source | Logged as |
|---|---|---|
| Tool calls | tool_use content blocks | log_llm_call(tool_calls=...) |
| Response text | text content blocks | log_llm_call(response_text=...) |
| Model name | response.model | log_llm_call(model=...) |
| Token usage | response.usage (input_tokens, output_tokens) | log_llm_call(token_usage=...) |
| Tool results | tool_result blocks in next call’s user messages | log_tool_result(...) |
Streaming
Streaming (stream=True) is detected and skipped with a warning. Use stream=False for traced calls.
No session active
If no reagent-flow session is active whencreate() is called, the adapter is a no-op.