Class: Insika::Evals::TurnResult
- Inherits:
-
Struct
- Object
- Struct
- Insika::Evals::TurnResult
- 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
-
#error ⇒ Object
Returns the value of attribute error.
-
#output_text ⇒ Object
Returns the value of attribute output_text.
-
#tool_calls ⇒ Object
Returns the value of attribute tool_calls.
Instance Method Summary collapse
-
#errored_tools ⇒ Object
A tool call whose status is anything but a success ("ok"/2xx/"success").
- #tool_names ⇒ Object
Instance Attribute Details
#error ⇒ Object
Returns the value of attribute error
18 19 20 |
# File 'lib/insika/evals/assertions.rb', line 18 def error @error end |
#output_text ⇒ Object
Returns the value of attribute output_text
18 19 20 |
# File 'lib/insika/evals/assertions.rb', line 18 def output_text @output_text end |
#tool_calls ⇒ Object
Returns the value of attribute tool_calls
18 19 20 |
# File 'lib/insika/evals/assertions.rb', line 18 def tool_calls @tool_calls end |
Instance Method Details
#errored_tools ⇒ Object
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_names ⇒ Object
19 |
# File 'lib/insika/evals/assertions.rb', line 19 def tool_names = Array(tool_calls).map { |t| (t["name"] || t[:name]).to_s } |