ToolUp.AI.Wire 0.38.1

Prefix Reserved
dotnet add package ToolUp.AI.Wire --version 0.38.1
                    
NuGet\Install-Package ToolUp.AI.Wire -Version 0.38.1
                    
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="ToolUp.AI.Wire" Version="0.38.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ToolUp.AI.Wire" Version="0.38.1" />
                    
Directory.Packages.props
<PackageReference Include="ToolUp.AI.Wire" />
                    
Project file
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 ToolUp.AI.Wire --version 0.38.1
                    
#r "nuget: ToolUp.AI.Wire, 0.38.1"
                    
#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 ToolUp.AI.Wire@0.38.1
                    
#: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=ToolUp.AI.Wire&version=0.38.1
                    
Install as a Cake Addin
#tool nuget:?package=ToolUp.AI.Wire&version=0.38.1
                    
Install as a Cake Tool

ToolUp.AI.Wire

A small, portable JSON value model for building and reading wire payloads, compilable to both .NET and Fable (browser). It depends on FSharp.Core + Fable.Core only — no System.Net.Http, no unguarded System.Text.Json — so one mapping can serve a server host and a browser host without re-deriving the translation.

What it gives you

  • JsonValue — a JSON value DU (JNull / JBool / JNumber / JString / JArray / JObject). Object members are an ordered list, so serialization preserves insertion order and is byte-stable.
  • Builders — jnull / jbool / jnum / jint / jstr / jarr / jobj, auto-opened for terse construction.
  • Total accessors — tryField / asString / asInt / asFloat / asBool / asArray / asObject / tryItem. Every one returns option and never throws.
  • A host-bridged seam — JsonHost.serialize (a single portable canonical writer, identical on every host) and JsonHost.parse (bridged to the browser's JSON.parse under Fable, to System.Text.Json otherwise), returning JsonValue option.
  • The connector contract (Contract.fs, namespace ToolUp.Platform.AI) — the portable IAIProvider value types a browser host can reference directly: AIProviderMessage / AIProviderToolCall / AIProviderToolResult / AIProviderToolDef / AIProviderResponse / TokenUsage / AIProviderCapabilities / AIProviderError / AIContentPart (+ ImageSource / ImagePayload) and their companion modules. They keep the ToolUp.Platform.AI namespace so a ToolUp.Platform consumer sees them unchanged; the IAIProvider interface itself stays in ToolUp.Platform.Core (it references the server-tier RetryPolicy).

Example

open ToolUp.AI.Wire

let body =
    jobj
        [ "model", jstr "example-model"
          "stream", jbool true
          "messages", jarr [ jobj [ "role", jstr "user"; "content", jstr "hi" ] ] ]

let json = JsonHost.serialize body
// {"model":"example-model","stream":true,"messages":[{"role":"user","content":"hi"}]}

let model =
    JsonHost.parse json
    |> Option.bind (JsonValue.tryField "model")
    |> Option.bind JsonValue.asString
// Some "example-model"

Byte-stable output

JsonHost.serialize is a hand-rolled canonical writer rather than a passthrough to two different host JSON engines, so its bytes are identical on .NET and Fable for the same JsonValue. Object keys emit in JObject order; output is compact (no insignificant whitespace).

Licensed under Apache-2.0.

Product 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.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on ToolUp.AI.Wire:

Package Downloads
ToolUp.Platform.Core

ToolUp.Platform Core — shared types and interfaces (ILogger, IBlobStorage, IAuthProvider, IAIProvider, INotificationChannel, IHealthCheck, IConfigValidator, etc.). No server or client deps; the "minimum viable module" floor for downstream packages.

ToolUp.AIProviders.Claude

Claude (Anthropic) IAIProvider implementation for ToolUp.AI. BYOK-capable; reads API keys from ISecretStore.

ToolUp.Facts.Presentation

ToolUp.Facts.Presentation — from a gated fact series to a Fuaran-UI node. A presentation request (trend, breakdown, comparison or table; the whole of what a model may author for a block) and its JSON codec, and pure builders that draw a FactSeries as a validated Fuaran-UI node with the BlockProvenance that produced it. A withheld or absent point is never drawn as a number: it is left out of the rows and named with its reason. And the pipeline block: the request an evaluate_pipeline block part persists, the re-run's wire result and remoting contract, and the grid a result is drawn as. And the requests a stored page names — a presentation request or a pipeline request — in their canonical JSON, with the data a resolution of one carries. Compiled by both compilers, so a browser rebuilds exactly what a server built.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.38.1 28 11/1/2026
0.38.0 155 10/31/2026
0.37.0 513 10/29/2026
0.36.0 688 10/29/2026
0.35.0 889 10/28/2026
0.34.1 1,274 10/27/2026
0.34.0 1,435 10/26/2026
0.33.0 1,439 10/25/2026
0.32.0 1,432 10/24/2026
0.31.0 1,448 10/22/2026
0.30.0 1,404 10/20/2026
0.29.0 1,293 10/19/2026
0.28.0 1,328 10/19/2026
0.27.0 1,354 10/16/2026
0.26.0 1,391 10/12/2026
0.25.1 1,347 10/9/2026
0.24.1 1,345 10/6/2026
0.23.0 1,257 9/23/2026
0.22.0 1,128 8/27/2026
0.21.0 1,081 8/26/2026
Loading failed