Skip to content

cayu.knowledge.search

Public Cayu API. Definitions are grouped by their public source module, and definitions from private implementation modules appear on their package’s page; adding a symbol does not move existing links. The import shown at each entry is a supported public namespace. Read the Python API overview and install the required extra.

from cayu.storage import KnowledgeFacet

Bases: BaseModel.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
field KnowledgeListGroup required
value str required
count int required
key str | None None
KnowledgeFacet.validate_optional_clean_nonblank(value: str | None, info) -> str | None
KnowledgeFacet.validate_count(value: int, info) -> int

Release source · Runtime guarantees · Capability guides

from cayu.storage import KnowledgeHit

Bases: BaseModel.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
entry KnowledgeEntry required
chunk KnowledgeChunk | None None
score float | None None
reason str | None None
rank int | None None
score_kind str | None None
score_normalized float | None None
text_preview str | None None
text_preview_complete bool Field(default=False, exclude=True, repr=False)
KnowledgeHit.copy_entry(value)
KnowledgeHit.copy_chunk(value)
KnowledgeHit.validate_score(value, info)
KnowledgeHit.validate_rank(value: int | None, info) -> int | None

validate_optional_nonblank_fields (method)

Section titled “validate_optional_nonblank_fields (method)”
KnowledgeHit.validate_optional_nonblank_fields(value: str | None, info) -> str | None
KnowledgeHit.validate_text_preview_complete(value, info) -> bool
KnowledgeHit.validate_chunk_belongs_to_entry() -> KnowledgeHit

Release source · Runtime guarantees · Capability guides

from cayu.storage import KnowledgeListGroup

Bases: StrEnum.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
KIND class attribute 'kind'
LABEL class attribute 'label'
ASPECT class attribute 'aspect'
IMPACT_TARGET class attribute 'impact_target'
VISIBILITY class attribute 'visibility'
SOURCE_TYPE class attribute 'source_type'
NAMESPACE class attribute 'namespace'

Release source · Runtime guarantees · Capability guides

from cayu.storage import KnowledgeListItem

Bases: BaseModel.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
entry KnowledgeEntry required
chunk_count int 0
text_preview str | None None
text_preview_complete bool Field(default=False, exclude=True, repr=False)
KnowledgeListItem.copy_entry(value)
KnowledgeListItem.validate_chunk_count(value: int, info) -> int
KnowledgeListItem.validate_optional_nonblank_text(value: str | None, info) -> str | None
KnowledgeListItem.validate_text_preview_complete(value, info) -> bool
KnowledgeListItem.validate_text_preview_provenance() -> KnowledgeListItem

Release source · Runtime guarantees · Capability guides

from cayu.storage import KnowledgeListQuery

Bases: BaseModel.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
namespace str | None None
labels dict[str, str] Field(default_factory=dict)
kinds list[str] | None None
statuses list[KnowledgeStatus] Field(default_factory=lambda: [KnowledgeStatus.ACTIVE])
visibilities list[KnowledgeVisibility] | None None
aspects list[str] Field(default_factory=list)
impact_targets list[str] Field(default_factory=list)
source_type str | None None
source_id str | None None
include_expired bool False
group_by KnowledgeListGroup | None None
limit int DEFAULT_KNOWLEDGE_LIMIT
max_bytes int DEFAULT_KNOWLEDGE_MAX_BYTES
KnowledgeListQuery.copy_labels(value) -> dict[str, str]

validate_optional_clean_nonblank_fields (method)

Section titled “validate_optional_clean_nonblank_fields (method)”
KnowledgeListQuery.validate_optional_clean_nonblank_fields(value: str | None, info) -> str | None
KnowledgeListQuery.copy_optional_string_list(value, info) -> list[str] | None
KnowledgeListQuery.validate_positive_int(value: int, info) -> int
KnowledgeListQuery.validate_statuses(value: list[KnowledgeStatus], info) -> list[KnowledgeStatus]
KnowledgeListQuery.validate_visibilities(value: list[KnowledgeVisibility] | None, info) -> list[KnowledgeVisibility] | None

Release source · Runtime guarantees · Capability guides

from cayu.storage import KnowledgeListResult

Bases: BaseModel.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
query KnowledgeListQuery required
entries list[KnowledgeListItem] Field(default_factory=list)
facets list[KnowledgeFacet] Field(default_factory=list)
facets_truncated bool False
truncated bool False
limit int required
max_bytes int required
total_entries_known int | None None
KnowledgeListResult.copy_query(value)
KnowledgeListResult.copy_entries(value)
KnowledgeListResult.copy_facets(value)
KnowledgeListResult.validate_positive_int(value: int, info) -> int
KnowledgeListResult.validate_total_entries_known(value: int | None, info) -> int | None

validate_total_entries_known_covers_entries (method)

Section titled “validate_total_entries_known_covers_entries (method)”
KnowledgeListResult.validate_total_entries_known_covers_entries() -> KnowledgeListResult
KnowledgeListResult.validate_limits_match_query() -> KnowledgeListResult
KnowledgeListResult.validate_entry_and_facet_count() -> KnowledgeListResult
KnowledgeListResult.validate_facet_group() -> KnowledgeListResult

Release source · Runtime guarantees · Capability guides

from cayu.storage import KnowledgeQuery

Bases: BaseModel.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
text str | None None
any_terms list[str] Field(default_factory=list)
all_terms list[str] Field(default_factory=list)
none_terms list[str] Field(default_factory=list)
phrases list[str] Field(default_factory=list)
namespace str DEFAULT_KNOWLEDGE_NAMESPACE
labels dict[str, str] Field(default_factory=dict)
kinds list[str] | None None
statuses list[KnowledgeStatus] Field(default_factory=lambda: [KnowledgeStatus.ACTIVE])
visibilities list[KnowledgeVisibility] | None None
aspects list[str] Field(default_factory=list)
aspect_groups list[list[str]] Field(default_factory=list)
impact_targets list[str] Field(default_factory=list)
source_type str | None None
source_id str | None None
mode KnowledgeSearchMode KnowledgeSearchMode.AUTO
min_score float | None None
include_expired bool False
limit int DEFAULT_KNOWLEDGE_LIMIT
max_bytes int DEFAULT_KNOWLEDGE_MAX_BYTES
KnowledgeQuery.copy_labels(value) -> dict[str, str]
KnowledgeQuery.validate_optional_nonblank_text(value: str | None, info) -> str | None
KnowledgeQuery.validate_optional_min_score(value, info) -> float | None
KnowledgeQuery.validate_clean_namespace(value: str, info) -> str

validate_optional_clean_nonblank_fields (method)

Section titled “validate_optional_clean_nonblank_fields (method)”
KnowledgeQuery.validate_optional_clean_nonblank_fields(value: str | None, info) -> str | None
KnowledgeQuery.copy_optional_string_list(value, info) -> list[str] | None
KnowledgeQuery.copy_aspect_groups(value) -> list[list[str]]
KnowledgeQuery.validate_positive_int(value: int, info) -> int
KnowledgeQuery.validate_statuses(value: list[KnowledgeStatus], info) -> list[KnowledgeStatus]
KnowledgeQuery.validate_visibilities(value: list[KnowledgeVisibility] | None, info) -> list[KnowledgeVisibility] | None

validate_has_positive_search_terms (method)

Section titled “validate_has_positive_search_terms (method)”
KnowledgeQuery.validate_has_positive_search_terms() -> KnowledgeQuery

Release source · Runtime guarantees · Capability guides

from cayu.storage import KnowledgeSearchMode

Bases: StrEnum.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
AUTO class attribute 'auto'
KEYWORD class attribute 'keyword'
SEMANTIC class attribute 'semantic'
HYBRID class attribute 'hybrid'
EXTERNAL class attribute 'external'

Release source · Runtime guarantees · Capability guides

from cayu.storage import KnowledgeSearchResult

Bases: BaseModel.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
query KnowledgeQuery required
hits list[KnowledgeHit] Field(default_factory=list)
truncated bool False
limit int required
max_bytes int required
total_hits_known int | None None
index_coverage list[KnowledgeIndexCoverage] Field(default_factory=list)
KnowledgeSearchResult.copy_query(value)
KnowledgeSearchResult.copy_hits(value)
KnowledgeSearchResult.copy_index_coverage(value: list[KnowledgeIndexCoverage]) -> list[KnowledgeIndexCoverage]
KnowledgeSearchResult.validate_positive_int(value: int, info) -> int
KnowledgeSearchResult.validate_total_hits_known(value: int | None, info) -> int | None

validate_total_hits_known_covers_hits (method)

Section titled “validate_total_hits_known_covers_hits (method)”
KnowledgeSearchResult.validate_total_hits_known_covers_hits() -> KnowledgeSearchResult
KnowledgeSearchResult.validate_limits_match_query() -> KnowledgeSearchResult
KnowledgeSearchResult.validate_hit_count_and_ranks() -> KnowledgeSearchResult

Release source · Runtime guarantees · Capability guides