|
Entropic 2.3.8
Local-first agentic inference engine
|
Implementation of the tool-result content classifiers (#44). More...

Go to the source code of this file.
Namespaces | |
| namespace | entropic |
| Activate model on GPU (WARM → ACTIVE). | |
Functions | |
| ENTROPIC_EXPORT bool | entropic::mcp::is_effectively_empty (std::string_view s) |
True if s is empty or contains only ASCII whitespace. | |
| bool | entropic::mcp::starts_with_json_error (std::string_view trimmed) |
| True if input begins with a JSON top-level "error" key. | |
| ENTROPIC_EXPORT void | entropic::mcp::truncate_to_cap (std::string &content, int cap) |
| Truncate tool-result content in place when it exceeds cap. | |
| ENTROPIC_EXPORT bool | entropic::mcp::looks_like_tool_error (std::string_view content) |
| Heuristic: the rendered tool-result text reads as an error. | |
Implementation of the tool-result content classifiers (#44).
Definition in file tool_result_classify.cpp.
| bool entropic::mcp::is_effectively_empty | ( | std::string_view | s | ) |
True if s is empty or contains only ASCII whitespace.
True if input is empty or contains only ASCII whitespace.
@utility
Definition at line 53 of file tool_result_classify.cpp.
| bool entropic::mcp::looks_like_tool_error | ( | std::string_view | content | ) |
Heuristic: the rendered tool-result text reads as an error.
Heuristic match for an error-shaped tool result string.
Recognises (case-insensitively, after stripping leading whitespace):
Error: … / ERROR …[error] …{ "error": … }Negative case: "… error somewhere in the middle" is NOT classified as error — only leading-token shapes count.
@utility
@utility
Definition at line 94 of file tool_result_classify.cpp.
|
inline |
True if input begins with a JSON top-level "error" key.
@utility
Definition at line 65 of file tool_result_classify.cpp.
| void entropic::mcp::truncate_to_cap | ( | std::string & | content, |
| int | cap | ||
| ) |
Truncate tool-result content in place when it exceeds cap.
Truncate content in place when it exceeds the byte cap.
Demo ask #6 (v2.1.0). When cap is 0, no-op. When content size exceeds cap, the content is shrunk to cap - tail.size() bytes followed by a trailing \\n[... truncated, N more bytes] marker so downstream consumers (the model, classification, the duplicate cache) see the bounded form with a clear signal that bytes were lost. Final size is ≤ cap.
| content | Mutable string; truncated in place when exceeded. |
| cap | Maximum byte length. 0 disables. @utility |
@utility
Definition at line 76 of file tool_result_classify.cpp.