You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Set services depend on each script. For example, those are LockService and PropertiesService.
103
+
* For example, if you don't set these properties, you cannot use this as a library.
104
+
* If you want to use A2AApp as a library, please set the services.
105
+
*
106
+
* In the current stage, only LockService is used and PropertiesService is not used in A2AApp. PropertiesService is for the future update.
107
+
*
108
+
* @param {Object} services Array including the services you want to use.
109
+
* @params {LockService.Lock} services.lock One of LockService.getDocumentLock(), LockService.getScriptLock(), or LockService.getUserLock(). Default is LockService.getScriptLock().
110
+
* @params {PropertiesService.Properties} services.properties One of PropertiesService.getDocumentProperties(), PropertiesService.getScriptProperties(), or PropertiesService.getUserProperties(). Default is PropertiesService.getScriptProperties().
* @param {Object} object Object using this script.
14
+
* @param {Boolean} object.log Default is false. When this is true, the log between A2A is stored to Google Sheets.
15
+
* @param {String} object.spreadsheetId Spreadsheet ID. Log is storead to "Log" sheet of this spreadsheet.
16
+
* @returns {A2AApp}
17
+
*/
18
+
functiona2aApp(object){
19
+
this.a2aApp=newA2AApp(object);
20
+
returnthis.a2aApp;
21
+
}
22
+
23
+
/**
24
+
* ### Description
25
+
* Set services depend on each script. For example, those are LockService and PropertiesService.
26
+
* For example, if you don't set these properties, you cannot use this as a library.
27
+
* If you want to use A2AApp as a library, please set the services.
28
+
*
29
+
* In the current stage, only LockService is used and PropertiesService is not used in A2AApp. PropertiesService is for the future update.
30
+
*
31
+
* @param {Object} services Array including the services you want to use.
32
+
* @params {LockService.Lock} services.lock One of LockService.getDocumentLock(), LockService.getScriptLock(), or LockService.getUserLock(). Default is LockService.getScriptLock().
33
+
* @params {PropertiesService.Properties} services.properties One of PropertiesService.getDocumentProperties(), PropertiesService.getScriptProperties(), or PropertiesService.getUserProperties(). Default is PropertiesService.getScriptProperties().
34
+
* @return {A2AApp}
35
+
*/
36
+
functionsetServices(services){
37
+
const{ lock, properties }=services;
38
+
if(lock){
39
+
/** @private */
40
+
this.a2aApp.lock=lock;
41
+
}
42
+
if(properties){
43
+
/** @private */
44
+
this.a2aApp.properties=properties;
45
+
}
46
+
returnthis.a2aApp;
47
+
}
48
+
49
+
/**
50
+
* ### Description
51
+
* Method for the A2A server.
52
+
*
53
+
* @param {Object} object Object using this script.
54
+
* @param {Object} object.eventObject Event object from doPost and doGet functions.
55
+
* @param {Object} object.apiKey API key for using Gemini API.
56
+
* @param {Object} object.agentCard Object for registering your agent card.
57
+
* @param {Object} object.functions Functions.
58
+
* @return {ContentService.TextOutput}
59
+
*/
60
+
functionserver(object){
61
+
returnthis.a2aApp.server(object);
62
+
}
63
+
64
+
/**
65
+
* ### Description
66
+
* Return HtmlService.HtmlOutput for UI of A2A client.
67
+
*
68
+
* @return {HtmlService.HtmlOutput}
69
+
*/
70
+
functiongetClientIndex(){
71
+
returnHtmlService.createHtmlOutputFromFile("index_client").setTitle("A2A client from A2AApp");
0 commit comments