Entropic 2.3.8
Local-first agentic inference engine
Loading...
Searching...
No Matches
entropic::GenerationResult Struct Reference

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< ToolCalltool_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.
 
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.
 
entropic_error_t error_code = ENTROPIC_OK
 Error code (ENTROPIC_OK if no error)
 
std::string error_message
 Error description (empty if no error)
 

Detailed Description

Result of a single generation call.

Maps to Python GenerationResult dataclass.

Version
1.8.2

Definition at line 30 of file generation_result.h.

Member Function Documentation

◆ ok()

bool entropic::GenerationResult::ok ( ) const
inline

True if generation completed without error.

Returns
true when error_code == ENTROPIC_OK. @utility
Version
1.8.2

Definition at line 78 of file generation_result.h.

Member Data Documentation

◆ content

std::string entropic::GenerationResult::content

Generated text (cleaned by adapter)

Definition at line 31 of file generation_result.h.

◆ error_code

entropic_error_t entropic::GenerationResult::error_code = ENTROPIC_OK

Error code (ENTROPIC_OK if no error)

Definition at line 69 of file generation_result.h.

◆ error_message

std::string entropic::GenerationResult::error_message

Error description (empty if no error)

Definition at line 70 of file generation_result.h.

◆ finish_reason

std::string entropic::GenerationResult::finish_reason = "stop"

Finish reason: "stop", "length", "error".

Definition at line 34 of file generation_result.h.

◆ generation_time_ms

double entropic::GenerationResult::generation_time_ms = 0.0

Wall-clock generation time.

Definition at line 36 of file generation_result.h.

◆ original_max_tokens

int entropic::GenerationResult::original_max_tokens = 0

Original max_tokens before auto-adaptation reduced it.

0 if no adaptation occurred.

Version
1.9.7

Definition at line 58 of file generation_result.h.

◆ raw_content

std::string entropic::GenerationResult::raw_content

Raw model output before adapter processing.

Definition at line 32 of file generation_result.h.

◆ routing_ms

double entropic::GenerationResult::routing_ms = 0.0

Router classification time.

Definition at line 39 of file generation_result.h.

◆ seq_id

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.

Version
1.9.13

Definition at line 66 of file generation_result.h.

◆ swap_ms

double entropic::GenerationResult::swap_ms = 0.0

Model swap time.

Definition at line 40 of file generation_result.h.

◆ throughput_tok_s

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.

Version
1.9.7

Definition at line 48 of file generation_result.h.

◆ time_limited

bool entropic::GenerationResult::time_limited = false

true if generation was terminated by time limit rather than EOS/stop sequence/max_tokens.

Version
1.9.7

Definition at line 53 of file generation_result.h.

◆ token_count

int entropic::GenerationResult::token_count = 0

Generated token count.

Definition at line 35 of file generation_result.h.

◆ tool_calls

std::vector<ToolCall> entropic::GenerationResult::tool_calls

Tool calls parsed from content.

Definition at line 33 of file generation_result.h.

◆ total_ms

double entropic::GenerationResult::total_ms = 0.0

Total end-to-end time.

Definition at line 41 of file generation_result.h.


The documentation for this struct was generated from the following file: