FakeTool class final
Fake tool for testing. It just returns the input string as is.
- Inheritance
-
- Object
- Runnable<
String, ToolOptions, String> - BaseLangChain<
String, ToolOptions, String> - Tool<
String, ToolOptions, String> - StringTool<
ToolOptions> - FakeTool
Constructors
- FakeTool()
- Fake tool for testing. It just returns the input string as is.
Properties
- defaultOptions → ToolOptions
-
The default options to use when invoking the Runnable.
finalinherited
- description → String
-
Used to tell the model how/when/why to use the tool.
You can provide few-shot examples as a part of the description.
finalinherited
- handleToolError → String Function(ToolException)?
-
Handle the content of the ToolException thrown by the tool.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
-
inputJsonSchema
→ Map<
String, dynamic> -
Schema to parse and validate tool's input arguments.
Following the JSON Schema specification.
finalinherited
- name → String
-
The unique name of the tool that clearly communicates its purpose.
finalinherited
- returnDirect → bool
-
Whether to return the tool's output directly.
Setting this to true means that after the tool is called,
the AgentExecutor will stop looping.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- strict → bool
-
Whether to enable strict schema adherence when generating the tool call.
If set to true, the model will follow the exact schema defined in the
inputJsonSchema field.
finalinherited
Methods
-
batch(
List< String> inputs, {List<ToolOptions> ? options}) → Future<List< String> > -
Batches the invocation of the Runnable on the given
inputs
.inherited -
bind(
ToolOptions options) → RunnableBinding< String, ToolOptions, String> -
Binds the Runnable to the given
options
.inherited -
close(
) → void -
Cleans up any resources associated with it the Runnable.
inherited
-
getCompatibleOptions(
RunnableOptions? options) → ToolOptions? -
Returns the given
options
if they are compatible with the Runnable, otherwise returnsnull
.inherited -
getInputFromJson(
Map< String, dynamic> json) → String -
Parses the input JSON to the tool's input type.
inherited
-
invoke(
String input, {ToolOptions? options}) → Future< String> -
Runs the tool.
inherited
-
invokeInternal(
String toolInput, {ToolOptions? options}) → Future< String> -
Actual implementation of invoke method logic with string input.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pipe<
NewRunOutput extends Object?, NewCallOptions extends RunnableOptions> (Runnable< String, NewCallOptions, NewRunOutput> next) → RunnableSequence<String, NewRunOutput> -
Pipes the output of this Runnable into another Runnable using a
RunnableSequence.
inherited
-
stream(
String input, {ToolOptions? options}) → Stream< String> -
Streams the output of invoking the Runnable on the given
input
.inherited -
streamFromInputStream(
Stream< String> inputStream, {ToolOptions? options}) → Stream<String> -
Streams the tool's output for the input resulting from
reducing the input stream.
inherited
-
toJson(
) → Map< String, dynamic> -
Converts the tool spec to a JSON-serializable map.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
withFallbacks(
List< Runnable< fallbacks) → RunnableWithFallback<String, RunnableOptions, String> >String, String> -
Adds fallback runnables to be invoked if the primary runnable fails.
inherited
-
withRetry(
{int maxRetries = 3, FutureOr< bool> retryIf(Object e)?, List<Duration?> ? delayDurations, bool addJitter = false}) → RunnableRetry<String, String> -
Adds retry logic to an existing runnable.
inherited
Operators
-
operator ==(
covariant ToolSpec other) → bool -
The equality operator.
inherited