Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Questa pagina contiene la documentazione dell'API per il modulo dell'interfaccia utente Generative knowledge assist, chiamato anche Knowledge Assist V2. Questo modulo viene utilizzato dagli agenti per eseguire query nelle knowledge base della loro azienda e ricevere risposte basate sull'AI generativa.
Utilizzo
Importa il modulo nella pagina HTML utilizzando il seguente codice:
Per i tipi personalizzati utilizzati dal componente, consulta la sezione seguente.
KnowledgeAssistV2Config
interfaceKnowledgeAssistV2Config{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;}
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-10 UTC."],[[["\u003cp\u003eThis page documents the API for the Generative Knowledge Assist UI module (Knowledge Assist V2), which helps agents query knowledge bases and receive AI-powered answers.\u003c/p\u003e\n"],["\u003cp\u003eThe module can be imported into an HTML page using a provided script tag and embedded using the \u003ccode\u003e<agent-assist-knowledge-assist-v2>\u003c/code\u003e tag.\u003c/p\u003e\n"],["\u003cp\u003eThe module accepts string-based attributes like \u003ccode\u003esession-id\u003c/code\u003e and \u003ccode\u003eparent\u003c/code\u003e, which can be set directly in the HTML template or via JavaScript.\u003c/p\u003e\n"],["\u003cp\u003eThe module also takes a \u003ccode\u003econfig\u003c/code\u003e input, of type \u003ccode\u003eKnowledgeAssistV2Config\u003c/code\u003e, which allows customization of the module, such as how articles are opened and whether copy/paste functions are available.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eKnowledgeAssistV2Config\u003c/code\u003e allows configuring article links, controlling whether to open in a new tab or popup, and enabling copy/paste answer features.\u003c/p\u003e\n"]]],[],null,["# Knowledge assist\n\nThis page contains the API documentation for the [Generative knowledge assist](/agent-assist/docs/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.\n\nUsage\n-----\n\nImport the module in your HTML page using the following code: \n\n \u003cscript src=\"https://www.gstatic.com/agent-assist-ui-modules/v2/knowledge_assist.js\"\u003e\u003c/script\u003e\n\nEmbed the module using the following tag: \n\n \u003cagent-assist-knowledge-assist-v2\u003e\n\nAttributes\n----------\n\n### Usage\n\nAttributes are string-based component properties which can be set in the following ways:\n\nFrom your HTML template directly: \n\n \u003celement-selector property-name=\"value\"\u003e\n\nFrom your JavaScript code: \n\n var el = document.querySelector('element-selector');\n el.setAttribute('property-name', 'value');\n\nInputs\n------\n\n### Usage\n\nInputs are typically JavaScript objects or other complex property types which must be assigned on the element instance directly: \n\n const el = document.querySelector('element-selector');\n el.propertyName = value;\n\nTypes\n-----\n\nSee the following section for the custom types used by the component.\n\n### KnowledgeAssistV2Config\n\n interface KnowledgeAssistV2Config {\n articleLinkConfig: {\n /**\n * Whether to open the article in a new tab, or as a popup. Defaults to new\n * tab.\n */\n target?: \"blank\" | \"popup\";\n /**\n * Options to configure the popup's size and location. See\n * https://developer.mozilla.org/en-US/docs/Web/API/Window/open#window_features.\n */\n popupWindowOptions?: string;\n /**\n * The field name on the document metadata if a separate article link source\n * is provided.\n */\n linkMetadataKey?: string;\n };\n showCopyAnswer: boolean;\n showPasteAnswer: boolean;\n }"]]