From 719e123cab201fc56b2eb95b6b7effe0a22ba0ed Mon Sep 17 00:00:00 2001 From: Magdalena Majta Date: Fri, 1 Aug 2025 14:58:44 +0200 Subject: [PATCH 1/2] Add GroqCloud integration documentation --- src/assets/docs/docs-index.json | 13 +++ .../examples/example-chat-basic-gemini.md | 2 +- .../examples/example-chat-basic-groqcloud.md | 27 +++++ src/assets/docs/integrations/deepseek.md | 2 +- src/assets/docs/integrations/groqcloud.md | 103 ++++++++++++++++++ 5 files changed, 145 insertions(+), 2 deletions(-) create mode 100644 src/assets/docs/examples/example-chat-basic-groqcloud.md create mode 100644 src/assets/docs/integrations/groqcloud.md diff --git a/src/assets/docs/docs-index.json b/src/assets/docs/docs-index.json index 76f12ef..286a9e2 100644 --- a/src/assets/docs/docs-index.json +++ b/src/assets/docs/docs-index.json @@ -154,6 +154,15 @@ "path": "examples/example-chat-reasoning-deepseek" } ] + }, + { + "title": "GroqCloud Integration", + "children": [ + { + "title": "Basic chat", + "path": "examples/example-chat-basic-groqcloud" + } + ] } ] }, @@ -205,6 +214,10 @@ { "title": "DeepSeek", "path": "integrations/deepseek" + }, + { + "title": "GroqCloud", + "path": "integrations/groqcloud" } ] } diff --git a/src/assets/docs/examples/example-chat-basic-gemini.md b/src/assets/docs/examples/example-chat-basic-gemini.md index 0700682..a563d5a 100644 --- a/src/assets/docs/examples/example-chat-basic-gemini.md +++ b/src/assets/docs/examples/example-chat-basic-gemini.md @@ -25,4 +25,4 @@ public async Task Start() 4. **Send a message** β†’ `.WithMessage("Is the killer whale the smartest animal?")` 5. **Run the chat** β†’ `.CompleteAsync(interactive: true);` -This example demonstrates how effortlessly Gemini's Gemini's 2.0-flash model can be integrated into the framework, enabling seamless interactions with just a few lines of code. The simplicity of setup and ease of use makes it ideal for developers looking to integrate powerful AI capabilities with minimal configuration. \ No newline at end of file +This example demonstrates how effortlessly Gemini's 2.0-flash model can be integrated into the framework, enabling seamless interactions with just a few lines of code. The simplicity of setup and ease of use makes it ideal for developers looking to integrate powerful AI capabilities with minimal configuration. \ No newline at end of file diff --git a/src/assets/docs/examples/example-chat-basic-groqcloud.md b/src/assets/docs/examples/example-chat-basic-groqcloud.md new file mode 100644 index 0000000..849c665 --- /dev/null +++ b/src/assets/docs/examples/example-chat-basic-groqcloud.md @@ -0,0 +1,27 @@ +# πŸ’¬ GroqCloud Chat Example + +The **GroqCloudChatExample** demonstrates how to integrate GroqCloud's LLaMA 3 model into the framework with minimal setup, showcasing its performance and simplicity for interactive chat. + +### πŸ“ Code Example + +```csharp +public async Task Start() +{ + GroqCloudExample.Setup(); //We need to provide GroqCloud API key + Console.WriteLine("(GroqCloud) ChatExample is running!"); + + await AIHub.Chat() + .WithModel("llama3-8b-8192") + .WithMessage("Which color do people like the most?") + .CompleteAsync(interactive: true); +} +``` + +## πŸ”Ή How It Works +1. **Set up GroqCloud API** β†’ `GroqCloudExample.Setup()` (API key is required) +2. **Initialize a chat session** β†’ `AIHub.Chat()` +3. **Choose a model** β†’ `.WithModel("llama3-8b-8192")` +4. **Send a message** β†’ `.WithMessage("Which color do people like the most?")` +5. **Run the chat** β†’ `.CompleteAsync(interactive: true);` + +This example demonstrates how effortlessly GroqCloud's LLAMA 3 model can be integrated into the framework, enabling seamless interactions with just a few lines of code. The simplicity of setup and ease of use makes it ideal for developers looking to integrate powerful AI capabilities with minimal configuration. \ No newline at end of file diff --git a/src/assets/docs/integrations/deepseek.md b/src/assets/docs/integrations/deepseek.md index 31bbad3..652aaf0 100644 --- a/src/assets/docs/integrations/deepseek.md +++ b/src/assets/docs/integrations/deepseek.md @@ -79,7 +79,7 @@ Once you configure DeepSeek as the backend, **everything in the MaIN framework w - **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. +- The integration allows MaIN to work seamlessly with DeepSeek, enabling you to use the full power of the framework without worrying about backend-specific configurations. --- diff --git a/src/assets/docs/integrations/groqcloud.md b/src/assets/docs/integrations/groqcloud.md new file mode 100644 index 0000000..e582ed0 --- /dev/null +++ b/src/assets/docs/integrations/groqcloud.md @@ -0,0 +1,103 @@ +# 🧠 GroqCloud Integration with MaIN Framework + +This documentation provides a quick guide for integrating GroqCloud into your MaIN-based application. The integration process is simple and ensures that everything in the MaIN framework works seamlessly with GroqCloud as the backend, without requiring any additional modifications to existing functionality. + +## πŸš€ Quick Start + +Integrating GroqCloud with MaIN requires minimal configuration. All you need to do is specify your GroqCloud API key and set the backend type to GroqCloud. 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 GroqCloud in your `appsettings.json`, add the following section: + +```json +{ + "MaIN": { + "BackendType": "GroqCloud", + "GroqCloudKey": "" + } +} +``` + +#### Simple Console Initialization + +Alternatively, you can set the backend type and GroqCloud key programmatically during initialization using `MaINBootstrapper.Initialize`: + +```csharp +MaINBootstrapper.Initialize(configureSettings: (options) => +{ + options.BackendType = BackendType.GroqCloud; + options.GroqCloudKey = ""; +}); +``` + +#### 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.GroqCloud; + options.GroqCloudKey = ""; +}); +``` + +### πŸ“¦ Using Environment Variables + +If you prefer not to store your GroqCloud 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 `GROQ_API_KEY` environment variable in different platforms: + +- **On Windows (Command Prompt):** + + ```bash + set GROQ_API_KEY= + ``` + +- **On Windows (PowerShell):** + + ```bash + $env:GROQ_API_KEY="" + ``` + +- **On macOS/Linux:** + + ```bash + export GROQ_API_KEY= + ``` + +This way, you can securely store your API key in the environment without the need for hardcoding it. + +--- + +## πŸ”Ή What’s Included with GroqCloud Integration + +Once you configure GroqCloud 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 GroqCloud 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 GroqCloud, enabling you to use the full power of the framework without worrying about backend-specific configurations. + +--- + +## ⚠️ Important Considerations + +When using GroqCloud models with the MaIN framework, please note these current limitations: + +- Image Generation: GroqCloud models do not support direct image generation. Using features that rely on generating images will throw a `NotSupportedException`. +- Embeddings: GroqCloud 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 GroqCloud key and set the backend type to GroqCloud, either via `appsettings.json`, environment variables, or programmatically. +- **Environment Variable Support**: Supports storing your GroqCloud key securely as an environment variable, making it easy to configure on different platforms. +- **Seamless Operation**: Once GroqCloud is configured, everything within the MaIN framework works identically with GroqCloud, 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 GroqCloud powerful capabilities. From a1aedd6cbaca32afb4aa7415d40c2942d7f7a527 Mon Sep 17 00:00:00 2001 From: Magdalena Majta Date: Wed, 6 Aug 2025 14:26:35 +0200 Subject: [PATCH 2/2] update cli download urls --- src/assets/docs/cli.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/assets/docs/cli.md b/src/assets/docs/cli.md index 2f6a01e..7c6ac91 100644 --- a/src/assets/docs/cli.md +++ b/src/assets/docs/cli.md @@ -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=m0daA8) +Download and unpack content from this link [Download](https://1drv.ms/u/c/8dd72529df58a475/EXWkWN8pJdcggI1tAAAAAAABD0eIFVX7HhjwDubuEr1T9w?e=63TNH0) ```bash .\install-mcli.ps1 ``` ### (Linux/Mac) -Download and unpack content from this link [Download](https://1drv.ms/u/c/8dd72529df58a475/EXWkWN8pJdcggI1zAAAAAAABMMmdRp0OgzMEwBFB4Gftvg?e=ilXsHh) +Download and unpack content from this link [Download](https://1drv.ms/u/c/8dd72529df58a475/EXWkWN8pJdcggI1zAAAAAAABMMmdRp0OgzMEwBFB4Gftvg?e=vz96CR) > - You might need some sudo permissions to set default model path or run api scripts ```bash