from __future__ import annotations

class PyFilterOptions:
    def __init__(self) -> None: ...
    def cmd3(self) -> PyFilterOptions: ...
    def cmd4(self) -> PyFilterOptions: ...
    def rag(self) -> PyFilterOptions: ...
    def multi_hop(self) -> PyFilterOptions: ...
    def search_query(self) -> PyFilterOptions: ...
    def with_chunk_size(self, size: int) -> PyFilterOptions: ...
    def with_left_trimmed(self) -> PyFilterOptions: ...
    def with_right_trimmed(self) -> PyFilterOptions: ...
    def with_inclusive_stops(self, stops: list[str]) -> PyFilterOptions: ...
    def with_exclusive_stops(self, stops: list[str]) -> PyFilterOptions: ...
    def stream_tool_actions(self) -> PyFilterOptions: ...
    def stream_processed_params(self) -> PyFilterOptions: ...
    def stream_non_grounded_answer(self) -> PyFilterOptions: ...
    def no_tools(self) -> PyFilterOptions: ...
    def remove_token(self, token: str) -> PyFilterOptions: ...

class Source:
    tool_call_index: int
    tool_result_indices: list[int]

class FilterCitation:
    start_index: int
    end_index: int
    text: str
    sources: list[Source]
    is_thinking: bool

class SearchQueryDelta:
    index: int
    text: str

class AccumulatedToolCall:
    index: int
    id: str
    name: str
    arguments: str

class FilterAggregatedResult:
    content: str | None
    reasoning: str | None
    tool_calls: list[AccumulatedToolCall]
    citations: list[FilterCitation]
    search_queries: list[SearchQueryDelta]

class PyFilter:
    def __init__(self, options: PyFilterOptions) -> None: ...
    @staticmethod
    def cmd3(chunk_size: int | None = None) -> PyFilter: ...
    @staticmethod
    def cmd4(chunk_size: int | None = None) -> PyFilter: ...
    def write_decoded(self, decoded_token: str) -> FilterAggregatedResult: ...
    def flush_partials(self) -> FilterAggregatedResult: ...
    def process_full(self, token_strings: list[str]) -> FilterAggregatedResult: ...
    def process_full_text(self, text: str) -> FilterAggregatedResult: ...

def render_cmd3(config: dict) -> str: ...
def render_cmd4(config: dict) -> str: ...
