Class: Insika::Evals::TurnResult

Inherits:
Struct
  • Object
show all
Defined in:
lib/insika/evals/assertions.rb

Overview

What the runner extracts from ONE replayed conversation, entirely from the public SSE stream of POST /v1/responses (no store reads — the eval stays a client). The assertion engine is pure over this value, so it's unit-testable offline without a server.

output_text: the final assistant text (for content checks)
tool_calls:  [{ "name" =>, "status" => }] captured from the stream's tool events
error:       transport/turn error string, or nil on a clean turn

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#errorObject

Returns the value of attribute error

Returns:

  • (Object)

    the current value of error



18
19
20
# File 'lib/insika/evals/assertions.rb', line 18

def error
  @error
end

#output_textObject

Returns the value of attribute output_text

Returns:

  • (Object)

    the current value of output_text



18
19
20
# File 'lib/insika/evals/assertions.rb', line 18

def output_text
  @output_text
end

#tool_callsObject

Returns the value of attribute tool_calls

Returns:

  • (Object)

    the current value of tool_calls



18
19
20
# File 'lib/insika/evals/assertions.rb', line 18

def tool_calls
  @tool_calls
end

Instance Method Details

#errored_toolsObject

A tool call whose status is anything but a success ("ok"/2xx/"success").



22
23
24
# File 'lib/insika/evals/assertions.rb', line 22

def errored_tools
  Array(tool_calls).reject { |t| Assertions.ok_status?(t["status"] || t[:status]) }
end

#tool_namesObject



19
# File 'lib/insika/evals/assertions.rb', line 19

def tool_names = Array(tool_calls).map { |t| (t["name"] || t[:name]).to_s }