|
Entropic 2.14.3
Local-first agentic inference engine
|
Result of a single generation call. More...
#include <entropic/types/generation_result.h>

Public Member Functions | |
| bool | ok () const |
| True if generation completed without error. | |
Public Attributes | |
| std::string | content |
| Generated text (cleaned by adapter) | |
| std::string | raw_content |
| Raw model output before adapter processing. | |
| std::vector< ToolCall > | tool_calls |
| Tool calls parsed from content. | |
| std::string | finish_reason = "stop" |
| Finish reason: "stop", "length", "error". | |
| int | token_count = 0 |
| Generated token count. | |
| double | generation_time_ms = 0.0 |
| Wall-clock generation time. | |
| int | prefill_tokens = 0 |
| Prompt tokens actually pushed through llama_decode during this run's prefill (gh#144, v2.12.0). | |
| double | routing_ms = 0.0 |
| Router classification time. | |
| double | swap_ms = 0.0 |
| Model swap time. | |
| double | total_ms = 0.0 |
| Total end-to-end time. | |
| double | throughput_tok_s = 0.0 |
| Measured throughput for this generation (tok/s). | |
| bool | time_limited = false |
| true if generation was terminated by time limit rather than EOS/stop sequence/max_tokens. | |
| int | original_max_tokens = 0 |
| Original max_tokens before auto-adaptation reduced it. | |
| int | seq_id = 0 |
| Sequence identifier for multi-sequence backends. | |
| int | n_drafted = 0 |
| Tokens proposed by the draft/MTP head across all rounds. | |
| int | n_accepted = 0 |
| Draft tokens the target accepted (≤ n_drafted). | |
| GrammarProvenance | grammar |
| What constrained this decode and who asked for it. | |
| entropic_error_t | error_code = ENTROPIC_OK |
| Error code (ENTROPIC_OK if no error) | |
| std::string | error_message |
| Error description (empty if no error) | |
Result of a single generation call.
Maps to Python GenerationResult dataclass.
Definition at line 64 of file generation_result.h.
|
inline |
True if generation completed without error.
Definition at line 143 of file generation_result.h.
| std::string entropic::GenerationResult::content |
Generated text (cleaned by adapter)
Definition at line 65 of file generation_result.h.
| entropic_error_t entropic::GenerationResult::error_code = ENTROPIC_OK |
Error code (ENTROPIC_OK if no error)
Definition at line 134 of file generation_result.h.
| std::string entropic::GenerationResult::error_message |
Error description (empty if no error)
Definition at line 135 of file generation_result.h.
| std::string entropic::GenerationResult::finish_reason = "stop" |
Finish reason: "stop", "length", "error".
Definition at line 68 of file generation_result.h.
| double entropic::GenerationResult::generation_time_ms = 0.0 |
Wall-clock generation time.
Definition at line 70 of file generation_result.h.
| GrammarProvenance entropic::GenerationResult::grammar |
What constrained this decode and who asked for it.
Populated by the orchestrator from the SAME inputs the sampler's application site uses, so the record cannot disagree with what ran.
Definition at line 131 of file generation_result.h.
| int entropic::GenerationResult::n_accepted = 0 |
Draft tokens the target accepted (≤ n_drafted).
>0 proves the head's drafts are lossless-verified hits, not just proposed.
Definition at line 123 of file generation_result.h.
| int entropic::GenerationResult::n_drafted = 0 |
Tokens proposed by the draft/MTP head across all rounds.
0 when no speculative kernel ran (plain decode). The instrumentation signal that MTP/speculative actually engaged vs silently fell back.
Definition at line 118 of file generation_result.h.
| int entropic::GenerationResult::original_max_tokens = 0 |
Original max_tokens before auto-adaptation reduced it.
0 if no adaptation occurred.
Definition at line 102 of file generation_result.h.
| int entropic::GenerationResult::prefill_tokens = 0 |
Prompt tokens actually pushed through llama_decode during this run's prefill (gh#144, v2.12.0).
The instrumentation every prefill-reuse claim rests on. A correctness test passes via full-reprefill fallback even when reuse is completely dead, so "the answer was right" says nothing about whether a prefix was reused — this does. Zero when the path does not report it.
Definition at line 80 of file generation_result.h.
| std::string entropic::GenerationResult::raw_content |
Raw model output before adapter processing.
Definition at line 66 of file generation_result.h.
| double entropic::GenerationResult::routing_ms = 0.0 |
Router classification time.
Definition at line 83 of file generation_result.h.
| int entropic::GenerationResult::seq_id = 0 |
Sequence identifier for multi-sequence backends.
0 for single-sequence backends (default). Set by generate_seq() to track which sequence produced this result.
Definition at line 110 of file generation_result.h.
| double entropic::GenerationResult::swap_ms = 0.0 |
Model swap time.
Definition at line 84 of file generation_result.h.
| double entropic::GenerationResult::throughput_tok_s = 0.0 |
Measured throughput for this generation (tok/s).
Computed from token_count / generation_time_ms. 0.0 if either is 0.
Definition at line 92 of file generation_result.h.
true if generation was terminated by time limit rather than EOS/stop sequence/max_tokens.
Definition at line 97 of file generation_result.h.
| int entropic::GenerationResult::token_count = 0 |
Generated token count.
Definition at line 69 of file generation_result.h.
| std::vector<ToolCall> entropic::GenerationResult::tool_calls |
Tool calls parsed from content.
Definition at line 67 of file generation_result.h.
| double entropic::GenerationResult::total_ms = 0.0 |
Total end-to-end time.
Definition at line 85 of file generation_result.h.