{"id":46014570,"url":"https://github.com/aj-comp/mythosia.ai","last_synced_at":"2026-03-03T03:00:43.396Z","repository":{"id":340473426,"uuid":"1166203891","full_name":"AJ-comp/Mythosia.AI","owner":"AJ-comp","description":"Unified .NET AI library with multi-provider support (OpenAI, Anthropic, Google, DeepSeek, Perplexity) and RAG extensions","archived":false,"fork":false,"pushed_at":"2026-03-02T02:28:19.000Z","size":5829,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-02T02:41:50.276Z","etag":null,"topics":["ai","anthropic","chatgpt","claude","deepseek","dotnet","gemini","google","grok","llm","multi-provider","openai","xai"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AJ-comp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-25T01:26:23.000Z","updated_at":"2026-03-02T02:28:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"cc553db9-2c64-47c8-93d9-2b909bd311e2","html_url":"https://github.com/AJ-comp/Mythosia.AI","commit_stats":null,"previous_names":["aj-comp/mythosia.ai"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AJ-comp/Mythosia.AI","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AJ-comp%2FMythosia.AI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AJ-comp%2FMythosia.AI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AJ-comp%2FMythosia.AI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AJ-comp%2FMythosia.AI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AJ-comp","download_url":"https://codeload.github.com/AJ-comp/Mythosia.AI/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AJ-comp%2FMythosia.AI/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30030837,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T00:31:48.536Z","status":"online","status_checked_at":"2026-03-03T02:00:07.650Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","anthropic","chatgpt","claude","deepseek","dotnet","gemini","google","grok","llm","multi-provider","openai","xai"],"created_at":"2026-03-01T01:03:21.145Z","updated_at":"2026-03-03T03:00:43.357Z","avatar_url":"https://github.com/AJ-comp.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿# Mythosia.AI\n\n[![NuGet](https://img.shields.io/nuget/v/Mythosia.AI.svg)](https://www.nuget.org/packages/Mythosia.AI)\n[![NuGet Downloads](https://img.shields.io/nuget/dt/Mythosia.AI.svg)](https://www.nuget.org/packages/Mythosia.AI)\n\nUnified .NET AI library with multi-provider support (OpenAI, Anthropic, Google, DeepSeek, Perplexity, xAI) and RAG extensions.\n\n## Supported Providers\n\n| Provider | Models |\n| --- | --- |\n| **OpenAI** | GPT-5.2 / 5.2 Codex / 5.1 / 5, GPT-4.1, GPT-4o, o3 |\n| **Anthropic** | Claude Opus 4.6 / 4.5 / 4.1 / 4, Sonnet 4.6 / 4.5 / 4, Haiku 4.5 |\n| **Google** | Gemini 3 Flash/Pro Preview, Gemini 2.5 Pro/Flash/Flash-Lite |\n| **xAI** | Grok 4, Grok 4.1 Fast, Grok 3, Grok 3 Mini |\n| **DeepSeek** | Chat, Reasoner |\n| **Perplexity** | Sonar, Sonar Pro, Sonar Reasoning |\n\n## Packages\n\n| Package | NuGet | Description |\n| --- | --- | --- |\n| [Mythosia.AI](Mythosia.AI/) | [![NuGet](https://img.shields.io/nuget/v/Mythosia.AI.svg)](https://www.nuget.org/packages/Mythosia.AI) | Core library — multi-provider AI service with streaming, function calling, and multimodal support |\n| [Mythosia.AI.Rag](Mythosia.AI.Rag/) |  | Fluent RAG extension for AIService with `.WithRag()` API |\n| [Mythosia.AI.Rag.Abstractions](Mythosia.AI.Rag.Abstractions/) |  | Interfaces and models for RAG pipeline components |\n| [Mythosia.AI.VectorDB](Mythosia.AI.VectorDB/) |  | In-memory vector store with cosine similarity search |\n| [Mythosia.AI.Loaders.Abstractions](Mythosia.AI.Loaders.Abstractions/) |  | Document loader interfaces and models |\n\n## Demo / Test Bed (Chat UI)\n\nThis repository includes a sample Chat UI built on Mythosia.AI — launch Mythosia.AI.Samples.ChatUi to test the library in action.\n\n### Run the sample\n\nRun **`Mythosia.AI.Samples.ChatUi`** to try it locally:\n\n```bash\n# from repo root\ndotnet run --project Mythosia.AI.Samples.ChatUi\n```\n\nhttps://github.com/user-attachments/assets/62094afe-9add-4c14-b818-6b31f200dc01\n\n\n## Quick Start\n\n### Basic AI Completion\n\n```csharp\nusing Mythosia.AI;\n\nvar service = new ChatGptService(apiKey, httpClient);\nvar response = await service.GetCompletionAsync(\"Hello!\");\n```\n\n### Streaming\n\n```csharp\nawait foreach (var token in service.StreamAsync(\"Tell me a story\"))\n{\n    Console.Write(token);\n}\n```\n\n### Reasoning Streaming\n\nAll reasoning-capable providers (OpenAI, Claude, Gemini, Grok, DeepSeek) share the same streaming pattern:\n\n```csharp\nawait foreach (var content in service.StreamAsync(message, new StreamOptions().WithReasoning()))\n{\n    if (content.Type == StreamingContentType.Reasoning)\n        Console.Write($\"[Think] {content.Content}\");\n    else if (content.Type == StreamingContentType.Text)\n        Console.Write(content.Content);\n}\n```\n\n### Function Calling\n\n```csharp\nvar service = new ChatGptService(apiKey, httpClient)\n    .WithFunction(\n        \"get_weather\",\n        \"Gets the current weather for a location\",\n        (\"location\", \"The city and country\", required: true),\n        (string location) =\u003e $\"The weather in {location} is sunny, 22C\"\n    );\n\nvar response = await service.GetCompletionAsync(\"What's the weather in Seoul?\");\n```\n\n### Structured Output (Basic)\n\n```csharp\n// Deserialize LLM responses directly into C# POCOs with auto-recovery\nvar result = await service.GetCompletionAsync\u003cWeatherResponse\u003e(\n    \"What's the weather in Seoul?\");\n```\n\n### Structured Output (List)\n\n```csharp\n// Collection types work directly — no wrapper DTO needed\nvar items = await service.GetCompletionAsync\u003cList\u003cItemDto\u003e\u003e(\n    \"Extract all entities from this document...\");\n```\n\n### Structured Output (Streaming)\n\n```csharp\n// Stream text chunks in real-time + get final deserialized object\nvar run = service.BeginStream(prompt).As\u003cMyDto\u003e();\n\nawait foreach (var chunk in run.Stream())\n    Console.Write(chunk);          // real-time UI\n\nMyDto dto = await run.Result;      // parsed \u0026 auto-repaired\n```\n\n### Conversation Summary Policy\n\n```csharp\n// Automatically summarize old messages when conversation gets long\nservice.ConversationPolicy = SummaryConversationPolicy.ByMessage(\n    triggerCount: 20,\n    keepRecentCount: 5\n);\n\n// Token-based trigger\nservice.ConversationPolicy = SummaryConversationPolicy.ByToken(\n    triggerTokens: 3000,\n    keepRecentTokens: 1000\n);\n\n// Just use as normal — summarization happens automatically\nawait service.GetCompletionAsync(\"Continue our conversation...\");\n\n// For streaming, call summarization explicitly before StreamAsync()\nawait service.ApplySummaryPolicyIfNeededAsync();\nawait foreach (var chunk in service.StreamAsync(\"Continue...\"))\n    Console.Write(chunk.Content);\n\n// Save/restore summary across sessions\nstring saved = service.ConversationPolicy.CurrentSummary;\npolicy.LoadSummary(saved);\n```\n\n### RAG (Retrieval-Augmented Generation)\n\n```bash\ndotnet add package Mythosia.AI.Rag\n```\n\n```csharp\nusing Mythosia.AI.Rag;\n\nvar service = new ClaudeService(apiKey, httpClient)\n    .WithRag(rag =\u003e rag\n        .AddDocument(\"manual.txt\")\n        .AddDocument(\"policy.txt\")\n    );\n\nvar response = await service.GetCompletionAsync(\"What is the refund policy?\");\n```\n\n## Repository Structure\n\n```text\nMythosia.AI/                          # Core AI service library\nMythosia.AI.Rag/                      # RAG fluent API and pipeline\nMythosia.AI.Rag.Abstractions/         # RAG interfaces and models\nMythosia.AI.VectorDB/                 # In-memory vector store\nMythosia.AI.Loaders.Abstractions/     # Document loader contracts\ntests/\n  Mythosia.AI.Test/                   # Core AI service tests\n  Mythosia.AI.Rag.Tests/             # RAG pipeline tests\n```\n\n## Installation\n\n```bash\ndotnet add package Mythosia.AI\n```\n\nFor advanced LINQ operations with streams:\n\n```bash\ndotnet add package System.Linq.Async\n```\n\n## Documentation\n\n- [Basic Usage Guide](https://github.com/AJ-comp/Mythosia.AI/wiki)\n- [Mythosia.AI README](Mythosia.AI/README.md)  Full API reference with function calling, streaming, and model configuration\n- [Mythosia.AI.Rag README](Mythosia.AI.Rag/README.md)  RAG pipeline usage and custom implementations\n- Loaders Guide: [EN](Mythosia.AI.Loaders.Abstractions/docs/en/loaders.md) · [KO](Mythosia.AI.Loaders.Abstractions/docs/ko/loaders.md) · [JA](Mythosia.AI.Loaders.Abstractions/docs/ja/loaders.md) · [ZH](Mythosia.AI.Loaders.Abstractions/docs/zh/loaders.md)\n- [Release Notes](Mythosia.AI/RELEASE_NOTES.md)\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n\n## Originally\n\nThis project was originally part of [Mythosia](https://github.com/AJ-comp/Mythosia).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faj-comp%2Fmythosia.ai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faj-comp%2Fmythosia.ai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faj-comp%2Fmythosia.ai/lists"}