> ## 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.

# filter

## Module

Declarative filter builders for SDK queries.

## Filter

Base class for declarative filter construction.

This class defines the interface for building type-safe filters
that can be used with LogStream queries and other SDK operations.

## TextFilter

Builder for text-based filters.

Supports operators: equals, not\_equals, contains, one\_of, not\_in

**Examples**

```python theme={null}
text("input").equals("hello")
text("status").contains("error")
text("name").one_of(["Alice", "Bob"])
```

### contains

```python theme={null}
def contains(self, value: str) -> LogRecordsTextFilter
```

Filter for text that contains a substring.

**Arguments**

* `value`: The substring to search for.

### equals

```python theme={null}
def equals(self, value: str) -> LogRecordsTextFilter
```

Filter for exact text match.

**Arguments**

* `value`: The text value to match.

### not\_equals

```python theme={null}
def not_equals(self, value: str) -> LogRecordsTextFilter
```

Filter for text that does not match.

**Arguments**

* `value`: The text value to exclude.

### not\_in

```python theme={null}
def not_in(self, values: list[str]) -> LogRecordsTextFilter
```

Filter for text that does not match any value in a list.

**Arguments**

* `values`: List of text values to exclude.

### one\_of

```python theme={null}
def one_of(self, values: list[str]) -> LogRecordsTextFilter
```

Filter for text that matches any value in a list.

**Arguments**

* `values`: List of text values to match.

## NumberFilter

Builder for number-based filters.

Supports operators: equals, not\_equals, greater\_than, greater\_than\_or\_equal,
less\_than, less\_than\_or\_equal, between

**Examples**

```python theme={null}
number("score").greater_than(0.8)
number("count").between(10, 100)
number("rating").equals(5)
```

### between

```python theme={null}
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).

### equals

```python theme={null}
def equals(self, value: int | float) -> LogRecordsNumberFilter
```

Filter for exact number match.

**Arguments**

* `value`: The number to match.

### greater\_than

```python theme={null}
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

```python theme={null}
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).

### less\_than

```python theme={null}
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

```python theme={null}
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

```python theme={null}
def not_equals(self, value: int | float) -> LogRecordsNumberFilter
```

Filter for numbers that don't match.

**Arguments**

* `value`: The number to exclude.

## DateFilter

Builder for date-based filters.

Supports operators: equals, not\_equals, before, after, on\_or\_before, on\_or\_after

**Examples**

```python theme={null}
date("created_at").after("2024-01-01")
date("updated_at").before(datetime.now())
date("published_at").on_or_after("2024-01-01")
```

### after

```python theme={null}
def after(self, value: str | datetime.datetime) -> LogRecordsDateFilter
```

Filter for dates after a value (exclusive).

**Arguments**

* `value`: The threshold date (string or datetime).

### before

```python theme={null}
def before(self, value: str | datetime.datetime) -> LogRecordsDateFilter
```

Filter for dates before a value (exclusive).

**Arguments**

* `value`: The threshold date (string or datetime).

### equals

```python theme={null}
def equals(self, value: str | datetime.datetime) -> LogRecordsDateFilter
```

Filter for exact date match.

**Arguments**

* `value`: The date to match (string or datetime).

### not\_equals

```python theme={null}
def not_equals(self, value: str | datetime.datetime) -> LogRecordsDateFilter
```

Filter for dates that don't match.

**Arguments**

* `value`: The date to exclude (string or datetime).

### on\_or\_after

```python theme={null}
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

```python theme={null}
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).

## BooleanFilter

Builder for boolean-based filters.

Boolean filters are simple equality checks - there are no operators,
just matching against true or false values.

**Examples**

```python theme={null}
boolean("is_active").is_true()
boolean("has_error").is_false()
boolean("enabled").equals(True)
```

### equals

```python theme={null}
def equals(self, value: bool) -> LogRecordsBooleanFilter
```

Filter for exact boolean match.

**Arguments**

* `value`: The boolean value to match (True or False).

### is\_false

```python theme={null}
def is_false(self) -> LogRecordsBooleanFilter
```

Filter for boolean columns that are False.

## Returns

LogRecordsBooleanFilter: A configured boolean filter for False.

### is\_true

```python theme={null}
def is_true(self) -> LogRecordsBooleanFilter
```

Filter for boolean columns that are True.

## Returns

LogRecordsBooleanFilter: A configured boolean filter for True.

## boolean

```python theme={null}
def boolean(column_id: str) -> BooleanFilter
```

Create a boolean filter builder.

**Arguments**

* `column_id`: The ID of the column to filter on.

## date

```python theme={null}
def date(column_id: str) -> DateFilter
```

Create a date filter builder.

**Arguments**

* `column_id`: The ID of the column to filter on.

## number

```python theme={null}
def number(column_id: str) -> NumberFilter
```

Create a number filter builder.

**Arguments**

* `column_id`: The ID of the column to filter on.

## text

```python theme={null}
def text(column_id: str, case_sensitive: bool=True) -> TextFilter
```

Create a text filter builder.

**Arguments**

* `column_id`: The ID of the column to filter on.
* `case_sensitive`: Whether the filter should be case-sensitive. Default is True.
