Overview

The DocumentListResponse struct represents the response returned when fetching documents from a knowledge base.

Definition

pub struct DocumentListResponse {
    pub data: Vec<KnowledgeBaseDocument>,
    pub has_more: bool,
}

Fields

data
Vec<KnowledgeBaseDocument>
required
A vector containing the documents in the knowledge base. Each document is represented by a KnowledgeBaseDocument struct.
has_more
bool
required
Indicates whether there are more documents available beyond the current page. Used for pagination.

Usage Example

use wacht::api::knowledge_bases::fetch_documents;

let knowledge_base_id = "kb_123";

let response = fetch_documents(knowledge_base_id).await?;

println!("Found {} documents", response.data.len());
if response.has_more {
    println!("More documents available");
}

for doc in response.data {
    println!("Document: {}", doc.filename);
    println!("  Type: {}", doc.content_type);
    println!("  Size: {} bytes", doc.size);
    println!("  Uploaded: {}", doc.uploaded_at);
}

See Also