Skip to content

Commit af22a64

Browse files
dxpythonEvelyn-Liux
andcommitted
Add co-author
Co-authored-by: Evelyn-Liux <[email protected]>
1 parent 8efaad7 commit af22a64

File tree

8 files changed

+151
-11
lines changed

8 files changed

+151
-11
lines changed

samples/AdvancedFeaturesDemo/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
Console.WriteLine("=".PadRight(50, '='));
1313

1414
// Using DeepSeek API
15-
var client = LLMClientFactory.CreateDeepSeek("YOUR_API_KEY");
15+
var client = LLMClientFactory.CreateDeepSeek("sk-e164311ef7914e46a5d760c505714b94");
1616

1717
// ============================================================
1818
// 1. Chain Module - LCEL Style Composition

samples/AgentDemo/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Console.WriteLine("=== SharpAIKit Agent Demo (DeepSeek) ===\n");
55

66
// Use DeepSeek API
7-
var client = LLMClientFactory.CreateDeepSeek("YOUR_API_KEY");
7+
var client = LLMClientFactory.CreateDeepSeek("sk-e164311ef7914e46a5d760c505714b94");
88

99
// Create AI Agent
1010
var agent = new AiAgent(client);

samples/ChatDemo/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Console.WriteLine("=== SharpAIKit DeepSeek Demo ===\n");
44

55
// Use DeepSeek API
6-
var client = LLMClientFactory.CreateDeepSeek("YOUR_API_KEY");
6+
var client = LLMClientFactory.CreateDeepSeek("sk-e164311ef7914e46a5d760c505714b94");
77

88
try
99
{

samples/KillerFeaturesDemo/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
Console.WriteLine("=".PadRight(60, '='));
99

1010
// Use DeepSeek API
11-
var client = LLMClientFactory.CreateDeepSeek("YOUR_API_KEY");
11+
var client = LLMClientFactory.CreateDeepSeek("sk-e164311ef7914e46a5d760c505714b94");
1212

1313
// ============================================================
1414
// 1. 🔮 Native C# Code Interpreter

samples/RAGDemo/Program.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Console.WriteLine("=== SharpAIKit RAG Demo (DeepSeek) ===\n");
55

66
// Use DeepSeek API
7-
var client = LLMClientFactory.CreateDeepSeek("YOUR_API_KEY");
7+
var client = LLMClientFactory.CreateDeepSeek("sk-e164311ef7914e46a5d760c505714b94");
88

99
// Create RAG Engine
1010
var rag = new RagEngine(client);
@@ -13,6 +13,7 @@
1313
{
1414
// Example 1: Index Content Directly
1515
Console.WriteLine("[Example 1: Index Content]");
16+
Console.WriteLine("Indexing content...");
1617

1718
var sampleContent = """
1819
Bone and Joint Infection Treatment Guidelines

src/SharpAIKit/README.md

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# SharpAIKit
2+
3+
A unified .NET large-model application and agentic AI development framework.
4+
5+
## Overview
6+
7+
SharpAIKit is a comprehensive AI/LLM toolkit for .NET that provides a unified interface for working with large language models, building AI agents, and implementing RAG (Retrieval-Augmented Generation) applications. It's designed to be more powerful and simpler than LangChain, with killer features that leverage the .NET ecosystem.
8+
9+
## Key Features
10+
11+
### Core Capabilities
12+
- **Unified LLM Interface** - One API for all OpenAI-compatible models
13+
- **LCEL-style Chains** - Elegant chain composition with pipe operators
14+
- **Multiple Memory Strategies** - Buffer, Window, Summary, Vector, and Entity memory
15+
- **Advanced Agents** - ReAct, Plan-and-Execute, and Multi-Agent systems
16+
- **RAG Engine** - Built-in document indexing and intelligent Q&A
17+
- **Full Observability** - Console, logging, metrics, and file tracing
18+
19+
### Killer Features Beyond LangChain
20+
- **🔮 Native C# Code Interpreter** - Execute C# code directly using Roslyn, no Python needed
21+
- **🕸️ SharpGraph** - Graph-based orchestration with FSM, supports loops and complex branches
22+
- **🧬 DSPy-style Optimizer** - Automatically optimize prompts through iterative improvement
23+
24+
## Installation
25+
26+
```bash
27+
dotnet add package SharpAIKit
28+
```
29+
30+
## Quick Start
31+
32+
```csharp
33+
using SharpAIKit.LLM;
34+
35+
// Create a client for any OpenAI-compatible API
36+
var client = LLMClientFactory.Create(
37+
apiKey: "your-api-key",
38+
baseUrl: "https://api.deepseek.com/v1",
39+
model: "deepseek-chat"
40+
);
41+
42+
// Simple chat
43+
var response = await client.ChatAsync("Hello!");
44+
Console.WriteLine(response);
45+
46+
// Streaming output
47+
await foreach (var chunk in client.ChatStreamAsync("Tell me a story"))
48+
{
49+
Console.Write(chunk);
50+
}
51+
```
52+
53+
## Supported LLM Providers
54+
55+
SharpAIKit supports all OpenAI-compatible APIs, including:
56+
57+
- OpenAI
58+
- DeepSeek
59+
- Qwen (Alibaba)
60+
- Mistral
61+
- Yi (01.AI)
62+
- Groq
63+
- Moonshot (Kimi)
64+
- Zhipu GLM
65+
- Ollama (Local)
66+
- Any custom OpenAI-compatible endpoint
67+
68+
## Example: Code Interpreter
69+
70+
```csharp
71+
using SharpAIKit.CodeInterpreter;
72+
73+
var interpreter = new RoslynCodeInterpreter();
74+
var result = await interpreter.ExecuteAsync<double>("Math.Pow(3, 5)");
75+
Console.WriteLine($"3^5 = {result}"); // Output: 243
76+
```
77+
78+
## Example: Graph Orchestration
79+
80+
```csharp
81+
using SharpAIKit.Graph;
82+
83+
var graph = new SharpGraphBuilder("start")
84+
.Node("start", async state => {
85+
state.NextNode = "process";
86+
return state;
87+
})
88+
.Node("process", async state => {
89+
state.Output = "Done";
90+
state.ShouldEnd = true;
91+
return state;
92+
})
93+
.Build();
94+
95+
var result = await graph.ExecuteAsync();
96+
```
97+
98+
## Example: Prompt Optimization
99+
100+
```csharp
101+
using SharpAIKit.Optimizer;
102+
103+
var optimizer = new DSPyOptimizer(client)
104+
.AddExample("What is C#?", "C# is an object-oriented programming language...")
105+
.SetMetric(Metrics.Contains);
106+
107+
var result = await optimizer.OptimizeAsync("Answer: {input}");
108+
Console.WriteLine(result.OptimizedPrompt);
109+
```
110+
111+
## Documentation
112+
113+
For detailed documentation and examples, visit:
114+
- [GitHub Repository](https://github.com/dxpython/SharpAIKit)
115+
- [English Documentation](https://github.com/dxpython/SharpAIKit/blob/main/README_EN.md)
116+
- [中文文档](https://github.com/dxpython/SharpAIKit/blob/main/README_CN.md)
117+
118+
## License
119+
120+
This project is licensed under the MIT License - see the [LICENSE](https://github.com/dxpython/SharpAIKit/blob/main/LICENSE) file for details.
121+

src/SharpAIKit/SharpAIKit.csproj

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,28 @@
44
<TargetFramework>net8.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
7+
8+
<!-- NuGet Package Metadata -->
79
<PackageId>SharpAIKit</PackageId>
8-
<Version>1.0.0</Version>
9-
<Authors>SharpAIKit Contributors</Authors>
10-
<Description>A unified AI/LLM toolkit supporting OpenAI, Ollama, LM Studio with built-in RAG engine and AI Agent</Description>
11-
<PackageTags>AI;LLM;OpenAI;Ollama;RAG;Agent;ChatGPT</PackageTags>
12-
<RepositoryUrl>https://github.com/yourusername/SharpAIKit</RepositoryUrl>
10+
<Version>0.1.0</Version>
11+
<Authors>Dustin Dong</Authors>
12+
<Company>SharpAIKit</Company>
1313
<PackageLicenseExpression>MIT</PackageLicenseExpression>
14+
<PackageProjectUrl>https://github.com/dxpython/SharpAIKit</PackageProjectUrl>
15+
<RepositoryUrl>https://github.com/dxpython/SharpAIKit.git</RepositoryUrl>
16+
<RepositoryType>git</RepositoryType>
17+
<Description>A unified .NET large-model application and agentic AI development framework.</Description>
18+
<PackageReadmeFile>README.md</PackageReadmeFile>
19+
<PackageTags>AI;LLM;Agent;RAG;DSPy;.NET</PackageTags>
20+
21+
<!-- Package Generation Settings -->
22+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
23+
<IncludeSymbols>true</IncludeSymbols>
24+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
25+
26+
<!-- Documentation -->
1427
<GenerateDocumentationFile>true</GenerateDocumentationFile>
28+
<NoWarn>$(NoWarn);1591</NoWarn>
1529
</PropertyGroup>
1630

1731
<ItemGroup>
@@ -24,5 +38,8 @@
2438
<PackageReference Include="Microsoft.CodeAnalysis.Scripting" Version="4.8.0" />
2539
</ItemGroup>
2640

27-
</Project>
41+
<ItemGroup>
42+
<None Include="README.md" Pack="true" PackagePath="\" />
43+
</ItemGroup>
2844

45+
</Project>

tests/SharpAIKit.Tests/Agent/CalculatorToolTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public void Calculate_InvalidExpression_ReturnsError()
3838

3939
// Assert
4040
Assert.Contains("error", result.ToLower());
41+
4142
}
4243

4344
[Fact]

0 commit comments

Comments
 (0)