public final class AutomaticFunctionCallingResponder extends Object
| Constructor and Description |
|---|
AutomaticFunctionCallingResponder()
Constructs an AutomaticFunctionCallingResponder instance.
|
AutomaticFunctionCallingResponder(int maxFunctionCalls)
Constructs an AutomaticFunctionCallingResponder instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCallableFunction(String functionName,
Method callableFunction,
String... orderedParameterNames)
Adds a callable function to the AutomaticFunctionCallingResponder.
|
int |
getMaxFunctionCalls()
Gets the maximum number of function calls to make in a row.
|
void |
setMaxFunctionCalls(int maxFunctionCalls)
Sets the maximum number of function calls to make in a row.
|
public AutomaticFunctionCallingResponder()
public AutomaticFunctionCallingResponder(int maxFunctionCalls)
maxFunctionCalls - the maximum number of function calls to make in a rowpublic void setMaxFunctionCalls(int maxFunctionCalls)
public int getMaxFunctionCalls()
public void addCallableFunction(String functionName, Method callableFunction, String... orderedParameterNames)
Note:: If you don't want to manually provide parameter names, you can ignore `orderedParameterNames` and compile your code with the "-parameters" flag. In this case, the parameter names can be auto retrieved from reflection.
functionName - the name of the functioncallableFunction - the method to call when the functionName is requestedorderedParameterNames - the names of the parameters in the order they are passed to the
functionIllegalArgumentException - if the functionName is already in the responderIllegalStateException - if the parameter names are not provided and cannot be retrieved
from reflectionCopyright © 2025 Google LLC. All rights reserved.