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

141 lines
8.2 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>Instruction (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, interface: Instruction">
<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/Instruction.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="Instruction.html" class="current-selection">Instruction</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>
</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="Interface Instruction" class="title">Interface Instruction</h1>
</div>
<section class="class-description" id="class-description">
<dl class="notes">
<dt>All Known Implementing Classes:</dt>
<dd><code><a href="Instruction.Provider.html" title="class in com.google.adk.agents">Instruction.Provider</a>, <a href="Instruction.Static.html" title="class in com.google.adk.agents">Instruction.Static</a></code></dd>
</dl>
<hr>
<div class="horizontal-scroll">
<div class="type-signature"><span class="modifiers">public sealed interface </span><span class="element-name type-name-label">Instruction</span>
<span class="permits">permits <a href="Instruction.Static.html" title="class in com.google.adk.agents">Instruction.Static</a>, <a href="Instruction.Provider.html" title="class in com.google.adk.agents">Instruction.Provider</a></span></div>
<div class="block">Represents an instruction that can be provided to an agent to guide its behavior.
<p>In the instructions, you should describe concisely what the agent will do, when it should
defer to other agents/tools, and how it should respond to the user.
<p>Templating is supported using placeholders like <code>{variable_name}</code> or <code>
{artifact.artifact_name}</code>. These are replaced with values from the agent's session state or
loaded artifacts, respectively. For example, an instruction like <code>"Translate the following
text to {language}: {user_query}"</code> would substitute <code>{language}</code> and <code>{user_query}</code>
with their corresponding values from the session state.
<p>Instructions can also be dynamically constructed using <a href="Instruction.Provider.html" title="class in com.google.adk.agents"><code>Instruction.Provider</code></a>. This
allows for more complex logic where the instruction text is generated based on the current <a href="ReadonlyContext.html" title="class in com.google.adk.agents"><code>ReadonlyContext</code></a>. Additionally, an instruction could be built to include specific information
based on based on some external factors fetched during the Provider call like the current time,
the result of some API call, etc.</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">Interface</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color"><code>static final record&nbsp;</code></div>
<div class="col-second even-row-color"><code><a href="Instruction.Provider.html" class="type-name-link" title="class in com.google.adk.agents">Instruction.Provider</a></code></div>
<div class="col-last even-row-color">
<div class="block">Returns an instruction dynamically constructed from the given context.</div>
</div>
<div class="col-first odd-row-color"><code>static final record&nbsp;</code></div>
<div class="col-second odd-row-color"><code><a href="Instruction.Static.html" class="type-name-link" title="class in com.google.adk.agents">Instruction.Static</a></code></div>
<div class="col-last odd-row-color">
<div class="block">Plain instruction directly provided to the agent.</div>
</div>
</div>
</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>