ElBruno.AI.Decisions.Foundry
0.8.0
dotnet add package ElBruno.AI.Decisions.Foundry --version 0.8.0
NuGet\Install-Package ElBruno.AI.Decisions.Foundry -Version 0.8.0
<PackageReference Include="ElBruno.AI.Decisions.Foundry" Version="0.8.0" />
<PackageVersion Include="ElBruno.AI.Decisions.Foundry" Version="0.8.0" />
<PackageReference Include="ElBruno.AI.Decisions.Foundry" />
paket add ElBruno.AI.Decisions.Foundry --version 0.8.0
#r "nuget: ElBruno.AI.Decisions.Foundry, 0.8.0"
#:package ElBruno.AI.Decisions.Foundry@0.8.0
#addin nuget:?package=ElBruno.AI.Decisions.Foundry&version=0.8.0
#tool nuget:?package=ElBruno.AI.Decisions.Foundry&version=0.8.0
ElBruno.AI.Decisions.Foundry
Use Microsoft-Decision-1 on Microsoft Foundry or gpt-6-luna through the Azure
OpenAI Decisions API with the shared .NET 10 IDecisionClient: Choose, Score
and Assess. This is a community SDK, not an official Microsoft SDK.
dotnet add package ElBruno.AI.Decisions.Foundry --version 0.8.0
Quickstart
Deploy Microsoft-Decision-1 in Foundry and run az login. The endpoint-first
constructor accepts either a Foundry project endpoint or resource root, along
with the deployment name and an explicit token credential. Endpoint-first
construction and project-endpoint support require version 0.8.0 or later:
using Azure.Identity;
using ElBruno.AI.Decisions.Foundry;
using var client = new FoundryDecisionClient(
new Uri("https://<resource>.services.ai.azure.com/api/projects/<project>"),
"<deployment-name>",
new AzureCliCredential());
var teams = new Dictionary<string, string?>
{
["billing"] = "Invoices and payments",
["support"] = "Technical problems"
};
var result = await client.ChooseAsync(
"Please correct my invoice.", "Which team should handle this request?", teams);
Console.WriteLine($"{result.Choice}: {result.Confidence:P1}");
URL template: https://<resource>.services.ai.azure.com/providers/microsoft/v1/systemone.
Both the resource root (https://<resource>.services.ai.azure.com/) and project
endpoint (https://<resource>.services.ai.azure.com/api/projects/<project>)
resolve to this resource-scoped route, with or without a trailing slash. Full
invocation URLs and custom paths are preserved. Deployment name: the
deployment identifier sent to the API, for example msft-decision-1, not
necessarily the catalog name Microsoft-Decision-1. Supply any
Azure.Core.TokenCredential, including AzureCliCredential for local
development or ManagedIdentityCredential in a hosted app. The constructor
uses the credential you provide without selecting or replacing one.
Advanced configuration and custom transports
Use FoundryDecisionOptions for API keys, timeout configuration, or other
advanced settings. A supplied API key takes precedence over
FoundryDecisionOptions.Credential. AddFoundryDecisions uses the same
resource/project endpoint resolution.
The HttpClient overload borrows the caller's client and does not dispose it.
Keep it alive while requests run and dispose it afterward. The Foundry client
sets its timeout to infinite and enforces FoundryDecisionOptions.Timeout per
request. The ordinary options constructor creates and owns its transport.
Illustrative response
{
"answers": {
"decision": {
"type": "choice",
"choice": "billing",
"probabilities": { "billing": 0.99, "support": 0.01 },
"confidence": 0.95
}
}
}
Example output: billing: 95.0% (culture-dependent formatting).
Confidence is distinct from the selected-label probability.
Choice, Score and Assess expose optional result.Usage from the top-level
System One usage object. InputTokens, OutputTokens, TotalTokens,
ReasoningTokens and CachedTokens remain null when unreported. Foundry may
report input and output without a total; the SDK does not compute one.
Reported zero is preserved. Availability varies by model and endpoint, and
cross-model token counts do not imply equivalent computation or cost.
Tentative early access: Choice, Score and Assess passed a live API-key
smoke test on October 9, 2026. Current source also passed live Azure CLI/Entra
checks for Microsoft-Decision-1 and gpt-6-luna on October 26, 2026, including
gpt-6-luna multi-question scoring and text/image input. These source checks do
not validate a newly published package.
This does not establish calibration or production readiness. The provider-neutral
IDecisionClient methods expose one text question per call; use DecideAsync
for image input or multi-question requests.
Complete sample | Configuration | Microsoft-Decision-1 | Repository
Azure OpenAI Decisions API
Available in 0.7.0: the APIs in this section are additive. Existing Microsoft-Decision-1 SystemOne callers keep their current configuration.
For gpt-6-luna, select the Azure OpenAI Decisions contract explicitly:
using var client = new FoundryDecisionClient(new FoundryDecisionOptions
{
Api = FoundryDecisionApi.OpenAIDecisions,
Endpoint = new Uri("https://<resource>.openai.azure.com"),
Model = "<gpt-6-luna-deployment>"
});
The provider appends /openai/v1/decisions to a resource root. The default
SystemOne mode remains for Microsoft-Decision-1. See
Microsoft's Decisions API documentation.
For text/image input and multiple questions in one request, use the additive
FoundryDecisionClient.DecideAsync API. It returns typed answers matched by
question name, including per-question refusals and optional token usage. The
provider-neutral IDecisionClient convenience methods remain text-only and
send one question per request. See the
complete Foundry sample.
For example, after creating the OpenAI client above:
FoundryDecisionResult result = await client.DecideAsync(
FoundryDecisionInput.FromText("The package arrived with a cracked screen."),
[
new FoundryPredicateQuestion("damage", "Does the input describe product damage?"),
new FoundryChoiceQuestion("team", "Which team should handle this?", [
new FoundryDecisionChoice("support", "Product support"),
new FoundryDecisionChoice("billing", "Payments and refunds")
])
]);
foreach (FoundryDecisionAnswer answer in result.Answers)
{
if (answer is FoundryRefusalAnswer)
Console.WriteLine($"{answer.Name}: refused, requires review");
else if (answer is FoundryPredicateAnswer predicate)
Console.WriteLine($"{predicate.Name}: {predicate.Probability:P1}");
else if (answer is FoundryChoiceAnswer choice)
Console.WriteLine($"{choice.Name}: {choice.Choice}");
}
if (result.Usage is { } usage)
Console.WriteLine($"Reported total tokens: {usage.TotalTokens}");
Use 1-400 uniquely named questions. Results are returned in request order.
Missing usage remains null. For images, use
FoundryDecisionInput.FromMessages with FoundryDecisionMessage.User and
FoundryDecisionContentPart.Text/Image. HTTPS image URLs must be publicly
accessible; supported image data URLs are also accepted. The service allows
up to 128 images and 32 MB combined image data. The SDK checks image count
and URL shape, not decoding or combined byte size.
The walkthrough includes az login, separate Decisions:Foundry and
Decisions:OpenAI settings, --openai, image input, and both offline modes.
| 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. |
-
net10.0
- Azure.Identity (>= 1.17.0)
- ElBruno.AI.Decisions (>= 0.8.0)
- Microsoft.Extensions.Http (>= 10.0.12)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Tentative early-access SDK 0.8.0. Live Jev compatibility is unverified. Evaluate before production use. See https://github.com/elbruno/ElBruno.AI.Decisions/releases.