This page contains the API documentation for the Generative knowledge assist UI module, also called Knowledge Assist V2. This module is used by agents to query their company's knowledge bases and receive generative AI-powered answers.
Usage
Import the module in your HTML page using the following code:
 < script 
  
 src 
 = 
 "https://www.gstatic.com/agent-assist-ui-modules/v2/knowledge_assist.js" 
>< / 
 script 
> 
 
Embed the module using the following tag:
 < agent 
 - 
 assist 
 - 
 knowledge 
 - 
 assist 
 - 
 v2 
> 
 
Attributes
| Property name | Type | Comment | 
|---|---|---|
|   
session-id | string | Optional session ID for non-conversation-based usage. | 
|   
parent | string | Parent project location name to use for non-conversation-based usage. Example: "projects/foo/locations/global" | 
Usage
Attributes are string-based component properties which can be set in the following ways:
From your HTML template directly:
 < element 
 - 
 selector 
  
 property 
 - 
 name 
 = 
 "value" 
> 
 
From your JavaScript code:
  var 
  
 el 
  
 = 
  
 document 
 . 
 querySelector 
 ( 
 'element-selector' 
 ); 
 el 
 . 
 setAttribute 
 ( 
 'property-name' 
 , 
  
 'value' 
 ); 
 
 
Inputs
| Property name | Type | Comment | 
|---|---|---|
|   
config | KnowledgeAssistV2Config | Optional configurations for Knowledge Assist V2 module. | 
Usage
Inputs are typically JavaScript objects or other complex property types which must be assigned on the element instance directly:
  const 
  
 el 
  
 = 
  
 document 
 . 
 querySelector 
 ( 
 'element-selector' 
 ); 
 el 
 . 
 propertyName 
  
 = 
  
 value 
 ; 
 
 
Types
See the following section for the custom types used by the component.
KnowledgeAssistV2Config
  interface 
  
 KnowledgeAssistV2Config 
  
 { 
  
 articleLinkConfig 
 : 
  
 { 
  
 /** 
 * Whether to open the article in a new tab, or as a popup. Defaults to new 
 * tab. 
 */ 
  
 target 
 ?: 
  
 "blank" 
  
 | 
  
 "popup" 
 ; 
  
 /** 
 * Options to configure the popup's size and location. See 
 * https://developer.mozilla.org/en-US/docs/Web/API/Window/open#window_features. 
 */ 
  
 popupWindowOptions 
 ?: 
  
 string 
 ; 
  
 /** 
 * The field name on the document metadata if a separate article link source 
 * is provided. 
 */ 
  
 linkMetadataKey 
 ?: 
  
 string 
 ; 
  
 }; 
  
 showCopyAnswer 
 : 
  
 boolean 
 ; 
  
 showPasteAnswer 
 : 
  
 boolean 
 ; 
 } 
 
 

