TreeWeaver.Client
4.2.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package TreeWeaver.Client --version 4.2.0
NuGet\Install-Package TreeWeaver.Client -Version 4.2.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TreeWeaver.Client" Version="4.2.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TreeWeaver.Client" Version="4.2.0" />
<PackageReference Include="TreeWeaver.Client" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add TreeWeaver.Client --version 4.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: TreeWeaver.Client, 4.2.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package TreeWeaver.Client@4.2.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=TreeWeaver.Client&version=4.2.0
#tool nuget:?package=TreeWeaver.Client&version=4.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
TreeWeaver.Client
The typed client for the TreeWeaver HTTP API. TreeWeaver is a server for hierarchical, deterministic
retrieval over documents; you run the server and talk to it through this package. It depends only on
the wire records (TreeWeaver.Contracts), never on the engine.
services.AddTreeWeaverClient(options =>
{
options.BaseUrl = "https://treeweaver.internal:8080";
options.ApiKey = configuration["TreeWeaver:Client:ApiKey"]!;
});
public sealed class KnowledgeSearch(ITreeWeaverClient treeweaver)
{
public Task<RetrieveQueryResponse> SearchAsync(string question, CancellationToken ct) =>
treeweaver.RetrieveAsync(
new RetrieveQueryRequest(
Language: "en",
Question: question,
Select: new RetrieveSelect(TopK: 5),
Assemble: new RetrieveAssemble(TokenBudget: 4000, Expand: true)),
ct);
}
- The key travels in the
X-API-Keyheader. A key belongs to one tenant and carries roles (Read,Write,Admin); the tenant of a request is the tenant of its key. - A service key — a key the operator gave the role
Service— names the tenant per call instead, so one backend serving several tenants holds one key. Say once where the tenant comes from withservices.AddTreeWeaverActingTenant(scope => …), and every call made in a scope acts for that scope's tenant. ITreeWeaverClientoffers retrieval and answering directly and the rest of the surface through its sub-clients (Documents,Tags,Categories,Tenants, …).- The client carries no timeout of its own: an ingest or a streamed answer may run for minutes, and the cancellation token every method takes is how you bound it.
The server ships as the container image treeweaverdev/treeweaver; TreeWeaver.Aspire.Hosting adds
it to an Aspire AppHost.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- Microsoft.Extensions.Http (>= 10.0.12)
- Microsoft.Extensions.Options (>= 10.0.12)
- TreeWeaver.Contracts (>= 4.2.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.