# Document Summaries ## List all document summaries `client.DocumentSummaries.List(ctx, query) (*CursorPagination[DocumentSummary], error)` **get** `/document-summaries` Retrieve a paginated list of document summaries using cursor-based pagination ### Parameters - `query DocumentSummaryListParams` - `After param.Field[string]` Cursor for forward pagination. Returns items after this cursor. - `Before param.Field[string]` Cursor for backward pagination. Returns items before this cursor. - `DocumentID param.Field[string]` Filter summaries by document ID - `HouseholdID param.Field[string]` Filter summaries by household ID - `Limit param.Field[int64]` Maximum number of items to return ### Returns - `type DocumentSummary struct{…}` - `ID string` Unique identifier for the document summary - `CreatedAt Time` Timestamp when the summary was created - `DisplayName string` Display name for the summary - `DocumentID string` ID of the document this summary belongs to - `HouseholdID string` ID of the household this summary belongs to - `Summary string` The summary text content - `UpdatedAt Time` Timestamp when the summary was last updated - `EntryMode DocumentSummaryEntryMode` Indicates if the summary was AI-generated or user-entered - `const DocumentSummaryEntryModeAIAuto DocumentSummaryEntryMode = "AI_AUTO"` - `const DocumentSummaryEntryModeUser DocumentSummaryEntryMode = "USER"` - `SummaryFormat DocumentSummaryFormat` Format of the summary content - `const DocumentSummaryFormatMarkdown DocumentSummaryFormat = "MARKDOWN"` - `const DocumentSummaryFormatPlainText DocumentSummaryFormat = "PLAIN_TEXT"` ### Example ```go package main import ( "context" "fmt" "github.com/withluminary/go-sdk" "github.com/withluminary/go-sdk/option" ) func main() { client := withluminary.NewClient( option.WithClientID("My Client ID"), option.WithClientSecret("My Client Secret"), ) page, err := client.DocumentSummaries.List(context.TODO(), withluminary.DocumentSummaryListParams{ }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### 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 `client.DocumentSummaries.Get(ctx, id) (*DocumentSummary, error)` **get** `/document-summaries/{id}` Retrieve a specific document summary ### Parameters - `id string` ### Returns - `type DocumentSummary struct{…}` - `ID string` Unique identifier for the document summary - `CreatedAt Time` Timestamp when the summary was created - `DisplayName string` Display name for the summary - `DocumentID string` ID of the document this summary belongs to - `HouseholdID string` ID of the household this summary belongs to - `Summary string` The summary text content - `UpdatedAt Time` Timestamp when the summary was last updated - `EntryMode DocumentSummaryEntryMode` Indicates if the summary was AI-generated or user-entered - `const DocumentSummaryEntryModeAIAuto DocumentSummaryEntryMode = "AI_AUTO"` - `const DocumentSummaryEntryModeUser DocumentSummaryEntryMode = "USER"` - `SummaryFormat DocumentSummaryFormat` Format of the summary content - `const DocumentSummaryFormatMarkdown DocumentSummaryFormat = "MARKDOWN"` - `const DocumentSummaryFormatPlainText DocumentSummaryFormat = "PLAIN_TEXT"` ### Example ```go package main import ( "context" "fmt" "github.com/withluminary/go-sdk" "github.com/withluminary/go-sdk/option" ) func main() { client := withluminary.NewClient( option.WithClientID("My Client ID"), option.WithClientSecret("My Client Secret"), ) documentSummary, err := client.DocumentSummaries.Get(context.TODO(), "id") if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", documentSummary.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 `client.DocumentSummaries.Update(ctx, id, body) (*DocumentSummary, error)` **put** `/document-summaries/{id}` Update an existing document summary ### Parameters - `id string` - `body DocumentSummaryUpdateParams` - `DisplayName param.Field[string]` Display name for the summary - `EntryMode param.Field[DocumentSummaryEntryMode]` Indicates if the summary was AI-generated or user-entered - `Summary param.Field[string]` The summary text content - `SummaryFormat param.Field[DocumentSummaryFormat]` Format of the summary content ### Returns - `type DocumentSummary struct{…}` - `ID string` Unique identifier for the document summary - `CreatedAt Time` Timestamp when the summary was created - `DisplayName string` Display name for the summary - `DocumentID string` ID of the document this summary belongs to - `HouseholdID string` ID of the household this summary belongs to - `Summary string` The summary text content - `UpdatedAt Time` Timestamp when the summary was last updated - `EntryMode DocumentSummaryEntryMode` Indicates if the summary was AI-generated or user-entered - `const DocumentSummaryEntryModeAIAuto DocumentSummaryEntryMode = "AI_AUTO"` - `const DocumentSummaryEntryModeUser DocumentSummaryEntryMode = "USER"` - `SummaryFormat DocumentSummaryFormat` Format of the summary content - `const DocumentSummaryFormatMarkdown DocumentSummaryFormat = "MARKDOWN"` - `const DocumentSummaryFormatPlainText DocumentSummaryFormat = "PLAIN_TEXT"` ### Example ```go package main import ( "context" "fmt" "github.com/withluminary/go-sdk" "github.com/withluminary/go-sdk/option" ) func main() { client := withluminary.NewClient( option.WithClientID("My Client ID"), option.WithClientSecret("My Client Secret"), ) documentSummary, err := client.DocumentSummaries.Update( context.TODO(), "id", withluminary.DocumentSummaryUpdateParams{ }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", documentSummary.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 `client.DocumentSummaries.Download(ctx, id, query) (*Response, error)` **get** `/document-summaries/{id}/download` Download the document summary content in the specified format ### Parameters - `id string` - `query DocumentSummaryDownloadParams` - `Format param.Field[DocumentSummaryDownloadParamsFormat]` Output format for the download - `const DocumentSummaryDownloadParamsFormatPdf DocumentSummaryDownloadParamsFormat = "pdf"` ### Returns - `type DocumentSummaryDownloadResponse interface{…}` ### Example ```go package main import ( "context" "fmt" "github.com/withluminary/go-sdk" "github.com/withluminary/go-sdk/option" ) func main() { client := withluminary.NewClient( option.WithClientID("My Client ID"), option.WithClientSecret("My Client Secret"), ) response, err := client.DocumentSummaries.Download( context.TODO(), "id", withluminary.DocumentSummaryDownloadParams{ }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response) } ``` ## Domain Types ### Document Summary - `type DocumentSummary struct{…}` - `ID string` Unique identifier for the document summary - `CreatedAt Time` Timestamp when the summary was created - `DisplayName string` Display name for the summary - `DocumentID string` ID of the document this summary belongs to - `HouseholdID string` ID of the household this summary belongs to - `Summary string` The summary text content - `UpdatedAt Time` Timestamp when the summary was last updated - `EntryMode DocumentSummaryEntryMode` Indicates if the summary was AI-generated or user-entered - `const DocumentSummaryEntryModeAIAuto DocumentSummaryEntryMode = "AI_AUTO"` - `const DocumentSummaryEntryModeUser DocumentSummaryEntryMode = "USER"` - `SummaryFormat DocumentSummaryFormat` Format of the summary content - `const DocumentSummaryFormatMarkdown DocumentSummaryFormat = "MARKDOWN"` - `const DocumentSummaryFormatPlainText DocumentSummaryFormat = "PLAIN_TEXT"` ### Document Summary Entry Mode - `type DocumentSummaryEntryMode string` Indicates if the summary was AI-generated or user-entered - `const DocumentSummaryEntryModeAIAuto DocumentSummaryEntryMode = "AI_AUTO"` - `const DocumentSummaryEntryModeUser DocumentSummaryEntryMode = "USER"` ### Document Summary Format - `type DocumentSummaryFormat string` Format of the summary content - `const DocumentSummaryFormatMarkdown DocumentSummaryFormat = "MARKDOWN"` - `const DocumentSummaryFormatPlainText DocumentSummaryFormat = "PLAIN_TEXT"` ### Page Info - `type PageInfo struct{…}` - `HasNextPage bool` When paginating forwards, are there more items? - `HasPreviousPage bool` When paginating backwards, are there more items? - `EndCursor string` Cursor pointing to the last item in the current page - `StartCursor string` Cursor pointing to the first item in the current page