Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.galileo.ai/llms.txt

Use this file to discover all available pages before exploring further.

Module

Column wrapper for type-safe filtering and sorting.

Column

Wrapper for ColumnInfo that provides type-safe filtering and sorting. This class validates filter and sort operations based on the column’s data_type and sortable attributes, ensuring only valid operations are performed. Examples
# Access columns from a log stream
log_stream = LogStream.get(name="Production Logs", project_name="My AI Project")

# Filter and sort using columns
traces = log_stream.get_traces(
    filters=[
        log_stream.trace_columns["input"].contains("hello"),
        log_stream.trace_columns["created_at"].after("2024-01-01")
    ],
    sort=log_stream.trace_columns["created_at"].descending()
)

after

def after(self, value: str | datetime.datetime) -> LogRecordsDateFilter
Filter for dates after a value (exclusive). Arguments
  • value: The threshold date (string or datetime).

ascending

def ascending(self) -> LogRecordsSortClause
Sort in ascending order.

Returns

LogRecordsSortClause: A configured sort clause.

Raises

ValidationError: If the column is not sortable.

before

def before(self, value: str | datetime.datetime) -> LogRecordsDateFilter
Filter for dates before a value (exclusive). Arguments
  • value: The threshold date (string or datetime).

between

def between(self,
            min_value: int | float,
            max_value: int | float) -> LogRecordsNumberFilter
Filter for numbers within a range (inclusive). Arguments
  • min_value: The minimum value (inclusive).
  • max_value: The maximum value (inclusive).

contains

def contains(self, value: str, case_sensitive: bool=True) -> LogRecordsTextFilter
Filter for text that contains a substring. Arguments
  • value: The substring to search for.
  • case_sensitive: Whether the search should be case-sensitive. Default is True.

descending

def descending(self) -> LogRecordsSortClause
Sort in descending order.

Returns

LogRecordsSortClause: A configured sort clause.

Raises

ValidationError: If the column is not sortable.

equals

def equals(self,
           value: str | bool,
           case_sensitive: bool=True) -> LogRecordsTextFilter | LogRecordsBooleanFilter
Filter for exact value match. For text columns, performs exact text matching. For boolean columns, performs boolean equality. Arguments
  • value: The value to match (string for text columns, boolean for boolean columns).
  • case_sensitive: Whether text matching should be case-sensitive. Default is True. Ignored for boolean columns.

greater_than

def greater_than(self, value: int | float) -> LogRecordsNumberFilter
Filter for numbers greater than a value. Arguments
  • value: The threshold value (exclusive).

greater_than_or_equal

def greater_than_or_equal(self, value: int | float) -> LogRecordsNumberFilter
Filter for numbers greater than or equal to a value. Arguments
  • value: The threshold value (inclusive).

is_false

def is_false(self) -> LogRecordsBooleanFilter
Filter for boolean columns that are False. Examples
log_stream.session_columns["has_error"].is_false()

is_true

def is_true(self) -> LogRecordsBooleanFilter
Filter for boolean columns that are True. Examples
log_stream.session_columns["has_error"].is_true()

less_than

def less_than(self, value: int | float) -> LogRecordsNumberFilter
Filter for numbers less than a value. Arguments
  • value: The threshold value (exclusive).

less_than_or_equal

def less_than_or_equal(self, value: int | float) -> LogRecordsNumberFilter
Filter for numbers less than or equal to a value. Arguments
  • value: The threshold value (inclusive).

not_equals

def not_equals(self, value: str, case_sensitive: bool=True) -> LogRecordsTextFilter
Filter for text that does not match. Arguments
  • value: The text value to exclude.
  • case_sensitive: Whether the match should be case-sensitive. Default is True.

not_in

def not_in(self,
           values: list[str],
           case_sensitive: bool=True) -> LogRecordsTextFilter
Filter for text that does not match any value in a list. Arguments
  • values: List of text values to exclude.
  • case_sensitive: Whether the match should be case-sensitive. Default is True.

on_or_after

def on_or_after(self, value: str | datetime.datetime) -> LogRecordsDateFilter
Filter for dates on or after a value (inclusive). Arguments
  • value: The threshold date (string or datetime).

on_or_before

def on_or_before(self, value: str | datetime.datetime) -> LogRecordsDateFilter
Filter for dates on or before a value (inclusive). Arguments
  • value: The threshold date (string or datetime).

one_of

def one_of(self,
           values: list[str],
           case_sensitive: bool=True) -> LogRecordsTextFilter
Filter for text that matches any value in a list. Arguments
  • values: List of text values to match.
  • case_sensitive: Whether the match should be case-sensitive. Default is True.

ColumnCollection

A dictionary-like collection of Column objects for easy access by column ID. This class provides convenient access to columns using dictionary syntax, while also supporting iteration and other collection operations. Inherits from Mapping[str, Column] to provide a read-only mapping interface. Examples
log_stream = LogStream.get(name="Production Logs", project_name="My AI Project")

# Access a column by ID
input_column = log_stream.trace_columns["input"]

# Iterate over column IDs
for column_id in log_stream.trace_columns:
    print(column_id)

# Iterate over Column objects
for column in log_stream.trace_columns.values():
    print(column)

# Check if a column exists
if "input" in log_stream.trace_columns:
    print("Input column exists")