![]() |
VOOZH | about |
dotnet add package Mythosia.AI.Abstractions --version 2.4.0
NuGet\Install-Package Mythosia.AI.Abstractions -Version 2.4.0
<PackageReference Include="Mythosia.AI.Abstractions" Version="2.4.0" />
<PackageVersion Include="Mythosia.AI.Abstractions" Version="2.4.0" />Directory.Packages.props
<PackageReference Include="Mythosia.AI.Abstractions" />Project file
paket add Mythosia.AI.Abstractions --version 2.4.0
#r "nuget: Mythosia.AI.Abstractions, 2.4.0"
#:package Mythosia.AI.Abstractions@2.4.0
#addin nuget:?package=Mythosia.AI.Abstractions&version=2.4.0Install as a Cake Addin
#tool nuget:?package=Mythosia.AI.Abstractions&version=2.4.0Install as a Cake Tool
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.
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.
IAIServiceThe 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 (OpenAIService, AnthropicService, GoogleAIService, etc.) in Mythosia.AI implement this interface.
| 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) |
| Type | Description |
|---|---|
StreamingContent |
Streaming chunk with content, type, metadata, token usage, and round information |
StreamingContentType |
Chunk type enum (Text, Reasoning, FunctionCall, FunctionResult, Status, Error, Completion, RoundUsage) |
StreamOptions |
Streaming behavior options (metadata, function calls, reasoning) |
TokenUsage |
Token count data (input, output, cached, reasoning) |
StreamDiagnostics |
SSE round observability snapshot — lines read, accumulated chars, last raw line, elapsed time |
StreamDiagnosticsBuilder |
Fluent configurator for service-level streaming diagnostics; consumed by Mythosia.AI's WithStreamDiagnostics(d => d.OnRawLine(...).OnComplete(...)) |
| 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 |
| Type | Description |
|---|---|
AIServiceException |
Base exception for AI service errors |
AgentMaxStepsExceededException |
Thrown when agent exceeds maximum iteration steps |
StreamReadException |
Thrown when an SSE read fails (transport error, premature stream end, etc.). Wraps the underlying exception in InnerException and attaches a StreamDiagnostics snapshot via the Diagnostics property |
Microsoft.Extensions.AI (IChatClient) and IAIService solve different problems at different layers.
IAIService (Mythosia.AI) |
IChatClient (MS.Extensions.AI) |
|
|---|---|---|
| State | Stateful — ChatBlock accumulates conversation history automatically |
Stateless — caller passes the full message list on every call |
| Session management | Multiple ChatBlock sessions per service instance, switchable at runtime |
None; caller manages message lists |
| System message | First-class property; supports per-request prefix/suffix injection via AIRequestContext |
Passed as a ChatMessage with Role = system |
| Request parameters | Strongly-typed AIRequestProfile (temperature, max tokens, stateless, disable functions) |
ChatOptions dictionary |
| Function calling | Automatic ReAct loop with configurable FunctionCallingPolicy (max rounds, timeout, concurrency) |
Single-round; caller implements the loop |
| Streaming chunks | Typed StreamingContent — Text, Reasoning, FunctionCall, FunctionResult, Completion, Error |
Text content updates only |
| Conversation summarization | Built-in SummaryConversationPolicy — auto-summarizes when token/message thresholds are exceeded |
Not provided |
| Multimodal | Message serializes to each provider's wire format automatically |
Caller constructs provider-specific content objects |
| Token usage | Tracks input, output, cached, cache-creation, and reasoning tokens | Input and output tokens only |
IAIService sits at a higher abstraction level than IChatClient. Implementing IChatClient on top of IAIService would discard stateful session management, typed streaming, and the function-calling loop. The two interfaces are not interchangeable.
If interoperability with the MS ecosystem is required, the recommended direction is to accept an IChatClient as a constructor dependency inside a Mythosia.AI provider — not to replace IAIService with IChatClient.
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 | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 netstandard2.1 is compatible. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 2 NuGet packages that depend on Mythosia.AI.Abstractions:
| Package | Downloads |
|---|---|
|
Mythosia.AI
## What's New in v6.6.0 ### New model - Anthropic: Claude Fable 5 (claude-fable-5) — Anthropic's new top model tier above Opus (1M context window, 128K max output). ### Fable 5 API contract handled automatically - Unsupported temperature is omitted; extended thinking uses adaptive mode (thinking.type=adaptive + output_config.effort); the thinking parameter is omitted entirely when disabled (Fable 5 rejects an explicit thinking.type=disabled). ### Fixed - Opus 4.7 / 4.8 max output tokens corrected to 128K (previously fell into the generic opus-4 32K bucket, which capped the thinking-budget max_tokens auto-adjustment). - QuickAskAsync / QuickAskWithImageAsync: provider routing now matches real lowercase model ids (previously every model except o3* threw ArgumentException), and the requested model is actually applied to the created service instead of the provider default. - Vision calls no longer silently swap claude-sonnet-4-x / claude-haiku-4-5 to Sonnet 4.6 (the vision-capability gate now recognizes all vision-capable model families). Requires Mythosia.AI.Abstractions v2.4.0. --- ## 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 v6.x. Includes RagPipeline, text splitters, context builder, OpenAI/vLLM embedding providers, hybrid search (BM25 + Vector + RRF), re-ranking (Cohere, LLM, vLLM), Agentic RAG tool registration with per-call RagQueryOptions and structured search traces, 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. |
This package is not used by any popular GitHub repositories.
v2.4.0: Adds the Anthropic Claude Fable 5 model id constant (AIModels.Anthropic.ClaudeFable5 = claude-fable-5) — Anthropic's new top model tier above Opus (1M context window, 128K max output). Additive minor release; no breaking changes.