ToolUp.AI.Wire 0.22.0

Prefix Reserved
dotnet add package ToolUp.AI.Wire --version 0.22.0
                    
NuGet\Install-Package ToolUp.AI.Wire -Version 0.22.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="ToolUp.AI.Wire" Version="0.22.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ToolUp.AI.Wire" Version="0.22.0" />
                    
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.22.0
                    
#r "nuget: ToolUp.AI.Wire, 0.22.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 ToolUp.AI.Wire@0.22.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=ToolUp.AI.Wire&version=0.22.0
                    
Install as a Cake Addin
#tool nuget:?package=ToolUp.AI.Wire&version=0.22.0
                    
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.
  • Buildersjnull / jbool / jnum / jint / jstr / jarr / jobj, auto-opened for terse construction.
  • Total accessorstryField / asString / asInt / asFloat / asBool / asArray / asObject / tryItem. Every one returns option and never throws.
  • A host-bridged seamJsonHost.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 (2)

Showing the top 2 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.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.22.0 61 8/27/2026
0.21.0 164 8/26/2026
0.20.1 1,411 8/20/2026
0.20.0 1,367 8/19/2026