knowledge
Classes
KnowledgeModel
Bases: BaseModel
Represents a knowledge base.
Attributes
meta
Metadata associated with the knowledge base.
Dict Fields
legacy(bool, optional): Whether this is a legacy knowledge base migrated from older versionsdocument(bool, optional): Whether this knowledge base represents a document-type structuretags(list[str], optional): List of tags associated with the knowledge baseid(str, optional): Knowledge base IDname(str, optional): Knowledge base namecollection_name(str, optional): Collection nametype(str, optional): Type of knowledge (e.g., 'file', 'collection')collection_names(list[str], optional): List of collection names for collection-type knowledge
Additional keys may exist. Complete structure not found in reference code.
access_control
Access control settings.
None: Public access, available to all users with the "user" role. Requires "sharing.public_knowledge" permission for non-admin users to set.{}: Private access, restricted exclusively to the owner.- Custom permissions: Specific access control for reading and writing. Can specify group or user-level restrictions. Example:
Dict Fields
read(dict, optional): Read access permissionswrite(dict, optional): Write access permissionsread.group_ids(list[str], optional): List of group IDs with read accessread.user_ids(list[str], optional): List of user IDs with read accesswrite.group_ids(list[str], optional): List of group IDs with write accesswrite.user_ids(list[str], optional): List of user IDs with write access
KnowledgeUserModel
Bases: KnowledgeModel
Represents a knowledge base with user information.
Inherits access_control from KnowledgeModel. Access is determined by:
- Direct user ownership (user_id matches)
- Access control permissions (read/write for groups and users)
- Admin users have full access regardless of access_control settings
- Code Reference models knowledge Classes KnowledgeUserResponse
Attributes
KnowledgeResponse
Bases: KnowledgeModel
Represents a knowledge base response, optionally including files.
Inherits meta from KnowledgeModel. See KnowledgeModel.meta for complete documentation
of the metadata structure and valid fields.
- Code Reference routers knowledge Classes KnowledgeClient Functions
- Code Reference models knowledge Classes KnowledgeFilesResponse
Attributes
files
files: Optional[list[Union[FileMetadataResponse, dict]]] = (
None
)
List of files associated with the knowledge base.
KnowledgeUserResponse
Bases: KnowledgeUserModel
Represents a knowledge base response including user information and files.
Inherits access_control from KnowledgeModel. See KnowledgeModel.access_control
for complete documentation of the access control structure and permissions.
- Code Reference routers knowledge Classes KnowledgeClient Functions get_knowledge_list
- Code Reference models knowledge Classes KnowledgeAccessResponse
Attributes
files
files: Optional[list[Union[FileMetadataResponse, dict]]] = (
None
)
List of files associated with the knowledge base.
KnowledgeForm
Bases: BaseModel
Form for creating or updating a knowledge base.
- Code Reference routers knowledge Classes KnowledgeClient Functions
Attributes
access_control
Access control settings.
None: Public access, available to all users with the "user" role.{}: Private access, restricted exclusively to the owner.- Custom permissions: Specific access control for reading and writing. Can specify group or user-level restrictions. Example:
Dict Fields
read(dict, optional): Read access permissionswrite(dict, optional): Write access permissionsread.group_ids(list[str], optional): List of group IDs with read accessread.user_ids(list[str], optional): List of user IDs with read accesswrite.group_ids(list[str], optional): List of group IDs with write accesswrite.user_ids(list[str], optional): List of user IDs with write access
KnowledgeFilesResponse
Bases: KnowledgeResponse
Represents a knowledge base response with full file metadata.
Inherits access_control from KnowledgeModel. Access control determines who can read and write to this knowledge base.
Attributes
files
files: Optional[list[FileMetadataResponse]] = None
List of files associated with the knowledge base.
write_access
Whether the current user has write access to the knowledge base.
warnings
Warnings returned during processing, e.g., if some files failed to process in a batch operation.
Dict Fields
message(str, required): Human-readable warning message describing the issueerrors(list[str], required): List of specific error details for failed operations
KnowledgeAccessResponse
Bases: KnowledgeUserResponse
Response model for knowledge base access information.
- Code Reference models knowledge Classes KnowledgeAccessListResponse Attributes items
KnowledgeAccessListResponse
Bases: BaseModel
Response model for a list of knowledge bases with access info.
- Code Reference routers knowledge Classes KnowledgeClient Functions
Attributes
FileUserResponse
Bases: FileModelResponse
File response with user details.
- Code Reference models knowledge Classes KnowledgeFileListResponse Attributes items
Attributes
KnowledgeFileListResponse
Bases: BaseModel
Response model for a list of knowledge base files.
- Code Reference routers knowledge Classes KnowledgeClient Functions search_knowledge_files