Skip to content

API Reference parrot_tools.querysource.models

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot_tools.querysource.models

View source

Pydantic models for QuerysourceToolkit inputs and outputs (spec §2 Data Models).

Class ComponentAttribute

Mirror of querysource AttributeInfo (registry.py:24).

Fields:

Field Type Default Description
name str
type str
default Any None
required bool False
description str ''

Class ComponentDoc

Mirror of querysource ComponentInfo (registry.py:34) — the /api/v3/qs/components payload.

Fields:

Field Type Default Description
name str
category str
description str
usage str
attributes list[ComponentAttribute]
json_schema dict[str, Any] | None None
example str ''
icon str ''

Class DashboardSource

One dashboard-owned data source (linked dashboards): fetched once, shared by any number of widgets.

Fields:

Field Type Default Description
slug str
request dict[str, Any] | None None
tenant str | None None
refresh dict[str, Any] | None None
transform dict[str, Any] | None None

Class DashboardWidget

One widget of a linked dashboard: its key, unbound component and exactly ONE data origin.

Origins (mutually exclusive):

  • slug — the widget owns a query-slug source (FEAT-610 shape; request/tenant/refresh apply).
  • source — the widget reads a dashboard-level source (sources[<key>]). Without transform it binds that source's rows directly; with transform (DSL ops) it becomes a derived view keyed by the widget key, computed from the parent's frame without another fetch.
  • data — inline rows baked into the dashboard's data model (no descriptor, never refreshed).

Fields:

Field Type Default Description
key str
component dict[str, Any]
section Literal['kpis', 'charts', 'table'] | None None
slug str | None None
request dict[str, Any] | None None
tenant str | None None
refresh dict[str, Any] | None None
source str | None None
transform dict[str, Any] | None None
data list[dict[str, Any]] | None None

Attributes:

Attribute Type Description
origin Literal['slug', 'source', 'data'] Which origin this widget declares.

Class DialectReference

The QuerySource conditions dialect as shown to the LLM (spec §3 M3).

Fields:

Field Type Default Description
verified_against str
option_keys dict[str, str]
placeholder_rules list[str]
where_grammar list[str]
operators_list_form list[str]
operators_dict_form list[str]
operators_jsonb list[str]
examples list[dict[str, Any]]
variables dict[str, str]
notes list[str]

Class ExecutionResult

Bounded, JSON-safe result of a slug execution (S8 naming).

Fields:

Field Type Default Description
status Literal['success', 'empty']
slug str | None None
rows list[dict[str, Any]]
returned_rows int
total_rows int | None None
truncated bool False
columns list[str]
applied_conditions dict[str, Any]
rejected_inputs list[str]
duration_ms int

Attribute FilterScalar

Attribute FilterValue

Class MultiQueryResult

Result of a MultiQuery run: one ExecutionResult per returned frame ('result' when single).

Fields:

Field Type Default Description
status Literal['success', 'empty']
results dict[str, ExecutionResult]
duration_ms int

Class PipelineIssue

One validation problem (mirrors querysource ValidationError(step, field, message)).

Fields:

Field Type Default Description
step str
field str
message str

Class PipelineValidation

Outcome of qs_validate_pipeline (structural rules + toolkit policy).

Fields:

Field Type Default Description
valid bool
issues list[PipelineIssue]
referenced_slugs list[str]
has_raw_nodes bool False
has_external_sources bool False
destination_steps list[str]

Class PlaceholderInfo

A declared placeholder: name, cond_definition type, stored default, and describe semantics.

required / accepts_keywords mirror querysource.queries.describe.build_variables exactly (describe.py:154 and :163 — FEAT-598 AC6).

Fields:

Field Type Default Description
name str
type str | None None
default Any None
required bool False
accepts_keywords bool False

Class SavedSlug

Outcome of qs_save_multiquery.

Fields:

Field Type Default Description
slug str
program_slug str
action Literal['inserted', 'updated']

Class SlugDetail

Full, redacted description of a slug (never source/params/attributes/dwh_*/cache_options).

Attributes:

Attribute Type Description
placeholders_detail list[PlaceholderInfo]
filtering dict[str, Any]
fields list[str]
ordering list[str]
grouping list[str]
is_cached bool
cache_timeout int
sql str | None
pipeline dict[str, Any] | None
rendered_query str | None
variables_supported bool

Class SlugSummary

One row of public.queries as shown by qs_list_slugs.

Fields:

Field Type Default Description
slug str
description str | None None
program_slug str
provider str
is_multiquery bool
placeholders list[str]

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally