SimilaritySearch
class SimilaritySearch implements Approvable, Tool, Transient
Traits
Properties
| protected Approval|bool|null | $approvalRequirement | from InteractsWithApprovals | |
| protected string|null | $description | ||
| protected bool | $rerank | ||
| protected Closure|array|string|null | $rerankBy | ||
| protected int|null | $rerankLimit |
Methods
Indicate that the tool requires approval before execution.
Indicate that the tool may execute without approval.
Determine whether the tool should request approval for the given request.
Create a new similarity search tool instance.
Get the description of the tool's purpose.
Set the tool's description.
Details
in
InteractsWithApprovals at line 17
InteractsWithApprovals
requireApproval(string|null $reason = null)
Indicate that the tool requires approval before execution.
in
InteractsWithApprovals at line 27
InteractsWithApprovals
withoutApproval()
Indicate that the tool may execute without approval.
in
InteractsWithApprovals at line 37
Approval|null
shouldRequestApproval(Request $request)
Determine whether the tool should request approval for the given request.
at line 153
protected Approval|bool
needsApproval(Request $request)
Determine whether the tool needs approval for the given request.
at line 34
__construct(Closure $using)
Create a new similarity search tool instance.
at line 46
static SimilaritySearch
usingModel(string $model, string $column, float $minSimilarity = 0.6, int $limit = 15, Closure|null $query = null)
Create a new similarity search tool instance.
at line 81
Stringable|string
description()
Get the description of the tool's purpose.
at line 89
Stringable|string
handle(Request $request)
Execute the tool.
at line 118
SimilaritySearch
withDescription(string $description)
Set the tool's description.
at line 128
SimilaritySearch
rerank(Closure|array|string $by, int|null $limit = null)
Indicate that the results should be reranked.
at line 140
array
schema(JsonSchema $schema)
Get the tool's schema definition.