🌐 English · 한국어 · 日本語 · Français · Deutsch · Русский · Українська · 简体中文 · 繁體中文 · Tiếng Việt · ภาษาไทย · Português · Español
Cambia de provider, conecta RAG, carga documentos — todo a través de una API unificada.
📖 Primeros pasos · Referencia de API · GitHub ↗
dotnet add package Mythosia.AI # empieza aquí (solo con este es suficiente)
dotnet add package Mythosia.AI.Rag # opcional: cuando necesites RAG
dotnet add package Mythosia.VectorDb.Postgres # opcional: vector store para producción
| Paso | Paquete | Cuándo |
|---|---|---|
| 1 | Mythosia.AI |
Empieza aquí — generación de texto, streaming, function calling, structured output (OpenAI / Claude / Gemini / Grok / DeepSeek / Perplexity) |
| 2 | Mythosia.AI.Rag |
Cuando necesites RAG — chunking, embedding, hybrid search, reranking, InMemory store, document loaders (Word / Excel / PowerPoint / PDF) |
| 3 | Mythosia.VectorDb.Postgres / Qdrant / Pinecone |
Cuando necesites un vector store de producción en lugar de InMemory — elige uno |
graph TD
subgraph "🔗 Orchestration Layer"
Rag["<b>Mythosia.AI.Rag</b><br/>RagPipeline · TextSplitters<br/>EmbeddingProviders · HybridSearch · Reranking<br/><i>netstandard2.1 · v7.5.0</i>"]
end
subgraph "⚡ Core AI"
AI["<b>Mythosia.AI</b><br/>OpenAI · Anthropic · Google<br/>xAI · DeepSeek · Perplexity<br/><i>netstandard2.1 · v6.5.0</i>"]
AIAbs["<b>Mythosia.AI.Abstractions</b><br/>IAIService · shared models<br/><i>netstandard2.1 · v2.3.0</i>"]
end
subgraph "🔌 Provider Packages"
Alibaba["<b>Mythosia.AI.Providers.Alibaba</b><br/>Qwen / Alibaba provider package<br/><i>netstandard2.1 · v1.2.6</i>"]
end
subgraph "📄 Document Loaders"
Office["<b>Mythosia.Documents.Office</b><br/>Word · Excel · PowerPoint<br/><i>netstandard2.1 · v1.1.0</i>"]
Pdf["<b>Mythosia.Documents.Pdf</b><br/>PdfPig Parser<br/><i>netstandard2.1 · v1.1.1</i>"]
end
subgraph "📐 Composite Abstractions"
RagAbs["<b>Mythosia.AI.Rag.Abstractions</b><br/>ITextSplitter · IEmbeddingProvider<br/>IContextBuilder · IRetrievalStrategy · IReranker<br/>RagDocument<br/><i>netstandard2.1 · v6.2.0</i>"]
end
subgraph "🗄️ Vector Stores — elige uno o más"
InMem["<b>Mythosia.VectorDb.InMemory</b><br/>Cosine Similarity · TopK · BM25<br/><i>netstandard2.1 · v4.1.0</i>"]
Pine["<b>Mythosia.VectorDb.Pinecone</b><br/>Managed Index · Namespace · Scope<br/><i>netstandard2.1 · v4.0.1</i>"]
Pg["<b>Mythosia.VectorDb.Postgres</b><br/>pgvector · HNSW · IVFFlat · HybridSearch<br/><i>net10.0 · v10.7.1</i>"]
Qd["<b>Mythosia.VectorDb.Qdrant</b><br/>gRPC · Cosine · Euclidean · Dot · HybridSearch<br/><i>netstandard2.1 · v4.1.1</i>"]
end
subgraph "🧱 Foundation Abstractions"
LoaderAbs["<b>Mythosia.Documents.Abstractions</b><br/>IDocumentLoader · IDocumentParser<br/>ParsedDocument · DoclingDocument<br/><i>netstandard2.1 · v1.2.0</i>"]
VdbAbs["<b>Mythosia.VectorDb.Abstractions</b><br/>IVectorStore · HybridSearchAsync · VectorRecord<br/>VectorFilter · VectorSearchResult · Bm25Tokenizer<br/><i>netstandard2.1 · v4.0.1</i>"]
end
AI --> AIAbs
Rag --> AIAbs
Rag --> Office
Rag --> Pdf
Rag --> RagAbs
Rag --> InMem
Alibaba --> AI
RagAbs --> VdbAbs
Office --> LoaderAbs
Pdf --> LoaderAbs
InMem --> VdbAbs
Pine --> VdbAbs
Pg --> VdbAbs
Qd --> VdbAbs
Este repositorio incluye un ejemplo de Chat UI construido con Mythosia.AI — ejecuta Mythosia.AI.Samples.ChatUi para probar la biblioteca directamente.
Inicia Mythosia.AI.Samples.ChatUi en tu máquina:
# desde el directorio raíz del repositorio
dotnet run --project samples/Mythosia.AI.Samples.ChatUi2026-02-27.18-21-02.mp4
using Mythosia.AI;
var service = new OpenAIService(apiKey, httpClient);
var response = await service.GetCompletionAsync("¡Hola!");await foreach (var token in service.StreamAsync("Cuéntame una historia"))
{
Console.Write(token);
}Todos los providers con soporte de razonamiento (OpenAI, Claude, Gemini, Grok, DeepSeek) usan el mismo patrón:
await foreach (var content in service.StreamAsync(message, new StreamOptions().WithReasoning()))
{
if (content.Type == StreamingContentType.Reasoning)
Console.Write($"[Razonamiento] {content.Content}");
else if (content.Type == StreamingContentType.Text)
Console.Write(content.Content);
}var service = new OpenAIService(apiKey, httpClient)
.WithFunction(
"get_weather",
"Obtener información meteorológica actual para una ubicación",
("location", "Nombre de la ciudad y el país", required: true),
(string location) => $"El clima en {location} está soleado, 28°C"
);
var response = await service.GetCompletionAsync("¿Cómo está el tiempo en Madrid?");// Deserializa la respuesta del LLM directamente a un POCO C# con auto-recuperación
var result = await service.GetCompletionAsync<WeatherResponse>(
"¿Cómo está el tiempo en Madrid?");// Las colecciones funcionan directamente — sin wrapper necesario
var items = await service.GetCompletionAsync<List<ItemDto>>(
"Extrae todas las entidades de este documento...");// Transmite cada fragmento de texto en tiempo real + recibe el objeto deserializado al final
var run = service.BeginStream(prompt).As<MyDto>();
await foreach (var chunk in run.Stream())
Console.Write(chunk); // interfaz en tiempo real
MyDto dto = await run.Result; // parseado y auto-recuperado// Resume automáticamente mensajes anteriores cuando la conversación se hace larga
service.ConversationPolicy = SummaryConversationPolicy.ByMessage(
triggerCount: 20,
keepRecentCount: 5
);
// Disparar por conteo de tokens
service.ConversationPolicy = SummaryConversationPolicy.ByToken(
triggerTokens: 3000,
keepRecentTokens: 1000
);
// Usa normalmente — el resumen ocurre automáticamente
await service.GetCompletionAsync("Continúa la conversación...");
// En streaming, aplica la política de resumen antes de StreamAsync()
await service.ApplySummaryPolicyIfNeededAsync();
await foreach (var chunk in service.StreamAsync("Continúa..."))
Console.Write(chunk.Content);
// Guardar/restaurar el resumen entre sesiones
string saved = service.ConversationPolicy.CurrentSummary;
policy.LoadSummary(saved);dotnet add package Mythosia.AI.Ragusing Mythosia.AI.Rag;
var service = new AnthropicService(apiKey, httpClient)
.WithRag(rag => rag
.AddDocument("manual.txt")
.AddDocument("policy.txt")
);
var response = await service.GetCompletionAsync("¿Cuál es la política de reembolso?");| Provider | Paquete | Modelos |
|---|---|---|
| OpenAI | Mythosia.AI |
GPT-5.5 / 5.5 Pro / 5.4 / 5.4 Mini / 5.4 Nano / 5.4 Pro / 5.3 Codex / 5.2 / 5.2 Pro / 5.2 Codex / 5.1 / 5 / 5 Pro / 5 Mini / 5 Nano, GPT-4.1 / 4.1 Mini / 4.1 Nano, GPT-4o / 4o Mini, o3 / o3 Pro |
| Anthropic | Mythosia.AI |
Claude Fable 5, Opus 4.8 / 4.7 / 4.6 / 4.5 / 4.1 / 4, Sonnet 4.6 / 4.5, Haiku 4.5 |
Mythosia.AI |
Gemini 3.1 Pro Preview, Gemini 3.5 Flash, Gemini 3 Flash Preview, Gemini 3.1 Flash-Lite, Gemini 2.5 Pro/Flash/Flash-Lite | |
| xAI | Mythosia.AI |
Grok 4.3, Grok 4.20 (reasoning / non-reasoning), Grok Build 0.1, Grok 3 Mini |
| DeepSeek | Mythosia.AI |
Chat, Reasoner |
| Perplexity | Mythosia.AI |
Sonar, Sonar Pro, Sonar Reasoning Pro |
| Alibaba / Qwen | Mythosia.AI.Providers.Alibaba |
Qwen Max / Plus / Turbo / Qwen3 / Qwen3.5 variants |
| Paquete | NuGet | Descripción |
|---|---|---|
| Mythosia.AI | Biblioteca core — providers integrados, streaming, function calling y soporte multimodal | |
| Mythosia.AI.Abstractions | Interfaz IAIService y modelos compartilhados — paquete de contrato ligero para bibliotecas |
|
| Mythosia.AI.Providers.Alibaba | Paquete provider Alibaba / Qwen basado en Mythosia.AI |
| Paquete | NuGet | Descripción |
|---|---|---|
| Mythosia.AI.Rag | Extensión RAG fluente para IAIService con API .WithRag() |
|
| Mythosia.AI.Rag.Abstractions | Interfaces y modelos de los componentes del pipeline RAG |
| Paquete | NuGet | Descripción |
|---|---|---|
| Mythosia.Documents.Abstractions | Interfaces y modelos del loader de documentos (IDocumentLoader, DoclingDocument) |
|
| Mythosia.Documents.Office | Parser OpenXml para Word / Excel / PowerPoint | |
| Mythosia.Documents.Pdf | Parser PDF basado en PdfPig |
Elige uno o más — todos implementan
IVectorStoredel paquete Abstractions.
| Paquete | NuGet | Descripción |
|---|---|---|
| Mythosia.VectorDb.Abstractions | Contrato IVectorStore · VectorRecord · VectorFilter |
|
| Mythosia.VectorDb.InMemory | Store en memoria — sin infraestructura, ideal para prototipado | |
| Mythosia.VectorDb.Pinecone | Pinecone HTTP API — aislamiento por index/namespace/scope | |
| Mythosia.VectorDb.Postgres | PostgreSQL + pgvector — índices HNSW / IVFFlat, listo para producción | |
| Mythosia.VectorDb.Qdrant | Qdrant gRPC client — Cosine / Euclidean / Dot, aprovisionamiento automático |
src/
core/
Mythosia.AI/ # Biblioteca AI core
Mythosia.AI.Abstractions/ # Interfaz IAIService y modelos compartilhados
Mythosia.AI.Providers.Alibaba/ # Paquete provider Alibaba / Qwen
loaders/
Mythosia.Documents.Abstractions/ # Contrato document loader (IDocumentLoader, DoclingDocument)
Mythosia.Documents.Office/ # Loader de documentos Office (Word/Excel/PowerPoint)
Mythosia.Documents.Pdf/ # Loader de documentos PDF
rag/
Mythosia.AI.Rag/ # RAG Fluent API y pipeline
Mythosia.AI.Rag.Abstractions/ # Interfaces y modelos RAG (RagDocument)
vectordb/
Mythosia.VectorDb.Abstractions/ # Contrato vector store
Mythosia.VectorDb.InMemory/ # Vector store en memoria
Mythosia.VectorDb.Pinecone/ # Vector store Pinecone
Mythosia.VectorDb.Postgres/ # PostgreSQL + pgvector
Mythosia.VectorDb.Qdrant/ # Vector store Qdrant
samples/ # Aplicaciones de ejemplo
tests/ # Proyectos de test unitario / integración
dotnet add package Mythosia.AIPara operaciones LINQ avanzadas con streams:
dotnet add package System.Linq.Async- Guía de introducción
- README Mythosia.AI — Referencia completa de API: function calling, streaming y configuración de modelos
- README Mythosia.AI.Rag — Uso del pipeline RAG e implementaciones personalizadas
- Guía de loaders
- Notas de versión
Este proyecto se distribuye bajo la licencia MIT.
Este proyecto era originalmente parte de Mythosia.