This page contains the API documentation for the [Conversation Summarization](https://docs.cloud.google.com/gemini-enterprise-cx/agent-assist/summarization-with-custom-sections.md.txt) UI module. This module is used to generate a summary of a conversation.

## Usage

Import the module in your HTML page using the following code:

```javascript
<script src="https://www.gstatic.com/agent-assist-ui-modules/v1/summarization.js"></script>
```

Embed the module using the following tag:

```javascript
<agent-assist-summarization>
```

## Attributes

| Property name | Type | Comment |
|---|---|---|
| show-generate-summary-button | [BooleanString](https://docs.cloud.google.com/gemini-enterprise-cx/agent-assist/ui-modules-summarization-documentation.md.txt#BooleanString) | Whether to show the **Generate Summary** button. |

### Usage

Attributes are string-based component properties which can be set in the following ways:

From your HTML template directly:

```javascript
<element-selector property-name="value">
```

From your JavaScript code:

```javascript
var el = document.querySelector('element-selector');
el.setAttribute('property-name', 'value');
```

## Inputs

| Property name | Type | Comment |
|---|---|---|
| onSaveSummary | [OnSaveSummary](https://docs.cloud.google.com/gemini-enterprise-cx/agent-assist/ui-modules-summarization-documentation.md.txt#OnSaveSummary) | Callback to invoke when summary is saved. Used by customers to send summary details to CRM. |

### Usage

Inputs are typically JavaScript objects or other complex property types which must be assigned on the element instance directly:

```javascript
const el = document.querySelector('element-selector');
el.propertyName = value;
```

## Types

See the following section for the custom types used by the component.

### BooleanString

```javascript
"true" | "false"
```

### OnSaveSummary

```javascript
type OnSaveSummary = (
  summary: {
    summary: string;
    conversationDetails: ConversationDetails;
  },
  saveCallbacks: {
    setLoading: () => void;
    setSuccess: (message: string) => void;
    setError: (message: string) => void;
  }
) => void;
```