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.
KnowledgeFacet
Section titled “KnowledgeFacet”from cayu.storage import KnowledgeFacetBases: BaseModel.
Fields and attributes
Section titled “Fields and attributes”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 |
validate_optional_clean_nonblank (method)
Section titled “validate_optional_clean_nonblank (method)”KnowledgeFacet.validate_optional_clean_nonblank(value: str | None, info) -> str | Nonevalidate_count (method)
Section titled “validate_count (method)”KnowledgeFacet.validate_count(value: int, info) -> intRelease source · Runtime guarantees · Capability guides
KnowledgeHit
Section titled “KnowledgeHit”from cayu.storage import KnowledgeHitBases: BaseModel.
Fields and attributes
Section titled “Fields and attributes”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) |
copy_entry (method)
Section titled “copy_entry (method)”KnowledgeHit.copy_entry(value)copy_chunk (method)
Section titled “copy_chunk (method)”KnowledgeHit.copy_chunk(value)validate_score (method)
Section titled “validate_score (method)”KnowledgeHit.validate_score(value, info)validate_rank (method)
Section titled “validate_rank (method)”KnowledgeHit.validate_rank(value: int | None, info) -> int | Nonevalidate_optional_nonblank_fields (method)
Section titled “validate_optional_nonblank_fields (method)”KnowledgeHit.validate_optional_nonblank_fields(value: str | None, info) -> str | Nonevalidate_text_preview_complete (method)
Section titled “validate_text_preview_complete (method)”KnowledgeHit.validate_text_preview_complete(value, info) -> boolvalidate_chunk_belongs_to_entry (method)
Section titled “validate_chunk_belongs_to_entry (method)”KnowledgeHit.validate_chunk_belongs_to_entry() -> KnowledgeHitRelease source · Runtime guarantees · Capability guides
KnowledgeListGroup
Section titled “KnowledgeListGroup”from cayu.storage import KnowledgeListGroupBases: StrEnum.
Fields and attributes
Section titled “Fields and attributes”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
KnowledgeListItem
Section titled “KnowledgeListItem”from cayu.storage import KnowledgeListItemBases: BaseModel.
Fields and attributes
Section titled “Fields and attributes”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) |
copy_entry (method)
Section titled “copy_entry (method)”KnowledgeListItem.copy_entry(value)validate_chunk_count (method)
Section titled “validate_chunk_count (method)”KnowledgeListItem.validate_chunk_count(value: int, info) -> intvalidate_optional_nonblank_text (method)
Section titled “validate_optional_nonblank_text (method)”KnowledgeListItem.validate_optional_nonblank_text(value: str | None, info) -> str | Nonevalidate_text_preview_complete (method)
Section titled “validate_text_preview_complete (method)”KnowledgeListItem.validate_text_preview_complete(value, info) -> boolvalidate_text_preview_provenance (method)
Section titled “validate_text_preview_provenance (method)”KnowledgeListItem.validate_text_preview_provenance() -> KnowledgeListItemRelease source · Runtime guarantees · Capability guides
KnowledgeListQuery
Section titled “KnowledgeListQuery”from cayu.storage import KnowledgeListQueryBases: BaseModel.
Fields and attributes
Section titled “Fields and attributes”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 |
copy_labels (method)
Section titled “copy_labels (method)”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 | Nonecopy_optional_string_list (method)
Section titled “copy_optional_string_list (method)”KnowledgeListQuery.copy_optional_string_list(value, info) -> list[str] | Nonevalidate_positive_int (method)
Section titled “validate_positive_int (method)”KnowledgeListQuery.validate_positive_int(value: int, info) -> intvalidate_statuses (method)
Section titled “validate_statuses (method)”KnowledgeListQuery.validate_statuses(value: list[KnowledgeStatus], info) -> list[KnowledgeStatus]validate_visibilities (method)
Section titled “validate_visibilities (method)”KnowledgeListQuery.validate_visibilities(value: list[KnowledgeVisibility] | None, info) -> list[KnowledgeVisibility] | NoneRelease source · Runtime guarantees · Capability guides
KnowledgeListResult
Section titled “KnowledgeListResult”from cayu.storage import KnowledgeListResultBases: BaseModel.
Fields and attributes
Section titled “Fields and attributes”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 |
copy_query (method)
Section titled “copy_query (method)”KnowledgeListResult.copy_query(value)copy_entries (method)
Section titled “copy_entries (method)”KnowledgeListResult.copy_entries(value)copy_facets (method)
Section titled “copy_facets (method)”KnowledgeListResult.copy_facets(value)validate_positive_int (method)
Section titled “validate_positive_int (method)”KnowledgeListResult.validate_positive_int(value: int, info) -> intvalidate_total_entries_known (method)
Section titled “validate_total_entries_known (method)”KnowledgeListResult.validate_total_entries_known(value: int | None, info) -> int | Nonevalidate_total_entries_known_covers_entries (method)
Section titled “validate_total_entries_known_covers_entries (method)”KnowledgeListResult.validate_total_entries_known_covers_entries() -> KnowledgeListResultvalidate_limits_match_query (method)
Section titled “validate_limits_match_query (method)”KnowledgeListResult.validate_limits_match_query() -> KnowledgeListResultvalidate_entry_and_facet_count (method)
Section titled “validate_entry_and_facet_count (method)”KnowledgeListResult.validate_entry_and_facet_count() -> KnowledgeListResultvalidate_facet_group (method)
Section titled “validate_facet_group (method)”KnowledgeListResult.validate_facet_group() -> KnowledgeListResultRelease source · Runtime guarantees · Capability guides
KnowledgeQuery
Section titled “KnowledgeQuery”from cayu.storage import KnowledgeQueryBases: BaseModel.
Fields and attributes
Section titled “Fields and attributes”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 |
copy_labels (method)
Section titled “copy_labels (method)”KnowledgeQuery.copy_labels(value) -> dict[str, str]validate_optional_nonblank_text (method)
Section titled “validate_optional_nonblank_text (method)”KnowledgeQuery.validate_optional_nonblank_text(value: str | None, info) -> str | Nonevalidate_optional_min_score (method)
Section titled “validate_optional_min_score (method)”KnowledgeQuery.validate_optional_min_score(value, info) -> float | Nonevalidate_clean_namespace (method)
Section titled “validate_clean_namespace (method)”KnowledgeQuery.validate_clean_namespace(value: str, info) -> strvalidate_optional_clean_nonblank_fields (method)
Section titled “validate_optional_clean_nonblank_fields (method)”KnowledgeQuery.validate_optional_clean_nonblank_fields(value: str | None, info) -> str | Nonecopy_optional_string_list (method)
Section titled “copy_optional_string_list (method)”KnowledgeQuery.copy_optional_string_list(value, info) -> list[str] | Nonecopy_aspect_groups (method)
Section titled “copy_aspect_groups (method)”KnowledgeQuery.copy_aspect_groups(value) -> list[list[str]]validate_positive_int (method)
Section titled “validate_positive_int (method)”KnowledgeQuery.validate_positive_int(value: int, info) -> intvalidate_statuses (method)
Section titled “validate_statuses (method)”KnowledgeQuery.validate_statuses(value: list[KnowledgeStatus], info) -> list[KnowledgeStatus]validate_visibilities (method)
Section titled “validate_visibilities (method)”KnowledgeQuery.validate_visibilities(value: list[KnowledgeVisibility] | None, info) -> list[KnowledgeVisibility] | Nonevalidate_has_positive_search_terms (method)
Section titled “validate_has_positive_search_terms (method)”KnowledgeQuery.validate_has_positive_search_terms() -> KnowledgeQueryRelease source · Runtime guarantees · Capability guides
KnowledgeSearchMode
Section titled “KnowledgeSearchMode”from cayu.storage import KnowledgeSearchModeBases: StrEnum.
Fields and attributes
Section titled “Fields and attributes”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
KnowledgeSearchResult
Section titled “KnowledgeSearchResult”from cayu.storage import KnowledgeSearchResultBases: BaseModel.
Fields and attributes
Section titled “Fields and attributes”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) |
copy_query (method)
Section titled “copy_query (method)”KnowledgeSearchResult.copy_query(value)copy_hits (method)
Section titled “copy_hits (method)”KnowledgeSearchResult.copy_hits(value)copy_index_coverage (method)
Section titled “copy_index_coverage (method)”KnowledgeSearchResult.copy_index_coverage(value: list[KnowledgeIndexCoverage]) -> list[KnowledgeIndexCoverage]validate_positive_int (method)
Section titled “validate_positive_int (method)”KnowledgeSearchResult.validate_positive_int(value: int, info) -> intvalidate_total_hits_known (method)
Section titled “validate_total_hits_known (method)”KnowledgeSearchResult.validate_total_hits_known(value: int | None, info) -> int | Nonevalidate_total_hits_known_covers_hits (method)
Section titled “validate_total_hits_known_covers_hits (method)”KnowledgeSearchResult.validate_total_hits_known_covers_hits() -> KnowledgeSearchResultvalidate_limits_match_query (method)
Section titled “validate_limits_match_query (method)”KnowledgeSearchResult.validate_limits_match_query() -> KnowledgeSearchResultvalidate_hit_count_and_ranks (method)
Section titled “validate_hit_count_and_ranks (method)”KnowledgeSearchResult.validate_hit_count_and_ranks() -> KnowledgeSearchResult