Shared source protocols and types.
A source is anything that produces typed data — a database, an LLM, a file watcher, a message queue. Sources have two modes:
- fetch: produce a complete result (
await source.fetch()) - stream: produce results incrementally (
async for item in source.stream())
Both modes yield frozen dataclasses. The template engine (kida) renders them
identically regardless of origin. AUser from Postgres and a Summary
from Claude are both just frozen dataclasses in a template context.
This module defines the shared vocabulary thatchirp.data and chirp.ai
build on. Application code rarely imports from here directly.
sources
| Name | Type | Default | Description |
|---|---|---|---|
type
|
|
— | |
qualified_name
|
|
— | |
element_type
|
|
— | |
description
|
|
— | |
source_file
|
|
— | |
line_number
|
|
— | |
is_autodoc
|
|
— | |
autodoc_element
|
|
— | |
_autodoc_template
|
|
— | |
_autodoc_url_path
|
|
— | |
_autodoc_page_type
|
|
— | |
title
|
|
— | |
doc_content_hash
|
|
— |
Symbols on this page
Fetchable
class
A source that can produce a complete typed result.
Streamable
class
A source that can produce results incrementally.
Source
class
A source that supports both fetch and stream access.
View source · /home/runner/work/chirp/chirp/site/../src/chirp/sources.py:1