|
Entropic 2.3.8
Local-first agentic inference engine
|
Fixed-size ring buffer of recent tool calls. More...
#include <entropic/mcp/tool_call_history.h>
Public Member Functions | |
| ToolCallHistory (size_t capacity=100) | |
| Construct with buffer capacity. | |
| void | record (const ToolCallRecord &entry) |
| Record a completed tool call. | |
| std::vector< ToolCallRecord > | recent (size_t count) const |
| Get the N most recent entries (newest first). | |
| std::vector< ToolCallRecord > | all () const |
| Get all stored entries (oldest first, insertion order). | |
| std::string | to_json (size_t count) const |
| Serialize recent entries to JSON array string. | |
| size_t | size () const |
| Current number of stored entries. | |
Fixed-size ring buffer of recent tool calls.
Capacity set at construction (default 100). When full, oldest entries are overwritten. Thread-safe reads via shared_mutex.
Definition at line 62 of file tool_call_history.h.
|
explicit |
Construct with buffer capacity.
| capacity | Maximum entries to retain (default 100). |
| capacity | Maximum entries to retain. |
Definition at line 25 of file tool_call_history.cpp.
| std::vector< ToolCallRecord > entropic::ToolCallHistory::all | ( | ) | const |
Get all stored entries (oldest first, insertion order).
Get all stored entries in insertion (oldest-first) order.
Definition at line 74 of file tool_call_history.cpp.
| std::vector< ToolCallRecord > entropic::ToolCallHistory::recent | ( | size_t | count | ) | const |
Get the N most recent entries (newest first).
| count | Maximum entries to return. |
| count | Maximum entries to return. |
Definition at line 55 of file tool_call_history.cpp.
| void entropic::ToolCallHistory::record | ( | const ToolCallRecord & | entry | ) |
Record a completed tool call.
| entry | Tool call record to store. |
| entry | Tool call record. |
Definition at line 37 of file tool_call_history.cpp.
| size_t entropic::ToolCallHistory::size | ( | ) | const |
Current number of stored entries.
Definition at line 132 of file tool_call_history.cpp.
| std::string entropic::ToolCallHistory::to_json | ( | size_t | count | ) | const |
Serialize recent entries to JSON array string.
| count | Maximum entries to include (0 = all). |
| count | Maximum entries (0 = all). |
Definition at line 117 of file tool_call_history.cpp.