Tharga.Team.Support.OpenAI 4.6.2

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

Tharga.Team.Support.OpenAI

Lets each team's support assistant answer through the team's own OpenAI key, or through an Ollama or llama.cpp server of the team's own, with the model chosen from what that provider offers.

All three speak the OpenAI-compatible API, so this package reaches them with the official OpenAI SDK through Microsoft.Extensions.AI.OpenAI. It is a package of its own so that a host which never lets teams bring their own AI does not acquire a vendor SDK.

Use

builder.Services.AddThargaSupportCases();
builder.Services.AddThargaSupportAiConnections();     // each team chooses: the platform's model, its own provider, or off
builder.Services.AddThargaSupportOpenAIProviders();   // adds OpenAI, Ollama and llama.cpp as providers a team can choose
builder.Services.AddThargaSupportAiProviders();       // optional, from Tharga.Team.Support.Anthropic: Neurolito and Anthropic

// Keys are stored encrypted with Data Protection. Keep the key ring where every instance reads it:
builder.Services.AddDataProtection()
    .SetApplicationName("MySite")
    .PersistKeysToThargaMongo();

Then put <SupportAssistantConnectionView /> on a page for team administrators, or map the endpoints with app.MapThargaSupportAiConnection(). Both need the assistant:manage team scope, which administrators hold by default.

What a team gets

  • OpenAI starts from https://api.openai.com/v1 and needs the team's key.
  • Ollama and llama.cpp start from no address: the team gives its server's, including the version path (https://ollama.example.com/v1, https://llama.example.com/v1). The key is optional and sent only if given.
  • Load models lists what the provider offers, from GET {address}/models. OpenAI lists every model the key may use, including some that do not chat; Test sends the chosen model one short message and shows the reply.
  • Save checks once more that the provider offers the model, then stores the key, if any, encrypted. It is never shown again; it can be replaced.

An address must be https, or http on the same machine as the site. A server elsewhere on the network needs https in front of it, such as a reverse proxy.

Options

builder.Services.AddThargaSupportOpenAIProviders(o =>
{
    o.OfferOpenAI = true;                               // false leaves OpenAI out
    o.OpenAIBaseAddress = "https://api.openai.com/v1";  // where an OpenAI connection starts; a team can change it
    o.OfferOllama = true;                               // false leaves Ollama out
    o.OllamaBaseAddress = null;                         // set it where every team shares one server you run
    o.OfferLlamaCpp = true;                             // false leaves llama.cpp out
    o.LlamaCppBaseAddress = null;
    o.MaxOutputTokens = 4096;                           // the ceiling for one answer
});

Full documentation: Support cases.

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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.6.2 50 10/29/2026