Files
2026-07-24 18:22:51 +00:00

615 lines
48 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>InvocationContext (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.agents, class: InvocationContext">
<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/InvocationContext.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.agents</a></li>
<li><a href="InvocationContext.html" class="current-selection">InvocationContext</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="#nested-class-summary" tabindex="0">Nested Class Summary</a></li>
<li><a href="#constructor-summary" tabindex="0">Constructor Summary</a></li>
<li><a href="#method-summary" tabindex="0">Method Summary</a></li>
<li><a href="#constructor-detail" tabindex="0">Constructor Details</a>
<ol class="toc-list">
<li><a href="#%3Cinit%3E(com.google.adk.agents.InvocationContext.Builder)" tabindex="0">InvocationContext(InvocationContext.Builder)</a></li>
</ol>
</li>
<li><a href="#method-detail" tabindex="0">Method Details</a>
<ol class="toc-list">
<li><a href="#builder()" tabindex="0">builder()</a></li>
<li><a href="#toBuilder()" tabindex="0">toBuilder()</a></li>
<li><a href="#sessionService()" tabindex="0">sessionService()</a></li>
<li><a href="#artifactService()" tabindex="0">artifactService()</a></li>
<li><a href="#memoryService()" tabindex="0">memoryService()</a></li>
<li><a href="#pluginManager()" tabindex="0">pluginManager()</a></li>
<li><a href="#activeStreamingTools()" tabindex="0">activeStreamingTools()</a></li>
<li><a href="#liveRequestQueue()" tabindex="0">liveRequestQueue()</a></li>
<li><a href="#invocationId()" tabindex="0">invocationId()</a></li>
<li><a href="#branch(java.lang.String)" tabindex="0">branch(String)</a></li>
<li><a href="#branch()" tabindex="0">branch()</a></li>
<li><a href="#agent()" tabindex="0">agent()</a></li>
<li><a href="#session()" tabindex="0">session()</a></li>
<li><a href="#userContent()" tabindex="0">userContent()</a></li>
<li><a href="#runConfig()" tabindex="0">runConfig()</a></li>
<li><a href="#callbackContextData()" tabindex="0">callbackContextData()</a></li>
<li><a href="#endInvocation()" tabindex="0">endInvocation()</a></li>
<li><a href="#setEndInvocation(boolean)" tabindex="0">setEndInvocation(boolean)</a></li>
<li><a href="#appName()" tabindex="0">appName()</a></li>
<li><a href="#userId()" tabindex="0">userId()</a></li>
<li><a href="#newInvocationContextId()" tabindex="0">newInvocationContextId()</a></li>
<li><a href="#incrementLlmCallsCount()" tabindex="0">incrementLlmCallsCount()</a></li>
<li><a href="#eventsCompactionConfig()" tabindex="0">eventsCompactionConfig()</a></li>
<li><a href="#contextCacheConfig()" tabindex="0">contextCacheConfig()</a></li>
<li><a href="#isResumable()" tabindex="0">isResumable()</a></li>
<li><a href="#equals(java.lang.Object)" tabindex="0">equals(Object)</a></li>
<li><a href="#hashCode()" tabindex="0">hashCode()</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 InvocationContext" class="title">Class InvocationContext</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.agents.InvocationContext</div>
</div>
<section class="class-description" id="class-description">
<hr>
<div class="horizontal-scroll">
<div class="type-signature"><span class="modifiers">public class </span><span class="element-name type-name-label">InvocationContext</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">The context for an agent invocation.</div>
</div>
</section>
<section class="summary">
<ul class="summary-list">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<li>
<section class="nested-class-summary" id="nested-class-summary">
<h2>Nested Class Summary</h2>
<div class="caption"><span>Nested Classes</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">Class</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color"><code>static class&nbsp;</code></div>
<div class="col-second even-row-color"><code><a href="InvocationContext.Builder.html" class="type-name-link" title="class in com.google.adk.agents">InvocationContext.Builder</a></code></div>
<div class="col-last even-row-color">
<div class="block">Builder for <a href="InvocationContext.html" title="class in com.google.adk.agents"><code>InvocationContext</code></a>.</div>
</div>
</div>
</section>
</li>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<li>
<section class="constructor-summary" id="constructor-summary">
<h2>Constructor Summary</h2>
<div class="caption"><span>Constructors</span></div>
<div class="summary-table three-column-summary">
<div class="table-header col-first">Modifier</div>
<div class="table-header col-second">Constructor</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color"><code>protected </code></div>
<div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E(com.google.adk.agents.InvocationContext.Builder)" class="member-name-link">InvocationContext</a><wbr>(<a href="InvocationContext.Builder.html" title="class in com.google.adk.agents">InvocationContext.Builder</a>&nbsp;builder)</code></div>
<div class="col-last even-row-color">&nbsp;</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-tab2" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab2', 3)" class="table-tab">Instance 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-tab2 method-summary-table-tab4"><code><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><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>, <a href="ActiveStreamingTool.html" title="class in com.google.adk.agents">ActiveStreamingTool</a>&gt;</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#activeStreamingTools()" class="member-name-link">activeStreamingTools</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns a map of tool call IDs to active streaming tools for the current invocation.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="BaseAgent.html" title="class in com.google.adk.agents">BaseAgent</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#agent()" class="member-name-link">agent</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns the agent being invoked.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><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 method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#appName()" class="member-name-link">appName</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns the application name associated with the session.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="../artifacts/BaseArtifactService.html" title="interface in com.google.adk.artifacts">BaseArtifactService</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#artifactService()" class="member-name-link">artifactService</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns the artifact service for persisting artifacts.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><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="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-tab2 method-summary-table-tab4"><code><a href="#branch()" class="member-name-link">branch</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns the branch ID for the current invocation, if one is set.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#branch(java.lang.String)" class="member-name-link">branch</a><wbr>(@Nullable <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>&nbsp;branch)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Sets the [branch] ID for the current invocation.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="InvocationContext.Builder.html" title="class in com.google.adk.agents">InvocationContext.Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#builder()" class="member-name-link">builder</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns a new <a href="InvocationContext.Builder.html" title="class in com.google.adk.agents"><code>InvocationContext.Builder</code></a> for creating <a href="InvocationContext.html" title="class in com.google.adk.agents"><code>InvocationContext</code></a> instances.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><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><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>,<wbr><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>&gt;</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#callbackContextData()" class="member-name-link">callbackContextData</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns a map for storing temporary context data that can be shared between different parts of
the invocation (e.g., before/on/after model callbacks).</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><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="ContextCacheConfig.html" title="class in com.google.adk.agents">ContextCacheConfig</a>&gt;</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#contextCacheConfig()" class="member-name-link">contextCacheConfig</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns the context cache configuration for the current agent run.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#endInvocation()" class="member-name-link">endInvocation</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns whether this invocation should be ended, e.g., due to reaching a terminal state or
error.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#equals(java.lang.Object)" class="member-name-link">equals</a><wbr>(<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>&nbsp;o)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><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="../summarizer/EventsCompactionConfig.html" title="class in com.google.adk.summarizer">EventsCompactionConfig</a>&gt;</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#eventsCompactionConfig()" class="member-name-link">eventsCompactionConfig</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns the events compaction configuration for the current agent run.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>int</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#hashCode()" class="member-name-link">hashCode</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#incrementLlmCallsCount()" class="member-name-link">incrementLlmCallsCount</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Increments the count of LLM calls made during this invocation and throws an exception if the
limit defined in <a href="RunConfig.html" title="class in com.google.adk.agents"><code>RunConfig</code></a> is exceeded.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><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 method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#invocationId()" class="member-name-link">invocationId</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns the unique ID for this invocation.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#isResumable()" class="member-name-link">isResumable</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns whether the current invocation is resumable.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><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="LiveRequestQueue.html" title="class in com.google.adk.agents">LiveRequestQueue</a>&gt;</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#liveRequestQueue()" class="member-name-link">liveRequestQueue</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns the queue for managing live requests, if available for this invocation.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="../memory/BaseMemoryService.html" title="interface in com.google.adk.memory">BaseMemoryService</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#memoryService()" class="member-name-link">memoryService</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns the memory service for accessing agent memory.</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/lang/String.html" title="class in java.lang" class="external-link">String</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#newInvocationContextId()" class="member-name-link">newInvocationContextId</a>()</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 new unique ID for an invocation context.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="../plugins/Plugin.html" title="interface in com.google.adk.plugins">Plugin</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#pluginManager()" class="member-name-link">pluginManager</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns the plugin manager for accessing tools and plugins.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="RunConfig.html" title="class in com.google.adk.agents">RunConfig</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#runConfig()" class="member-name-link">runConfig</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns the configuration for the current agent run.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="../sessions/Session.html" title="class in com.google.adk.sessions">Session</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#session()" class="member-name-link">session</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns the session associated with this invocation.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="../sessions/BaseSessionService.html" title="interface in com.google.adk.sessions">BaseSessionService</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#sessionService()" class="member-name-link">sessionService</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns the session service for managing session state.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setEndInvocation(boolean)" class="member-name-link">setEndInvocation</a><wbr>(boolean&nbsp;endInvocation)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Sets whether this invocation should be ended.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="InvocationContext.Builder.html" title="class in com.google.adk.agents">InvocationContext.Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#toBuilder()" class="member-name-link">toBuilder</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns a <a href="InvocationContext.Builder.html" title="class in com.google.adk.agents"><code>InvocationContext.Builder</code></a> initialized with the values of this instance.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><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;com.google.genai.types.Content&gt;</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#userContent()" class="member-name-link">userContent</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns the user content that triggered this invocation, if any.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><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 method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#userId()" class="member-name-link">userId</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns the user ID associated with the session.</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#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#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">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<li>
<section class="constructor-details" id="constructor-detail">
<h2>Constructor Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="&lt;init&gt;(com.google.adk.agents.InvocationContext.Builder)">
<h3>InvocationContext</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">protected</span>&nbsp;<span class="element-name">InvocationContext</span><wbr><span class="parameters">(<a href="InvocationContext.Builder.html" title="class in com.google.adk.agents">InvocationContext.Builder</a>&nbsp;builder)</span></div>
</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="builder()">
<h3>builder</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="InvocationContext.Builder.html" title="class in com.google.adk.agents">InvocationContext.Builder</a></span>&nbsp;<span class="element-name">builder</span>()</div>
<div class="block">Returns a new <a href="InvocationContext.Builder.html" title="class in com.google.adk.agents"><code>InvocationContext.Builder</code></a> for creating <a href="InvocationContext.html" title="class in com.google.adk.agents"><code>InvocationContext</code></a> instances.</div>
</div>
</section>
</li>
<li>
<section class="detail" id="toBuilder()">
<h3>toBuilder</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="InvocationContext.Builder.html" title="class in com.google.adk.agents">InvocationContext.Builder</a></span>&nbsp;<span class="element-name">toBuilder</span>()</div>
<div class="block">Returns a <a href="InvocationContext.Builder.html" title="class in com.google.adk.agents"><code>InvocationContext.Builder</code></a> initialized with the values of this instance.</div>
</div>
</section>
</li>
<li>
<section class="detail" id="sessionService()">
<h3>sessionService</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="../sessions/BaseSessionService.html" title="interface in com.google.adk.sessions">BaseSessionService</a></span>&nbsp;<span class="element-name">sessionService</span>()</div>
<div class="block">Returns the session service for managing session state.</div>
</div>
</section>
</li>
<li>
<section class="detail" id="artifactService()">
<h3>artifactService</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="../artifacts/BaseArtifactService.html" title="interface in com.google.adk.artifacts">BaseArtifactService</a></span>&nbsp;<span class="element-name">artifactService</span>()</div>
<div class="block">Returns the artifact service for persisting artifacts.</div>
</div>
</section>
</li>
<li>
<section class="detail" id="memoryService()">
<h3>memoryService</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="../memory/BaseMemoryService.html" title="interface in com.google.adk.memory">BaseMemoryService</a></span>&nbsp;<span class="element-name">memoryService</span>()</div>
<div class="block">Returns the memory service for accessing agent memory.</div>
</div>
</section>
</li>
<li>
<section class="detail" id="pluginManager()">
<h3>pluginManager</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="../plugins/Plugin.html" title="interface in com.google.adk.plugins">Plugin</a></span>&nbsp;<span class="element-name">pluginManager</span>()</div>
<div class="block">Returns the plugin manager for accessing tools and plugins.</div>
</div>
</section>
</li>
<li>
<section class="detail" id="activeStreamingTools()">
<h3>activeStreamingTools</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><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="ActiveStreamingTool.html" title="class in com.google.adk.agents">ActiveStreamingTool</a>&gt;</span>&nbsp;<span class="element-name">activeStreamingTools</span>()</div>
<div class="block">Returns a map of tool call IDs to active streaming tools for the current invocation.</div>
</div>
</section>
</li>
<li>
<section class="detail" id="liveRequestQueue()">
<h3>liveRequestQueue</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public</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="LiveRequestQueue.html" title="class in com.google.adk.agents">LiveRequestQueue</a>&gt;</span>&nbsp;<span class="element-name">liveRequestQueue</span>()</div>
<div class="block">Returns the queue for managing live requests, if available for this invocation.</div>
</div>
</section>
</li>
<li>
<section class="detail" id="invocationId()">
<h3>invocationId</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public</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">invocationId</span>()</div>
<div class="block">Returns the unique ID for this invocation.</div>
</div>
</section>
</li>
<li>
<section class="detail" id="branch(java.lang.String)">
<h3>branch</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">branch</span><wbr><span class="parameters">(@Nullable <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>&nbsp;branch)</span></div>
<div class="block">Sets the [branch] ID for the current invocation. A branch represents a fork in the conversation
history.</div>
</div>
</section>
</li>
<li>
<section class="detail" id="branch()">
<h3>branch</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public</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="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">branch</span>()</div>
<div class="block">Returns the branch ID for the current invocation, if one is set. A branch represents a fork in
the conversation history.</div>
</div>
</section>
</li>
<li>
<section class="detail" id="agent()">
<h3>agent</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="BaseAgent.html" title="class in com.google.adk.agents">BaseAgent</a></span>&nbsp;<span class="element-name">agent</span>()</div>
<div class="block">Returns the agent being invoked.</div>
</div>
</section>
</li>
<li>
<section class="detail" id="session()">
<h3>session</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="../sessions/Session.html" title="class in com.google.adk.sessions">Session</a></span>&nbsp;<span class="element-name">session</span>()</div>
<div class="block">Returns the session associated with this invocation.</div>
</div>
</section>
</li>
<li>
<section class="detail" id="userContent()">
<h3>userContent</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public</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;com.google.genai.types.Content&gt;</span>&nbsp;<span class="element-name">userContent</span>()</div>
<div class="block">Returns the user content that triggered this invocation, if any.</div>
</div>
</section>
</li>
<li>
<section class="detail" id="runConfig()">
<h3>runConfig</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="RunConfig.html" title="class in com.google.adk.agents">RunConfig</a></span>&nbsp;<span class="element-name">runConfig</span>()</div>
<div class="block">Returns the configuration for the current agent run.</div>
</div>
</section>
</li>
<li>
<section class="detail" id="callbackContextData()">
<h3>callbackContextData</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><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="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>&gt;</span>&nbsp;<span class="element-name">callbackContextData</span>()</div>
<div class="block">Returns a map for storing temporary context data that can be shared between different parts of
the invocation (e.g., before/on/after model callbacks).</div>
</div>
</section>
</li>
<li>
<section class="detail" id="endInvocation()">
<h3>endInvocation</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">endInvocation</span>()</div>
<div class="block">Returns whether this invocation should be ended, e.g., due to reaching a terminal state or
error.</div>
</div>
</section>
</li>
<li>
<section class="detail" id="setEndInvocation(boolean)">
<h3>setEndInvocation</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setEndInvocation</span><wbr><span class="parameters">(boolean&nbsp;endInvocation)</span></div>
<div class="block">Sets whether this invocation should be ended.</div>
</div>
</section>
</li>
<li>
<section class="detail" id="appName()">
<h3>appName</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public</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">appName</span>()</div>
<div class="block">Returns the application name associated with the session.</div>
</div>
</section>
</li>
<li>
<section class="detail" id="userId()">
<h3>userId</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public</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">userId</span>()</div>
<div class="block">Returns the user ID associated with the session.</div>
</div>
</section>
</li>
<li>
<section class="detail" id="newInvocationContextId()">
<h3>newInvocationContextId</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">newInvocationContextId</span>()</div>
<div class="block">Generates a new unique ID for an invocation context.</div>
</div>
</section>
</li>
<li>
<section class="detail" id="incrementLlmCallsCount()">
<h3>incrementLlmCallsCount</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">incrementLlmCallsCount</span>()
throws <span class="exceptions"><a href="../models/LlmCallsLimitExceededException.html" title="class in com.google.adk.models">LlmCallsLimitExceededException</a></span></div>
<div class="block">Increments the count of LLM calls made during this invocation and throws an exception if the
limit defined in <a href="RunConfig.html" title="class in com.google.adk.agents"><code>RunConfig</code></a> is exceeded.</div>
<dl class="notes">
<dt>Throws:</dt>
<dd><code><a href="../models/LlmCallsLimitExceededException.html" title="class in com.google.adk.models">LlmCallsLimitExceededException</a></code> - if the call limit is exceeded</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="eventsCompactionConfig()">
<h3>eventsCompactionConfig</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public</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="../summarizer/EventsCompactionConfig.html" title="class in com.google.adk.summarizer">EventsCompactionConfig</a>&gt;</span>&nbsp;<span class="element-name">eventsCompactionConfig</span>()</div>
<div class="block">Returns the events compaction configuration for the current agent run.</div>
</div>
</section>
</li>
<li>
<section class="detail" id="contextCacheConfig()">
<h3>contextCacheConfig</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public</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="ContextCacheConfig.html" title="class in com.google.adk.agents">ContextCacheConfig</a>&gt;</span>&nbsp;<span class="element-name">contextCacheConfig</span>()</div>
<div class="block">Returns the context cache configuration for the current agent run.</div>
</div>
</section>
</li>
<li>
<section class="detail" id="isResumable()">
<h3>isResumable</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">isResumable</span>()</div>
<div class="block">Returns whether the current invocation is resumable. Mirrors Python ADK v1's <code>
InvocationContext.is_resumable</code>.</div>
</div>
</section>
</li>
<li>
<section class="detail" id="equals(java.lang.Object)">
<h3>equals</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">equals</span><wbr><span class="parameters">(<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>&nbsp;o)</span></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#equals(java.lang.Object)" class="external-link">equals</a></code>&nbsp;in class&nbsp;<code><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></code></dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="hashCode()">
<h3>hashCode</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">hashCode</span>()</div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#hashCode()" class="external-link">hashCode</a></code>&nbsp;in class&nbsp;<code><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></code></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>