AzureAI.Community.Microsoft.Semantic.Kernel.PlugIn.Web.YouTube
1.0.0-beta1
dotnet add package AzureAI.Community.Microsoft.Semantic.Kernel.PlugIn.Web.YouTube --version 1.0.0-beta1
NuGet\Install-Package AzureAI.Community.Microsoft.Semantic.Kernel.PlugIn.Web.YouTube -Version 1.0.0-beta1
<PackageReference Include="AzureAI.Community.Microsoft.Semantic.Kernel.PlugIn.Web.YouTube" Version="1.0.0-beta1" />
paket add AzureAI.Community.Microsoft.Semantic.Kernel.PlugIn.Web.YouTube --version 1.0.0-beta1
#r "nuget: AzureAI.Community.Microsoft.Semantic.Kernel.PlugIn.Web.YouTube, 1.0.0-beta1"
// Install AzureAI.Community.Microsoft.Semantic.Kernel.PlugIn.Web.YouTube as a Cake Addin #addin nuget:?package=AzureAI.Community.Microsoft.Semantic.Kernel.PlugIn.Web.YouTube&version=1.0.0-beta1&prerelease // Install AzureAI.Community.Microsoft.Semantic.Kernel.PlugIn.Web.YouTube as a Cake Tool #tool nuget:?package=AzureAI.Community.Microsoft.Semantic.Kernel.PlugIn.Web.YouTube&version=1.0.0-beta1&prerelease
AzureAI Community Microsoft Semantic Kernel Plugin - YouTube Videos Search
The AzureAI.Community.Microsoft.Semantic.Kernel.PlugIn.Web.YouTube
This component offers a streamlined solution for conducting YouTube video searches, allowing users to specify keywords and seamlessly integrate YouTube video data into their projects.
Building a YouTube Video Connector
In this guide, we will walk you through the process of building a plugin to search for YouTube videos and retrieve video details .
Prerequisites
Install AzureAI.Community.Microsoft.Semantic.Kernel.PlugIn.Web.YouTube package from nuget server
Before you begin building the plugin, make sure you have the following prerequisites in place:
YouTube Data API Key: You'll need an API key from the YouTube Data API to access YouTube's data. You can obtain one by following the API key setup instructions on the YouTube API Documentation.
Plugin Building Steps
Create an Instance of YouTubeConnector
The YouTubeConnector
class is responsible for conducting the search for YouTube videos. You need to create an instance of this class by providing your YouTube API key
Here's an example code snippet:
var youTubeConnector = new YouTubeConnector("YouTube-Key");
Importing a Skill into the Kernel
To import a skill into the kernel, you can use the following C# code snippet:
var youtubeSkill = kernel.ImportFunctions(new WebSearchEnginePlugin(youTubeConnector), nameof(YouTubeConnector));
Running a Skill within the Kernel
To execute a skill within the kernel, you can use the following C# code snippet:
var result = await kernel.RunAsync("Bot composer", youtubeSkill["search"]);
Output
var output = result?.GetValue<string>();
Console.WriteLine(output);
Channels based search
YouTubeConnector offers robust support for conducting searches based on YouTube channels. This functionality allows users to efficiently retrieve and analyze content associated with specific YouTube channels.
When initializing the YouTubeConnector, simply supply the channel ID.
Here's an example code snippet:
var youTubeConnector = new YouTubeConnector("YouTube-Key","youTube-ChannelId");
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
- Google.Apis.YouTube.v3 (>= 1.62.0.3169)
- Microsoft.SemanticKernel (>= 1.0.0-beta1)
- Microsoft.SemanticKernel.Plugins.Web (>= 1.0.0-beta1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0-beta1 | 336 | 10/10/2023 |
0.0.5-preview | 92 | 10/6/2023 |
0.0.4-preview | 84 | 10/5/2023 |
0.0.3-preview | 81 | 10/5/2023 |