# Document Summaries ## List all document summaries `document_summaries.list(DocumentSummaryListParams**kwargs) -> SyncCursorPagination[DocumentSummary]` **get** `/document-summaries` Retrieve a paginated list of document summaries using cursor-based pagination ### Parameters - `after: Optional[str]` Cursor for forward pagination. Returns items after this cursor. - `before: Optional[str]` Cursor for backward pagination. Returns items before this cursor. - `document_id: Optional[str]` Filter summaries by document ID - `household_id: Optional[str]` Filter summaries by household ID - `limit: Optional[int]` Maximum number of items to return ### Returns - `class DocumentSummary: …` - `id: str` Unique identifier for the document summary - `created_at: datetime` Timestamp when the summary was created - `display_name: str` Display name for the summary - `document_id: str` ID of the document this summary belongs to - `household_id: str` ID of the household this summary belongs to - `summary: str` The summary text content - `updated_at: datetime` Timestamp when the summary was last updated - `entry_mode: Optional[DocumentSummaryEntryMode]` Indicates if the summary was AI-generated or user-entered - `"AI_AUTO"` - `"USER"` - `summary_format: Optional[DocumentSummaryFormat]` Format of the summary content - `"MARKDOWN"` - `"PLAIN_TEXT"` ### Example ```python from withluminary import Luminary client = Luminary() page = client.document_summaries.list() page = page.data[0] print(page.id) ``` #### Response ```json { "data": [ { "id": "document_summary_01ARZ3NDEKTSV4RRFFQ69G5FAV", "created_at": "2019-12-27T18:11:19.117Z", "display_name": "Default summary", "document_id": "document_01ARZ3NDEKTSV4RRFFQ69G5FAV", "household_id": "household_01ARZ3NDEKTSV4RRFFQ69G5FAV", "summary": "summary", "updated_at": "2019-12-27T18:11:19.117Z", "entry_mode": "AI_AUTO", "summary_format": "MARKDOWN" } ], "page_info": { "has_next_page": true, "has_previous_page": false, "end_cursor": "eyJpZCI6ImhvdXNlaG9sZF8wMUFSWjNOREVLVFNWNFJSRkZRNjlHNUZBViJ9", "start_cursor": "eyJpZCI6ImhvdXNlaG9sZF8wMUFSWjNOREVLVFNWNFJSRkZRNjlHNUZBViJ9" }, "total_count": 100 } ``` ## Get a document summary by ID `document_summaries.retrieve(strid) -> DocumentSummary` **get** `/document-summaries/{id}` Retrieve a specific document summary ### Parameters - `id: str` ### Returns - `class DocumentSummary: …` - `id: str` Unique identifier for the document summary - `created_at: datetime` Timestamp when the summary was created - `display_name: str` Display name for the summary - `document_id: str` ID of the document this summary belongs to - `household_id: str` ID of the household this summary belongs to - `summary: str` The summary text content - `updated_at: datetime` Timestamp when the summary was last updated - `entry_mode: Optional[DocumentSummaryEntryMode]` Indicates if the summary was AI-generated or user-entered - `"AI_AUTO"` - `"USER"` - `summary_format: Optional[DocumentSummaryFormat]` Format of the summary content - `"MARKDOWN"` - `"PLAIN_TEXT"` ### Example ```python from withluminary import Luminary client = Luminary() document_summary = client.document_summaries.retrieve( "id", ) print(document_summary.id) ``` #### Response ```json { "id": "document_summary_01ARZ3NDEKTSV4RRFFQ69G5FAV", "created_at": "2019-12-27T18:11:19.117Z", "display_name": "Default summary", "document_id": "document_01ARZ3NDEKTSV4RRFFQ69G5FAV", "household_id": "household_01ARZ3NDEKTSV4RRFFQ69G5FAV", "summary": "summary", "updated_at": "2019-12-27T18:11:19.117Z", "entry_mode": "AI_AUTO", "summary_format": "MARKDOWN" } ``` ## Update a document summary `document_summaries.update(strid, DocumentSummaryUpdateParams**kwargs) -> DocumentSummary` **put** `/document-summaries/{id}` Update an existing document summary ### Parameters - `id: str` - `display_name: Optional[str]` Display name for the summary - `entry_mode: Optional[DocumentSummaryEntryMode]` Indicates if the summary was AI-generated or user-entered - `"AI_AUTO"` - `"USER"` - `summary: Optional[str]` The summary text content - `summary_format: Optional[DocumentSummaryFormat]` Format of the summary content - `"MARKDOWN"` - `"PLAIN_TEXT"` ### Returns - `class DocumentSummary: …` - `id: str` Unique identifier for the document summary - `created_at: datetime` Timestamp when the summary was created - `display_name: str` Display name for the summary - `document_id: str` ID of the document this summary belongs to - `household_id: str` ID of the household this summary belongs to - `summary: str` The summary text content - `updated_at: datetime` Timestamp when the summary was last updated - `entry_mode: Optional[DocumentSummaryEntryMode]` Indicates if the summary was AI-generated or user-entered - `"AI_AUTO"` - `"USER"` - `summary_format: Optional[DocumentSummaryFormat]` Format of the summary content - `"MARKDOWN"` - `"PLAIN_TEXT"` ### Example ```python from withluminary import Luminary client = Luminary() document_summary = client.document_summaries.update( id="id", ) print(document_summary.id) ``` #### Response ```json { "id": "document_summary_01ARZ3NDEKTSV4RRFFQ69G5FAV", "created_at": "2019-12-27T18:11:19.117Z", "display_name": "Default summary", "document_id": "document_01ARZ3NDEKTSV4RRFFQ69G5FAV", "household_id": "household_01ARZ3NDEKTSV4RRFFQ69G5FAV", "summary": "summary", "updated_at": "2019-12-27T18:11:19.117Z", "entry_mode": "AI_AUTO", "summary_format": "MARKDOWN" } ``` ## Download document summary as PDF `document_summaries.download(strid, DocumentSummaryDownloadParams**kwargs) -> BinaryResponseContent` **get** `/document-summaries/{id}/download` Download the document summary content in the specified format ### Parameters - `id: str` - `format: Optional[Literal["pdf"]]` Output format for the download - `"pdf"` ### Returns - `BinaryResponseContent` ### Example ```python from withluminary import Luminary client = Luminary() response = client.document_summaries.download( id="id", ) print(response) content = response.read() print(content) ``` ## Domain Types ### Document Summary - `class DocumentSummary: …` - `id: str` Unique identifier for the document summary - `created_at: datetime` Timestamp when the summary was created - `display_name: str` Display name for the summary - `document_id: str` ID of the document this summary belongs to - `household_id: str` ID of the household this summary belongs to - `summary: str` The summary text content - `updated_at: datetime` Timestamp when the summary was last updated - `entry_mode: Optional[DocumentSummaryEntryMode]` Indicates if the summary was AI-generated or user-entered - `"AI_AUTO"` - `"USER"` - `summary_format: Optional[DocumentSummaryFormat]` Format of the summary content - `"MARKDOWN"` - `"PLAIN_TEXT"` ### Document Summary Entry Mode - `Literal["AI_AUTO", "USER"]` Indicates if the summary was AI-generated or user-entered - `"AI_AUTO"` - `"USER"` ### Document Summary Format - `Literal["MARKDOWN", "PLAIN_TEXT"]` Format of the summary content - `"MARKDOWN"` - `"PLAIN_TEXT"` ### Page Info - `class PageInfo: …` - `has_next_page: bool` When paginating forwards, are there more items? - `has_previous_page: bool` When paginating backwards, are there more items? - `end_cursor: Optional[str]` Cursor pointing to the last item in the current page - `start_cursor: Optional[str]` Cursor pointing to the first item in the current page