Class: Braintrust::API::Internal::BTQL
- Inherits:
-
Object
- Object
- Braintrust::API::Internal::BTQL
- Defined in:
- lib/braintrust/api/internal/btql.rb
Overview
Internal BTQL client for querying spans. Not part of the public API — instantiated directly where needed.
Instance Method Summary collapse
-
#initialize(state) ⇒ BTQL
constructor
A new instance of BTQL.
-
#trace_spans(object_type:, object_id:, root_span_id:) ⇒ Array(Array<Hash>, String)
Query spans belonging to a specific trace within an object.
Constructor Details
#initialize(state) ⇒ BTQL
Returns a new instance of BTQL.
14 15 16 |
# File 'lib/braintrust/api/internal/btql.rb', line 14 def initialize(state) @state = state end |
Instance Method Details
#trace_spans(object_type:, object_id:, root_span_id:) ⇒ Array(Array<Hash>, String)
Query spans belonging to a specific trace within an object.
Builds a BTQL SQL query that matches the root_span_id and excludes scorer spans. Returns a single-shot result; callers are responsible for retry and error handling.
27 28 29 30 31 32 33 34 |
# File 'lib/braintrust/api/internal/btql.rb', line 27 def trace_spans(object_type:, object_id:, root_span_id:) query = build_trace_query( object_type: object_type, object_id: object_id, root_span_id: root_span_id ) execute_query(query: query, fmt: "jsonl") end |