Files
2026-09-13 21:55:56 +00:00

426 lines
41 KiB
HTML

<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Google Analytics tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-DKHZS27PHP"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag("js", new Date());
gtag("config", "G-DKHZS27PHP");
</script>
<!-- Generated by javadoc (26) -->
<title>Functions (Google Agent Development Kit Maven Parent POM 1.7.0 API)</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="description" content="declaration: package: com.google.adk.flows.llmflows, class: Functions">
<meta name="generator" content="javadoc/ClassWriter">
<link rel="stylesheet" type="text/css" href="../../../../../resource-files/jquery-ui.min.css">
<link rel="stylesheet" type="text/css" href="../../../../../resource-files/stylesheet.css">
<script type="text/javascript" src="../../../../../script-files/script.js"></script>
<script type="text/javascript" src="../../../../../script-files/jquery-3.7.1.min.js"></script>
<script type="text/javascript" src="../../../../../script-files/jquery-ui.min.js"></script>
</head>
<body class="class-declaration-page">
<script type="text/javascript">const pathtoroot = "../../../../../";
loadScripts();
initTheme();
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<header role="banner">
<nav role="navigation">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="top-nav" id="navbar-top">
<div class="nav-content">
<div class="nav-menu-button"><button id="navbar-toggle-button" aria-controls="navbar-top" aria-expanded="false" aria-label="Toggle navigation links"><span class="nav-bar-toggle-icon">&nbsp;</span><span class="nav-bar-toggle-icon">&nbsp;</span><span class="nav-bar-toggle-icon">&nbsp;</span></button></div>
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
<li><a href="../../../../../index.html">Overview</a></li>
<li class="nav-bar-cell1-rev">Class</li>
<li><a href="class-use/Functions.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../search.html">Search</a></li>
<li><button id="theme-button" aria-label="Select Theme" title="Select Theme"></button></li>
</ul>
<div id="theme-panel">
<div>Select Theme</div>
<div><label for="theme-light"><input type="radio" id="theme-light" disabled name="theme" value="theme-light"><span>Light</span></label><label for="theme-dark"><input type="radio" id="theme-dark" disabled name="theme" value="theme-dark"><span>Dark</span></label><label for="theme-os"><input type="radio" id="theme-os" disabled name="theme" value="theme-os"><span>System Setting</span></label></div>
</div>
</div>
</div>
<div class="sub-nav">
<div class="nav-content">
<ol class="sub-nav-list">
<li><a href="package-summary.html">com.google.adk.flows.llmflows</a></li>
<li><a href="Functions.html" class="current-selection">Functions</a></li>
</ol>
<div class="nav-list-search"><input type="text" id="search-input" disabled placeholder="Search documentation (type /)" aria-label="Search in documentation" autocomplete="off" spellcheck="false"><input type="reset" id="reset-search" disabled value="Reset"></div>
</div>
</div>
<!-- ========= END OF TOP NAVBAR ========= -->
<span class="skip-nav" id="skip-navbar-top"></span></nav>
</header>
<div class="main-grid">
<nav role="navigation" class="toc" aria-label="Table of contents">
<div class="toc-header">Contents&nbsp;<input type="text" class="filter-input" disabled placeholder="Filter contents (type .)" aria-label="Filter table of contents" autocomplete="off" spellcheck="false"><input type="reset" class="reset-filter" disabled tabindex="-1" value="Reset">&nbsp;<button class="toc-sort-toggle" id="toc-lexical-order-toggle"><img src="../../../../../resource-files/sort-a-z.svg" alt="Sort member details in lexicographical order"></button></div>
<ol class="toc-list" tabindex="-1">
<li><a href="#" tabindex="0">Description</a></li>
<li><a href="#field-summary" tabindex="0">Field Summary</a></li>
<li><a href="#method-summary" tabindex="0">Method Summary</a></li>
<li><a href="#field-detail" tabindex="0">Field Details</a>
<ol class="toc-list">
<li><a href="#REQUEST_CONFIRMATION_FUNCTION_CALL_NAME" tabindex="0">REQUEST_CONFIRMATION_FUNCTION_CALL_NAME</a></li>
<li><a href="#TOOL_CALL_SECURITY_STATES" tabindex="0">TOOL_CALL_SECURITY_STATES</a></li>
</ol>
</li>
<li><a href="#method-detail" tabindex="0">Method Details</a>
<ol class="toc-list">
<li><a href="#generateClientFunctionCallId()" tabindex="0">generateClientFunctionCallId()</a></li>
<li><a href="#populateClientFunctionCallId(com.google.adk.events.Event)" tabindex="0">populateClientFunctionCallId(Event)</a></li>
<li><a href="#handleFunctionCalls(com.google.adk.agents.InvocationContext,com.google.adk.events.Event,java.util.Map)" tabindex="0">handleFunctionCalls(InvocationContext, Event, Map)</a></li>
<li><a href="#handleFunctionCalls(com.google.adk.agents.InvocationContext,com.google.adk.events.Event,java.util.Map,java.util.Map)" tabindex="0">handleFunctionCalls(InvocationContext, Event, Map, Map)</a></li>
<li><a href="#handleFunctionCallsLive(com.google.adk.agents.InvocationContext,com.google.adk.events.Event,java.util.Map)" tabindex="0">handleFunctionCallsLive(InvocationContext, Event, Map)</a></li>
<li><a href="#handleFunctionCallsLive(com.google.adk.agents.InvocationContext,com.google.adk.events.Event,java.util.Map,java.util.Map)" tabindex="0">handleFunctionCallsLive(InvocationContext, Event, Map, Map)</a></li>
<li><a href="#getLongRunningFunctionCalls(java.util.List,java.util.Map)" tabindex="0">getLongRunningFunctionCalls(List, Map)</a></li>
<li><a href="#findMatchingFunctionCallEvent(java.util.List)" tabindex="0">findMatchingFunctionCallEvent(List)</a></li>
<li><a href="#hasPendingLongRunningCall(com.google.adk.events.Event)" tabindex="0">hasPendingLongRunningCall(Event)</a></li>
<li><a href="#generateRequestConfirmationEvent(com.google.adk.agents.InvocationContext,com.google.adk.events.Event,com.google.adk.events.Event)" tabindex="0">generateRequestConfirmationEvent(InvocationContext, Event, Event)</a></li>
<li><a href="#getAskUserConfirmationFunctionCalls(com.google.adk.events.Event)" tabindex="0">getAskUserConfirmationFunctionCalls(Event)</a></li>
</ol>
</li>
</ol>
<button class="hide-sidebar"><span>Hide sidebar&nbsp;</span><img src="../../../../../resource-files/left.svg" alt="Hide sidebar"></button><button class="show-sidebar"><img src="../../../../../resource-files/right.svg" alt="Show sidebar"><span>&nbsp;Show sidebar</span></button></nav>
<main role="main">
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<h1 title="Class Functions" class="title">Class Functions</h1>
</div>
<div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html" title="class in java.lang" class="external-link">java.lang.Object</a>
<div class="inheritance">com.google.adk.flows.llmflows.Functions</div>
</div>
<section class="class-description" id="class-description">
<hr>
<div class="horizontal-scroll">
<div class="type-signature"><span class="modifiers">public final class </span><span class="element-name type-name-label">Functions</span>
<span class="extends-implements">extends <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html" title="class in java.lang" class="external-link">Object</a></span></div>
<div class="block">Utility class for handling function calls.</div>
</div>
</section>
<section class="summary">
<ul class="summary-list">
<!-- =========== FIELD SUMMARY =========== -->
<li>
<section class="field-summary" id="field-summary">
<h2>Field Summary</h2>
<div class="caption"><span>Fields</span></div>
<div class="summary-table three-column-summary">
<div class="table-header col-first">Modifier and Type</div>
<div class="table-header col-second">Field</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color"><code>static final <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class in java.lang" class="external-link">String</a></code></div>
<div class="col-second even-row-color"><code><a href="#REQUEST_CONFIRMATION_FUNCTION_CALL_NAME" class="member-name-link">REQUEST_CONFIRMATION_FUNCTION_CALL_NAME</a></code></div>
<div class="col-last even-row-color">
<div class="block">The function call name for the request confirmation function.</div>
</div>
<div class="col-first odd-row-color"><code>static final <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class in java.lang" class="external-link">String</a></code></div>
<div class="col-second odd-row-color"><code><a href="#TOOL_CALL_SECURITY_STATES" class="member-name-link">TOOL_CALL_SECURITY_STATES</a></code></div>
<div class="col-last odd-row-color">
<div class="block">Session state key for storing the security policy outcomes for tool calls.</div>
</div>
</div>
</section>
</li>
<!-- ========== METHOD SUMMARY =========== -->
<li>
<section class="method-summary" id="method-summary">
<h2>Method Summary</h2>
<div id="method-summary-table">
<div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab1" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab1', 3)" class="table-tab">Static Methods</button><button id="method-summary-table-tab4" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="table-tab">Concrete Methods</button></div>
<div id="method-summary-table.tabpanel" role="tabpanel" aria-labelledby="method-summary-table-tab0">
<div class="summary-table three-column-summary">
<div class="table-header col-first">Modifier and Type</div>
<div class="table-header col-second">Method</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Optional.html" title="class in java.util" class="external-link">Optional</a><wbr>&lt;<a href="../../events/Event.html" title="class in com.google.adk.events">Event</a>&gt;</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#findMatchingFunctionCallEvent(java.util.List)" class="member-name-link">findMatchingFunctionCallEvent</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="interface in java.util" class="external-link">List</a>&lt;<a href="../../events/Event.html" title="class in com.google.adk.events">Event</a>&gt;&nbsp;events)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns the most recent function-call event whose call id matches a function response in the
last event, or empty.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class in java.lang" class="external-link">String</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#generateClientFunctionCallId()" class="member-name-link">generateClientFunctionCallId</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Generates a unique ID for a function call.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Optional.html" title="class in java.util" class="external-link">Optional</a><wbr>&lt;<a href="../../events/Event.html" title="class in com.google.adk.events">Event</a>&gt;</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#generateRequestConfirmationEvent(com.google.adk.agents.InvocationContext,com.google.adk.events.Event,com.google.adk.events.Event)" class="member-name-link">generateRequestConfirmationEvent</a><wbr>(<a href="../../agents/InvocationContext.html" title="class in com.google.adk.agents">InvocationContext</a>&nbsp;invocationContext,
<a href="../../events/Event.html" title="class in com.google.adk.events">Event</a>&nbsp;functionCallEvent,
<a href="../../events/Event.html" title="class in com.google.adk.events">Event</a>&nbsp;functionResponseEvent)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Generates a request confirmation event from a function response event.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static com.google.common.collect.ImmutableList<wbr>&lt;com.google.genai.types.FunctionCall&gt;</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#getAskUserConfirmationFunctionCalls(com.google.adk.events.Event)" class="member-name-link">getAskUserConfirmationFunctionCalls</a><wbr>(<a href="../../events/Event.html" title="class in com.google.adk.events">Event</a>&nbsp;event)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Gets the ask user confirmation function calls from the event.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Set.html" title="interface in java.util" class="external-link">Set</a><wbr>&lt;<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class in java.lang" class="external-link">String</a>&gt;</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#getLongRunningFunctionCalls(java.util.List,java.util.Map)" class="member-name-link">getLongRunningFunctionCalls</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="interface in java.util" class="external-link">List</a>&lt;com.google.genai.types.FunctionCall&gt;&nbsp;functionCalls,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Map.html" title="interface in java.util" class="external-link">Map</a>&lt;<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class in java.lang" class="external-link">String</a>,<wbr><a href="../../tools/BaseTool.html" title="class in com.google.adk.tools">BaseTool</a>&gt;&nbsp;tools)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">&nbsp;</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static io.reactivex.rxjava3.core.Maybe<wbr>&lt;<a href="../../events/Event.html" title="class in com.google.adk.events">Event</a>&gt;</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#handleFunctionCalls(com.google.adk.agents.InvocationContext,com.google.adk.events.Event,java.util.Map)" class="member-name-link">handleFunctionCalls</a><wbr>(<a href="../../agents/InvocationContext.html" title="class in com.google.adk.agents">InvocationContext</a>&nbsp;invocationContext,
<a href="../../events/Event.html" title="class in com.google.adk.events">Event</a>&nbsp;functionCallEvent,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Map.html" title="interface in java.util" class="external-link">Map</a>&lt;<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class in java.lang" class="external-link">String</a>,<wbr><a href="../../tools/BaseTool.html" title="class in com.google.adk.tools">BaseTool</a>&gt;&nbsp;tools)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Handles standard, non-streaming function calls.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static io.reactivex.rxjava3.core.Maybe<wbr>&lt;<a href="../../events/Event.html" title="class in com.google.adk.events">Event</a>&gt;</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#handleFunctionCalls(com.google.adk.agents.InvocationContext,com.google.adk.events.Event,java.util.Map,java.util.Map)" class="member-name-link">handleFunctionCalls</a><wbr>(<a href="../../agents/InvocationContext.html" title="class in com.google.adk.agents">InvocationContext</a>&nbsp;invocationContext,
<a href="../../events/Event.html" title="class in com.google.adk.events">Event</a>&nbsp;functionCallEvent,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Map.html" title="interface in java.util" class="external-link">Map</a>&lt;<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class in java.lang" class="external-link">String</a>,<wbr><a href="../../tools/BaseTool.html" title="class in com.google.adk.tools">BaseTool</a>&gt;&nbsp;tools,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Map.html" title="interface in java.util" class="external-link">Map</a>&lt;<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class in java.lang" class="external-link">String</a>, <a href="../../events/ToolConfirmation.html" title="class in com.google.adk.events">ToolConfirmation</a>&gt;&nbsp;toolConfirmations)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Handles standard, non-streaming function calls with tool confirmations.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static io.reactivex.rxjava3.core.Maybe<wbr>&lt;<a href="../../events/Event.html" title="class in com.google.adk.events">Event</a>&gt;</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#handleFunctionCallsLive(com.google.adk.agents.InvocationContext,com.google.adk.events.Event,java.util.Map)" class="member-name-link">handleFunctionCallsLive</a><wbr>(<a href="../../agents/InvocationContext.html" title="class in com.google.adk.agents">InvocationContext</a>&nbsp;invocationContext,
<a href="../../events/Event.html" title="class in com.google.adk.events">Event</a>&nbsp;functionCallEvent,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Map.html" title="interface in java.util" class="external-link">Map</a>&lt;<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class in java.lang" class="external-link">String</a>,<wbr><a href="../../tools/BaseTool.html" title="class in com.google.adk.tools">BaseTool</a>&gt;&nbsp;tools)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Handles function calls in a live/streaming context, supporting background execution and stream
termination.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static io.reactivex.rxjava3.core.Maybe<wbr>&lt;<a href="../../events/Event.html" title="class in com.google.adk.events">Event</a>&gt;</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#handleFunctionCallsLive(com.google.adk.agents.InvocationContext,com.google.adk.events.Event,java.util.Map,java.util.Map)" class="member-name-link">handleFunctionCallsLive</a><wbr>(<a href="../../agents/InvocationContext.html" title="class in com.google.adk.agents">InvocationContext</a>&nbsp;invocationContext,
<a href="../../events/Event.html" title="class in com.google.adk.events">Event</a>&nbsp;functionCallEvent,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Map.html" title="interface in java.util" class="external-link">Map</a>&lt;<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class in java.lang" class="external-link">String</a>,<wbr><a href="../../tools/BaseTool.html" title="class in com.google.adk.tools">BaseTool</a>&gt;&nbsp;tools,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Map.html" title="interface in java.util" class="external-link">Map</a>&lt;<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class in java.lang" class="external-link">String</a>, <a href="../../events/ToolConfirmation.html" title="class in com.google.adk.events">ToolConfirmation</a>&gt;&nbsp;toolConfirmations)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Handles function calls in a live/streaming context with tool confirmations, supporting
background execution and stream termination.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static boolean</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#hasPendingLongRunningCall(com.google.adk.events.Event)" class="member-name-link">hasPendingLongRunningCall</a><wbr>(<a href="../../events/Event.html" title="class in com.google.adk.events">Event</a>&nbsp;event)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns whether the event emits a long-running function call still awaiting a response (e.g.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#populateClientFunctionCallId(com.google.adk.events.Event)" class="member-name-link">populateClientFunctionCallId</a><wbr>(<a href="../../events/Event.html" title="class in com.google.adk.events">Event</a>&nbsp;modelResponseEvent)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Populates missing function call IDs in the provided event's content.</div>
</div>
</div>
</div>
</div>
<div class="inherited-list">
<h3 id="methods-inherited-from-class-java.lang.Object">Methods inherited from class&nbsp;<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#method-summary" title="class in java.lang" class="external-link">Object</a></h3>
<code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#clone()" title="clone()" class="external-link">clone</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#equals(java.lang.Object)" title="equals(Object)" class="external-link">equals</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#finalize()" title="finalize()" class="external-link">finalize</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#getClass()" title="getClass()" class="external-link">getClass</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#hashCode()" title="hashCode()" class="external-link">hashCode</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#notify()" title="notify()" class="external-link">notify</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#notifyAll()" title="notifyAll()" class="external-link">notifyAll</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#toString()" title="toString()" class="external-link">toString</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#wait()" title="wait()" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#wait(long)" title="wait(long)" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#wait(long,int)" title="wait(long, int)" class="external-link">wait</a></code></div>
</section>
</li>
</ul>
</section>
<section class="details">
<ul class="details-list">
<!-- ============ FIELD DETAIL =========== -->
<li>
<section class="field-details" id="field-detail">
<h2>Field Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="REQUEST_CONFIRMATION_FUNCTION_CALL_NAME">
<h3>REQUEST_CONFIRMATION_FUNCTION_CALL_NAME</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static final</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class in java.lang" class="external-link">String</a></span>&nbsp;<span class="element-name">REQUEST_CONFIRMATION_FUNCTION_CALL_NAME</span></div>
<div class="block">The function call name for the request confirmation function.</div>
<dl class="notes">
<dt>See Also:</dt>
<dd>
<ul class="tag-list">
<li><a href="../../../../../constant-values.html#com.google.adk.flows.llmflows.Functions.REQUEST_CONFIRMATION_FUNCTION_CALL_NAME">Constant Field Values</a></li>
</ul>
</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="TOOL_CALL_SECURITY_STATES">
<h3>TOOL_CALL_SECURITY_STATES</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static final</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class in java.lang" class="external-link">String</a></span>&nbsp;<span class="element-name">TOOL_CALL_SECURITY_STATES</span></div>
<div class="block">Session state key for storing the security policy outcomes for tool calls.</div>
<dl class="notes">
<dt>See Also:</dt>
<dd>
<ul class="tag-list">
<li><a href="../../../../../constant-values.html#com.google.adk.flows.llmflows.Functions.TOOL_CALL_SECURITY_STATES">Constant Field Values</a></li>
</ul>
</dd>
</dl>
</div>
</section>
</li>
</ul>
</section>
</li>
<!-- ============ METHOD DETAIL ========== -->
<li>
<section class="method-details" id="method-detail">
<h2>Method Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="generateClientFunctionCallId()">
<h3>generateClientFunctionCallId</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class in java.lang" class="external-link">String</a></span>&nbsp;<span class="element-name">generateClientFunctionCallId</span>()</div>
<div class="block">Generates a unique ID for a function call.</div>
</div>
</section>
</li>
<li>
<section class="detail" id="populateClientFunctionCallId(com.google.adk.events.Event)">
<h3>populateClientFunctionCallId</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">populateClientFunctionCallId</span><wbr><span class="parameters">(<a href="../../events/Event.html" title="class in com.google.adk.events">Event</a>&nbsp;modelResponseEvent)</span></div>
<div class="block">Populates missing function call IDs in the provided event's content.
<p>If the event contains function calls without an ID, this method generates a unique
client-side ID for each and updates the event content.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>modelResponseEvent</code> - The event potentially containing function calls.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="handleFunctionCalls(com.google.adk.agents.InvocationContext,com.google.adk.events.Event,java.util.Map)">
<h3>handleFunctionCalls</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">io.reactivex.rxjava3.core.Maybe&lt;<a href="../../events/Event.html" title="class in com.google.adk.events">Event</a>&gt;</span>&nbsp;<span class="element-name">handleFunctionCalls</span><wbr><span class="parameters">(<a href="../../agents/InvocationContext.html" title="class in com.google.adk.agents">InvocationContext</a>&nbsp;invocationContext,
<a href="../../events/Event.html" title="class in com.google.adk.events">Event</a>&nbsp;functionCallEvent,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Map.html" title="interface in java.util" class="external-link">Map</a>&lt;<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class in java.lang" class="external-link">String</a>,<wbr><a href="../../tools/BaseTool.html" title="class in com.google.adk.tools">BaseTool</a>&gt;&nbsp;tools)</span></div>
<div class="block">Handles standard, non-streaming function calls.</div>
</div>
</section>
</li>
<li>
<section class="detail" id="handleFunctionCalls(com.google.adk.agents.InvocationContext,com.google.adk.events.Event,java.util.Map,java.util.Map)">
<h3>handleFunctionCalls</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">io.reactivex.rxjava3.core.Maybe&lt;<a href="../../events/Event.html" title="class in com.google.adk.events">Event</a>&gt;</span>&nbsp;<span class="element-name">handleFunctionCalls</span><wbr><span class="parameters">(<a href="../../agents/InvocationContext.html" title="class in com.google.adk.agents">InvocationContext</a>&nbsp;invocationContext,
<a href="../../events/Event.html" title="class in com.google.adk.events">Event</a>&nbsp;functionCallEvent,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Map.html" title="interface in java.util" class="external-link">Map</a>&lt;<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class in java.lang" class="external-link">String</a>,<wbr><a href="../../tools/BaseTool.html" title="class in com.google.adk.tools">BaseTool</a>&gt;&nbsp;tools,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Map.html" title="interface in java.util" class="external-link">Map</a>&lt;<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class in java.lang" class="external-link">String</a>, <a href="../../events/ToolConfirmation.html" title="class in com.google.adk.events">ToolConfirmation</a>&gt;&nbsp;toolConfirmations)</span></div>
<div class="block">Handles standard, non-streaming function calls with tool confirmations.</div>
</div>
</section>
</li>
<li>
<section class="detail" id="handleFunctionCallsLive(com.google.adk.agents.InvocationContext,com.google.adk.events.Event,java.util.Map)">
<h3>handleFunctionCallsLive</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">io.reactivex.rxjava3.core.Maybe&lt;<a href="../../events/Event.html" title="class in com.google.adk.events">Event</a>&gt;</span>&nbsp;<span class="element-name">handleFunctionCallsLive</span><wbr><span class="parameters">(<a href="../../agents/InvocationContext.html" title="class in com.google.adk.agents">InvocationContext</a>&nbsp;invocationContext,
<a href="../../events/Event.html" title="class in com.google.adk.events">Event</a>&nbsp;functionCallEvent,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Map.html" title="interface in java.util" class="external-link">Map</a>&lt;<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class in java.lang" class="external-link">String</a>,<wbr><a href="../../tools/BaseTool.html" title="class in com.google.adk.tools">BaseTool</a>&gt;&nbsp;tools)</span></div>
<div class="block">Handles function calls in a live/streaming context, supporting background execution and stream
termination.</div>
</div>
</section>
</li>
<li>
<section class="detail" id="handleFunctionCallsLive(com.google.adk.agents.InvocationContext,com.google.adk.events.Event,java.util.Map,java.util.Map)">
<h3>handleFunctionCallsLive</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">io.reactivex.rxjava3.core.Maybe&lt;<a href="../../events/Event.html" title="class in com.google.adk.events">Event</a>&gt;</span>&nbsp;<span class="element-name">handleFunctionCallsLive</span><wbr><span class="parameters">(<a href="../../agents/InvocationContext.html" title="class in com.google.adk.agents">InvocationContext</a>&nbsp;invocationContext,
<a href="../../events/Event.html" title="class in com.google.adk.events">Event</a>&nbsp;functionCallEvent,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Map.html" title="interface in java.util" class="external-link">Map</a>&lt;<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class in java.lang" class="external-link">String</a>,<wbr><a href="../../tools/BaseTool.html" title="class in com.google.adk.tools">BaseTool</a>&gt;&nbsp;tools,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Map.html" title="interface in java.util" class="external-link">Map</a>&lt;<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class in java.lang" class="external-link">String</a>, <a href="../../events/ToolConfirmation.html" title="class in com.google.adk.events">ToolConfirmation</a>&gt;&nbsp;toolConfirmations)</span></div>
<div class="block">Handles function calls in a live/streaming context with tool confirmations, supporting
background execution and stream termination.</div>
</div>
</section>
</li>
<li>
<section class="detail" id="getLongRunningFunctionCalls(java.util.List,java.util.Map)">
<h3>getLongRunningFunctionCalls</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Set.html" title="interface in java.util" class="external-link">Set</a>&lt;<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class in java.lang" class="external-link">String</a>&gt;</span>&nbsp;<span class="element-name">getLongRunningFunctionCalls</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="interface in java.util" class="external-link">List</a>&lt;com.google.genai.types.FunctionCall&gt;&nbsp;functionCalls,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Map.html" title="interface in java.util" class="external-link">Map</a>&lt;<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class in java.lang" class="external-link">String</a>,<wbr><a href="../../tools/BaseTool.html" title="class in com.google.adk.tools">BaseTool</a>&gt;&nbsp;tools)</span></div>
</div>
</section>
</li>
<li>
<section class="detail" id="findMatchingFunctionCallEvent(java.util.List)">
<h3>findMatchingFunctionCallEvent</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Optional.html" title="class in java.util" class="external-link">Optional</a>&lt;<a href="../../events/Event.html" title="class in com.google.adk.events">Event</a>&gt;</span>&nbsp;<span class="element-name">findMatchingFunctionCallEvent</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="interface in java.util" class="external-link">List</a>&lt;<a href="../../events/Event.html" title="class in com.google.adk.events">Event</a>&gt;&nbsp;events)</span></div>
<div class="block">Returns the most recent function-call event whose call id matches a function response in the
last event, or empty. Mirrors Python ADK's <code>find_matching_function_call</code>.</div>
</div>
</section>
</li>
<li>
<section class="detail" id="hasPendingLongRunningCall(com.google.adk.events.Event)">
<h3>hasPendingLongRunningCall</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">hasPendingLongRunningCall</span><wbr><span class="parameters">(<a href="../../events/Event.html" title="class in com.google.adk.events">Event</a>&nbsp;event)</span></div>
<div class="block">Returns whether the event emits a long-running function call still awaiting a response (e.g. a
HITL request). Mirrors Python ADK v1's <code>should_pause_invocation</code>.</div>
</div>
</section>
</li>
<li>
<section class="detail" id="generateRequestConfirmationEvent(com.google.adk.agents.InvocationContext,com.google.adk.events.Event,com.google.adk.events.Event)">
<h3>generateRequestConfirmationEvent</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Optional.html" title="class in java.util" class="external-link">Optional</a>&lt;<a href="../../events/Event.html" title="class in com.google.adk.events">Event</a>&gt;</span>&nbsp;<span class="element-name">generateRequestConfirmationEvent</span><wbr><span class="parameters">(<a href="../../agents/InvocationContext.html" title="class in com.google.adk.agents">InvocationContext</a>&nbsp;invocationContext,
<a href="../../events/Event.html" title="class in com.google.adk.events">Event</a>&nbsp;functionCallEvent,
<a href="../../events/Event.html" title="class in com.google.adk.events">Event</a>&nbsp;functionResponseEvent)</span></div>
<div class="block">Generates a request confirmation event from a function response event.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>invocationContext</code> - The invocation context.</dd>
<dd><code>functionCallEvent</code> - The event containing the original function call.</dd>
<dd><code>functionResponseEvent</code> - The event containing the function response.</dd>
<dt>Returns:</dt>
<dd>An optional event containing the request confirmation function call.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="getAskUserConfirmationFunctionCalls(com.google.adk.events.Event)">
<h3>getAskUserConfirmationFunctionCalls</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">com.google.common.collect.ImmutableList&lt;com.google.genai.types.FunctionCall&gt;</span>&nbsp;<span class="element-name">getAskUserConfirmationFunctionCalls</span><wbr><span class="parameters">(<a href="../../events/Event.html" title="class in com.google.adk.events">Event</a>&nbsp;event)</span></div>
<div class="block">Gets the ask user confirmation function calls from the event.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>event</code> - The event to extract function calls from.</dd>
<dt>Returns:</dt>
<dd>A list of function calls for asking user confirmation.</dd>
</dl>
</div>
</section>
</li>
</ul>
</section>
</li>
</ul>
</section>
<!-- ========= END OF CLASS DATA ========= -->
<footer>
<hr>
<p class="legal-copy"><small>Copyright &#169; 1980. All rights reserved.</small></p>
</footer>
</main>
</div>
</body>
</html>