AzureAI.Community.SK.Connector.GitHub.Models
1.0.0
See the version list below for details.
dotnet add package AzureAI.Community.SK.Connector.GitHub.Models --version 1.0.0
NuGet\Install-Package AzureAI.Community.SK.Connector.GitHub.Models -Version 1.0.0
<PackageReference Include="AzureAI.Community.SK.Connector.GitHub.Models" Version="1.0.0" />
paket add AzureAI.Community.SK.Connector.GitHub.Models --version 1.0.0
#r "nuget: AzureAI.Community.SK.Connector.GitHub.Models, 1.0.0"
// Install AzureAI.Community.SK.Connector.GitHub.Models as a Cake Addin #addin nuget:?package=AzureAI.Community.SK.Connector.GitHub.Models&version=1.0.0 // Install AzureAI.Community.SK.Connector.GitHub.Models as a Cake Tool #tool nuget:?package=AzureAI.Community.SK.Connector.GitHub.Models&version=1.0.0
AzureAI Community Microsoft Semantic Kernel Connector - GitHub Models
The AzureAI.Community.SK.Connector.GitHub.Models
This component provides a simplified way to connect the GitHub Module for developing generative AI applications.
GitHub Module
If you're looking to develop a generative AI application, GitHub Models offers a platform where you can discover and experiment with AI models at no cost.
Building a GitHub Model Connector
In this guide, we will walk you through simplified way to connect the GitHub Module for developing generative AI applications.
Prerequisites
Install AzureAI.Community.SK.Connector.GitHub.Models package from nuget server
Before you begin building the GitHub Connector, make sure you have the following prerequisites in place:
You'll need access rights to connect to the GitHub Module. To obtain these rights, please visit the following URL: https://github.com/marketplace/models. and Please watch this video to learn how to apply and create a token. Here is the URL: https://www.youtube.com/watch?v=RBWadYAQze8
Connector Building Steps
modelName
: Get this from your GitHub Module.Endpoint
: Find this in your GitHub Module.GITHUB_TOKEN
: Obtain this from your GitHub account settings page.
Add GitHub Azure OpenAI Model in Kernel Builder
var builder = Kernel.CreateBuilder()
.AddGitHubAzureOpenAIChatCompletion(ModelName, Endpoint, GitHubToken);
Add OpenAI Model in Kernel Builder
var builder = Kernel.CreateBuilder()
.AddGitHubOpenAIChatCompletion(ModelName, Endpoint, GitHubToken);
Add Azure OpenAI Embedding
var gitHubOpenAITextEmbeddingGenerationService = new GitHubAzureOpenAITextEmbeddingService(
EmbeddingModelName,
Endpoint,
GitHubToken);
var result =
await gitHubOpenAITextEmbeddingGenerationService.GenerateEmbeddingsAsync(new List<string>()
{ "Hello how are you" });
Add OpenAI Embedding
var openAITextEmbeddingService = new GitHubOpenAITextEmbeddingService(
EmbeddingModelName,
Endpoint,
GitHubToken);
var result =
await openAITextEmbeddingService.GenerateEmbeddingsAsync(new List<string>()
{ "Hello how are you" });
MistralAI Model in Kernel Builder
ChatMessageContents
var mistralAIChatCompletionService = new GitHubMistralAIChatCompletionService(MistralModel, Endpoint, GitHubToken);
var chatHistory = new ChatHistory
{
new ChatMessageContent(AuthorRole.User, "What is the best in TamilNadu?")
};
var response = await mistralAIChatCompletionService.GetChatMessageContentsAsync(chatHistory, default);
StreamingChatMessageContents
var mistralAIChatCompletionService = new GitHubMistralAIChatCompletionService(MistralModel, Endpoint, GitHubToken);
var chatHistory = new ChatHistory
{
new ChatMessageContent(AuthorRole.User, "What is the best in TamilNadu?")
};
var response = mistralAIChatCompletionService.GetStreamingChatMessageContentsAsync(chatHistory, default);
await foreach (var content in response)
{
Console.Write(content);
}
Add Phi3 Model in Kernel Builder
var builder = Kernel.CreateBuilder()
.AddGitHubPhi3AIChatCompletion(Config.Phi3Model, Config.Endpoint, Config.GitHubToken);
var kernel = builder.Build();
Subscribe to the YouTube channel
Learn Microsoft AI to learn more about Microsoft Semantic Kernel and GitHub Models.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net8.0
- Microsoft.SemanticKernel (>= 1.18.1-rc)
- Microsoft.SemanticKernel.Connectors.HuggingFace (>= 1.18.1-preview)
- Microsoft.SemanticKernel.Connectors.MistralAI (>= 1.18.1-alpha)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.