Mythosia.AI.Abstractions 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Mythosia.AI.Abstractions --version 1.0.0
                    
NuGet\Install-Package Mythosia.AI.Abstractions -Version 1.0.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="Mythosia.AI.Abstractions" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Mythosia.AI.Abstractions" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Mythosia.AI.Abstractions" />
                    
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 Mythosia.AI.Abstractions --version 1.0.0
                    
#r "nuget: Mythosia.AI.Abstractions, 1.0.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 Mythosia.AI.Abstractions@1.0.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=Mythosia.AI.Abstractions&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Mythosia.AI.Abstractions&version=1.0.0
                    
Install as a Cake Tool

Mythosia.AI.Abstractions

Core contracts and shared models for the Mythosia.AI ecosystem. Defines IAIService, all model types, and streaming primitives. Consumed by Mythosia.AI.Rag and any library that needs the AI service contract without pulling in heavy provider implementations.

Installation

dotnet add package Mythosia.AI.Abstractions

Install this package directly only when writing a library that depends on the AI service contract (e.g., RAG orchestration, custom middleware). Applications normally take a transitive dependency through Mythosia.AI.


Core Interface

IAIService

The central abstraction for AI completion and streaming.

public interface IAIService
{
    string Model { get; }
    string Provider { get; }
    string SystemMessage { get; set; }
    bool StatelessMode { get; set; }
    ChatBlock ActivateChat { get; }

    // Completion
    Task<string> GetCompletionAsync(string prompt);
    Task<string> GetCompletionAsync(Message message);
    Task<string> GetCompletionAsync(Message message, AIRequestContext context);
    // ... additional overloads with AIRequestProfile

    // Streaming
    IAsyncEnumerable<string> StreamAsync(string prompt, CancellationToken ct = default);
    IAsyncEnumerable<StreamingContent> StreamAsync(Message message, StreamOptions options, CancellationToken ct = default);
    // ... additional overloads
}

All concrete providers (ChatGptService, ClaudeService, GeminiService, etc.) in Mythosia.AI implement this interface.


Models

Type Description
Message A conversation message with role, content, and optional multimodal content
MessageContent Base class for multimodal content (TextContent, ImageContent, AudioContent)
ChatBlock Conversation container holding system message and message history
ActorRole Message role enum (System, User, Assistant, Function)
AIRequestContext Per-request context overrides (system message prefix/suffix, message override)
AIRequestProfile Per-request parameter overrides (temperature, max tokens, stateless mode)
AIModels Model identifier constants for all supported providers
AIProvider Provider enum (OpenAI, Anthropic, Google, xAI, DeepSeek, Perplexity)

Streaming

Type Description
StreamingContent Streaming chunk with content, type, metadata, and token usage
StreamingContentType Chunk type enum (Text, Reasoning, FunctionCall, FunctionResult, Status, Error, Completion)
StreamOptions Streaming behavior options (metadata, function calls, reasoning)
TokenUsage Token count data (input, output, cached, reasoning)

Functions

Type Description
FunctionDefinition Function schema for LLM function calling
FunctionCallingPolicy Controls function calling behavior and iteration limits
AiFunctionAttribute Marks a method as an AI-callable function
AiParameterAttribute Describes a function parameter for the AI

Exceptions

Type Description
AIServiceException Base exception for AI service errors
AgentMaxStepsExceededException Thrown when agent exceeds maximum iteration steps

Why This Package?

Mythosia.AI.Rag  →  Mythosia.AI.Abstractions  (zero heavy dependencies)
                     instead of
                     Mythosia.AI  (Azure.AI.OpenAI, NJsonSchema, TiktokenSharp, ...)

By depending on abstractions rather than the full implementation package, libraries like Mythosia.AI.Rag avoid pulling in provider-specific dependencies. The concrete provider is chosen by the final application.


Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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 Mythosia.AI.Abstractions:

Package Downloads
Mythosia.AI

## What's New in v6.0.0 ### API Consolidation (Breaking Change) GetCompletionAsync reduced from 8 overloads to 2 with optional parameters. StreamAsync reduced from 6 overloads to 4. Migration from v5.2 or earlier — service class renames (old names still compile as [Obsolete]): - ChatGptService → OpenAIService - ClaudeService → AnthropicService - GeminiService → GoogleAIService - GrokService → XAIService - SonarService → PerplexityService Migration from v5.x — API consolidation: - GetCompletionAsync(message, context) → GetCompletionAsync(message, context: context) - StreamAsync(message, options, ct) → StreamAsync(message, options, cancellationToken: ct) - Custom AIService subclasses overriding StreamAsync(Message, StreamOptions, CancellationToken) → rename to StreamCoreAsync (protected) Requires Mythosia.AI.Abstractions v2.0.0. --- ## What's New in v5.3.0 ### Service Class Renames - ChatGptService → OpenAIService, ClaudeService → AnthropicService, GeminiService → GoogleAIService, GrokService → XAIService, SonarService → PerplexityService - Previous names retained as [Obsolete] shims — no breaking changes ### IFunctionRegisterable - AIService now implements IFunctionRegisterable, enabling extension packages (e.g., Mythosia.AI.Rag) to register function tools without a direct dependency on this package ## Supported Models ### OpenAI - GPT-5, GPT-5 Mini, GPT-5 Nano, GPT-5 Chat Latest - GPT-5.1 - GPT-5.2, GPT-5.2 Pro, GPT-5.2 Codex - GPT-5.3 Codex - GPT-5.4, GPT-5.4 Mini, GPT-5.4 Nano, GPT-5.4 Pro - o3, o3-pro - GPT-4.1, GPT-4.1 Mini, GPT-4.1 Nano - GPT-4o, GPT-4o Mini, GPT-4 Vision ### Anthropic Claude - Claude Opus 4.6, Opus 4.5, Opus 4.1, Opus 4 - Claude Sonnet 4.6, Sonnet 4.5, Sonnet 4 - Claude Haiku 4.5 ### xAI Grok - Grok 4, Grok 4.1 Fast - Grok 3, Grok 3 Mini ### Google Gemini - Gemini 2.5 Pro, Flash, Flash-Lite - Gemini 3 Pro Preview, Flash Preview ### DeepSeek - DeepSeek Chat, DeepSeek Reasoner ### Perplexity - Sonar, Sonar Pro, Sonar Reasoning ## Documentation - Basic Usage: https://github.com/AJ-comp/Mythosia.AI/wiki - Advanced Features: https://github.com/AJ-comp/Mythosia.AI/wiki/Advanced-Features - Release Notes: https://github.com/AJ-comp/Mythosia.AI/wiki/Release-Notes - GitHub: https://github.com/AJ-comp/Mythosia.AI

Mythosia.AI.Rag

RAG (Retrieval Augmented Generation) orchestration for Mythosia.AI. Implements Mythosia.AI.Rag.Abstractions v5.x. Includes RagPipeline, text splitters, context builder, OpenAI/vLLM embedding providers, hybrid search (BM25 + Vector + RRF), re-ranking (Cohere, LLM, vLLM), search gate, keyword extraction, weighted-blend final selection, progress reporting, DoclingDocument-to-RagDocument conversion, and per-query VectorFilter passthrough (StoreFilter). Depends on Mythosia.AI.Abstractions (IAIService) instead of the full Mythosia.AI implementation.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.0 284 4/3/2026
1.1.0 187 4/2/2026
1.0.0 269 3/29/2026

v1.0.0: Initial release ? IAIService interface, shared models (Message, ChatBlock, StreamingContent, FunctionDefinition, etc.), extracted from Mythosia.AI for lightweight dependency.