Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/assets/docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ The MaIN CLI (`mcli`) is your companion tool for managing AI workflows and servi
> - Set execution policies
> - Create uninstaller

Download and unpack content from this link [Download](https://1drv.ms/u/c/8dd72529df58a475/EXWkWN8pJdcggI1tAAAAAAABD0eIFVX7HhjwDubuEr1T9w?e=QplVP8)
Download and unpack content from this link [Download](https://1drv.ms/u/c/8dd72529df58a475/EXWkWN8pJdcggI1tAAAAAAABD0eIFVX7HhjwDubuEr1T9w?e=m0daA8)

```bash
.\install-mcli.ps1
```

### (Linux/Mac)
Download and unpack content from this link [Download](https://1drv.ms/u/c/8dd72529df58a475/EXWkWN8pJdcggI1zAAAAAAABMMmdRp0OgzMEwBFB4Gftvg?e=V3slNN)
Download and unpack content from this link [Download](https://1drv.ms/u/c/8dd72529df58a475/EXWkWN8pJdcggI1zAAAAAAABMMmdRp0OgzMEwBFB4Gftvg?e=ilXsHh)
> - You might need some sudo permissions to set default model path or run api scripts

```bash
Expand Down
13 changes: 13 additions & 0 deletions src/assets/docs/docs-index.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,15 @@
"path": "examples/example-chat-files-gemini"
}
]
},
{
"title": "DeepSeek Integration",
"children": [
{
"title": "Chat with Reasoning",
"path": "examples/example-chat-reasoning-deepseek"
}
]
}
]
},
Expand Down Expand Up @@ -192,6 +201,10 @@
{
"title": "Gemini",
"path": "integrations/gemini"
},
{
"title": "DeepSeek",
"path": "integrations/deepseek"
}
]
}
Expand Down
30 changes: 30 additions & 0 deletions src/assets/docs/examples/example-chat-reasoning-deepseek.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# 💬 DeepSeek Chat with Reasoning Example

The **ChatWithReasoningDeepSeekExample** demonstrates an interactive chat session using the DeepSeek Reasoner model, focusing on eliciting thoughtful and reasoned responses from the AI.

```csharp
public async Task Start()
{
DeepSeekExample.Setup(); //We need to provide DeepSeek API key
Console.WriteLine("(DeepSeek) ChatExample with reasoning is running!");

await AIHub.Chat()
.WithModel("deepseek-reasoner") // a model that supports reasoning
.WithMessage("What chill pc game do you recommend?")
.CompleteAsync(interactive: true);
}
```

## 🔹 How It Works

1. **Set up DeepSeek API** → `DeepSeekExample.Setup()` (API key is required)
2. **Initialize a chat session** → `AIHub.Chat()`
3. **Choose a model** → `.WithModel("deepseek-reasoner")`
4. **Send a message** → `.WithMessage("What chill pc game do you recommend?")`
5. **Run the chat** → `.CompleteAsync(interactive: true);`

This example showcases how to leverage the DeepSeek Reasoner model to engage in a conversational exchange where the AI is prompted to provide recommendations based on reasoning, making it ideal for scenarios requiring more elaborate and thought-out responses.

## 💡 Basic Chat without Reasoning

If you don't require the advanced reasoning capabilities, you can simply select a DeepSeek model that isn't designed for reasoning ("`deepseek-chat`"). The integration process remains just as straightforward.
103 changes: 103 additions & 0 deletions src/assets/docs/integrations/deepseek.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# 🧠 DeepSeek Integration with MaIN Framework

This documentation provides a quick guide for integrating DeepSeek into your MaIN-based application. The integration process is simple and ensures that everything in the MaIN framework works seamlessly with DeepSeek as the backend, without requiring any additional modifications to existing functionality.

## 🚀 Quick Start

Integrating DeepSeek with MaIN requires minimal configuration. All you need to do is specify your DeepSeek API key and set the backend type to DeepSeek. Once this is done, you can use the full functionality of the MaIN framework, and everything will work as expected, without the need for further adjustments.

### 📝 Code Example

#### Using `appsettings.json`

To configure DeepSeek in your `appsettings.json`, add the following section:

```json
{
"MaIN": {
"BackendType": "DeepSeek",
"DeepSeekKey": "<YOUR_DEEPSEEK_KEY>"
}
}
```

#### Simple Console Initialization

Alternatively, you can set the backend type and DeepSeek key programmatically during initialization using `MaINBootstrapper.Initialize`:

```csharp
MaINBootstrapper.Initialize(configureSettings: (options) =>
{
options.BackendType = BackendType.DeepSeek;
options.DeepSeekKey = "<YOUR_DEEPSEEK_KEY>";
});
```

#### Using ServiceBuilder for API-based Use Cases

If you're setting up MaIN in an API or web-based application (e.g., ASP.NET Core), you can configure it using `ServiceBuilder`:

```csharp
services.AddMaIN(configuration, (options) =>
{
options.BackendType = BackendType.DeepSeek;
options.DeepSeekKey = "<YOUR_DEEPSEEK_KEY>";
});
```

### 📦 Using Environment Variables

If you prefer not to store your DeepSeek key in your `appsettings.json` or directly in the code, you can set it using an environment variable. This will automatically be detected by the MaIN framework.

For example, you can set the `DEEPSEEK_API_KEY` environment variable in different platforms:

- **On Windows (Command Prompt):**

```bash
set DEEPSEEK_API_KEY=<YOUR_DEEPSEEK_KEY>
```

- **On Windows (PowerShell):**

```bash
$env:DEEPSEEK_API_KEY="<YOUR_DEEPSEEK_KEY>"
```

- **On macOS/Linux:**

```bash
export DEEPSEEK_API_KEY=<YOUR_DEEPSEEK_KEY>
```

This way, you can securely store your API key in the environment without the need for hardcoding it.

---

## 🔹 What’s Included with DeepSeek Integration

Once you configure DeepSeek as the backend, **everything in the MaIN framework works the same way**. This includes all the core functionality such as chat, agents, and data retrieval tasks, which continue to operate without needing any special changes to the logic or structure.

- **No additional configuration is required** to use DeepSeek with any MaIN-based feature.
- Whether you're interacting with chat models, agents, or external data sources, the behavior remains consistent.
- The integration allows MaIN to work seamlessly with Gemini, enabling you to use the full power of the framework without worrying about backend-specific configurations.

---

## ⚠️ Important Considerations

When using DeepSeek models with the MaIN framework, please note these current limitations:

- Image Generation: DeepSeek models do not support direct image generation. Using features that rely on generating images will throw a `NotSupportedException`.
- Embeddings: DeepSeek models do not support generating embeddings (e.g., for file processing that requires text vectorization). Any MaIN functionality dependent on embeddings will result in a `NotSupportedException`.

Please ensure your application's design accounts for these limitations to prevent errors. If these functionalities are crucial for your application, you might want to consider using a different backend, such as OpenAI or Gemini.

---

## 🔧 Features

- **Simple Setup**: All you need to do is specify your DeepSeek key and set the backend type to DeepSeek, either via `appsettings.json`, environment variables, or programmatically.
- **Environment Variable Support**: Supports storing your DeepSeek key securely as an environment variable, making it easy to configure on different platforms.
- **Seamless Operation**: Once DeepSeek is configured, everything within the MaIN framework works identically with DeepSeek, with no need for adjustments or special handling for different tasks.

This integration ensures that your application remains flexible and easy to manage, allowing you to focus on using the features of MaIN while leveraging DeepSeek’s powerful capabilities.
Loading