Summarization with custom sections
Stay organized with collections
Save and categorize content based on your preferences.
Summarization with custom sections uses an LLM to summarize customer service conversations. The model takes in the conversations and custom sections, which are parts of text prompts defining the task the model performs, to then generate the summaries.
You can choose predefined sections and write your own summarization task definitions in custom sections.
Add sections under Custom sections: Define new summarization tasks as needed, optionally adding few-shot examples for enhancement.
Click Save.
REST
To create a summarization generator using the API, do the following:
Call the CreateGenerator method from the Generator resource.
Enter the generator's name in the description field.
Enter the generator's output language code in the output_language_code field.
Enter the trigger event MANUAL_CALL.
Select predefined sections and add custom sections with few-shot examples in SummarizationContext.
Before using any of the request data,
make the following replacements:
PROJECT_ID: your Cloud project ID
LOCATION_ID: your location ID
HTTP method and URL:
POST https://dialogflow.googleapis.com/v2/projects/PROJECT_ID/locations/LOCATION_ID/generators
Request JSON body:
{
"parent": "projects/PROJECT_ID/locations/LOCATION_ID",
"description": "test",
"triggerEvent": "MANUAL_CALL",
"summarizationContext": {
"summarizationSections": [{
"type": "SITUATION"
}, {
"type": "ENTITIES"
}, {
"key": "custom_section",
"definition": "Describe what the customer needs help with or has questions about. If there is an order number mentioned in the conversation, INCLUDE the order number.",
"type": "CUSTOMER_DEFINED"
}],
"version": "2.1",
"outputLanguageCode": "en-US"
}
}
To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell)
Save the request body in a file named request.json,
and execute the following command:
You should receive a JSON response similar to the following:
{
"name": "projects/PROJECT_ID/locations/LOCATION_ID/generators/GENERATOR_ID",
"description": "test",
"inferenceParameter": {
"maxOutputTokens": 1024,
"temperature": 0.0,
"topK": 40,
"topP": 0.8
},
"triggerEvent": "MANUAL_CALL",
"createTime": "2024-05-11T00:28:14.790937126Z",
"updateTime": "2024-05-11T01:59:15.751724150Z",
"summarizationContext": {
"summarizationSections": [{
"type": "SITUATION"
}, {
"type": "ENTITIES"
}, {
"key": "custom_section",
"definition": "Describe what the customer needs help with or has questions about. If there is an order number mentioned in the conversation, INCLUDE the order number.",
"type": "CUSTOMER_DEFINED"
}],
"version": "2.1",
"outputLanguageCode": "en-US"
}
}
Test a summarization generator
Within the console, you can test the generator in the Test generator section, as shown in the following image.
To test a generator in the console, do the following:
Console
A transcript of the conversation. You can either manually input utterances or upload a transcript in JSON format, as shown in the following image.
Click Generate to display the summary.
Configure a conversation profile
A conversation profile configures a set of parameters that control the
suggestions made to an agent during a conversation. The following steps create a
ConversationProfile
with a
HumanAgentAssistantConfig
object.
The following samples show how to create a conversation profile.
At runtime, when a dialog begins between a user and an agent, you create a conversation, which is an interaction between an agent (human or virtual) and a support customer or user. To see suggestions, create both a user-participant and an agent-participant, and add them to the conversation.
Create a conversation
To create a conversation,
call the create method on the
Conversation
resource.
REST
Before using any of the request data,
make the following replacements:
PROJECT_ID: your Cloud project ID
LOCATION_ID: your location ID
CONVERSATION_PROFILE_ID: the ID you received when creating the conversation profile
HTTP method and URL:
POST https://dialogflow.googleapis.com/v2/projects/PROJECT_ID/locations/LOCATION_ID/conversations
The path segment after participants contains your new agent-participant ID.
Analyze message
There are two ways to analyze messages:
During a conversation. To add and analyze an agent message for the conversation, call the
analyzeContent
method on the Participant resource. Provide the conversation ID and agent-participant ID. To add and analyze a user message for the conversation, call the
analyzeContent method on the Participant
resource. Provide the conversation ID and user-participant ID. Don't make duplicate calls to the analyzeContent method if it was called
for other Dialogflow features.
After a conversation. You can use this option if you don't use the
analyzeContent
method during the conversation. Instead, you can use the batchCreate
method on the messages resource to ingest historical messages of the conversation.
Generate a summary
You can get a suggestion at any time for the latest message from either
participant.
Call the suggestConversationSummary method on the
conversations.suggestions resource. Provide the conversation ID and the latest message ID from either participant.
Call the generateStatelessSuggestion method. Provide the ConversationContext, generator name, and trigger event, which should be MANUAL_CALL.
REST
Before using any of the request data,
make the following replacements:
PROJECT_ID: your Cloud project ID
LOCATION_ID: your location ID
GENERATOR_ID: your generator ID
HTTP method and URL:
POST https://dialogflow.googleapis.com/v2/projects/PROJECT_ID/locations/LOCATION_ID/statelessSuggestion:generate
Request JSON body:
{
"parent": "projects/PROJECT_ID/locations/LOCATION_ID",
"generatorName": "projects/PROJECT_ID/locations/LOCATION_ID/generators/GENERATOR_ID",
"conversationContext" {
"messageEntries": [{
"role": "HUMAN_AGENT",
"text": "Hi, this is ABC messaging, how can I help you today?",
"languageCode": "en-US"
}, {
"role": "END_USER",
"text": "I want to return my order, it is broken",
"languageCode": "en-US"
}]
},
"triggerEvents": [
"MANUAL_CALL"
]
}
To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell)
Save the request body in a file named request.json,
and execute the following command:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-07-17 UTC."],[],[]]