Skip to content

Commit

Permalink
Include AssemblyAI User Agent
Browse files Browse the repository at this point in the history
  • Loading branch information
Swimburger committed Jul 16, 2024
1 parent c103e93 commit 3537462
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
<PackageTags>SemanticKernel;AI;AssemblyAI;transcript</PackageTags>
<Company>AssemblyAI</Company>
<Product>AssemblyAI</Product>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
<FileVersion>1.1.0.0</FileVersion>
<PackageVersion>1.1.0</PackageVersion>
<AssemblyVersion>1.1.1.0</AssemblyVersion>
<FileVersion>1.1.1.0</FileVersion>
<PackageVersion>1.1.1</PackageVersion>
<OutputType>Library</OutputType>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/AssemblyAI/assemblyai-semantic-kernel</PackageProjectUrl>
Expand Down
7 changes: 6 additions & 1 deletion src/AssemblyAI.SemanticKernel/AssemblyAIPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public AssemblyAIPlugin(string apiKey, bool allowFileSystemAccess)
AllowFileSystemAccess = allowFileSystemAccess
};
}

[ActivatorUtilitiesConstructor]
public AssemblyAIPlugin(IOptions<AssemblyAIPluginOptions> options)
{
Expand All @@ -60,6 +60,11 @@ string input
using (var httpClient = new HttpClient())
{
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(ApiKey);
httpClient.DefaultRequestHeaders.UserAgent.Add(new ProductInfoHeaderValue("AssemblyAI", "1.0"));
httpClient.DefaultRequestHeaders.UserAgent.Add(new ProductInfoHeaderValue(
$"(integration=AssemblyAI.SemanticKernel/{typeof(AssemblyAIPlugin).Assembly.GetName().Version})"
));

string audioUrl;
if (TryGetPath(input, out var filePath))
{
Expand Down

0 comments on commit 3537462

Please sign in to comment.