Skip to content

Commit 5a0afd2

Browse files
committed
Don't specify plugin name
1 parent bc04419 commit 5a0afd2

File tree

3 files changed

+19
-27
lines changed

3 files changed

+19
-27
lines changed

README.md

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,20 @@ string apiKey = Environment.GetEnvironmentVariable("ASSEMBLYAI_API_KEY")
3737

3838
kernel.ImportPluginFromObject(
3939
new TranscriptPlugin(apiKey: apiKey)
40-
TranscriptPlugin.PluginName
4140
);
4241
```
4342

4443
## Usage
4544

4645
Get the `Transcribe` function from the transcript plugin and invoke it with the context variables.
4746
```csharp
48-
var arguments = new KernelArguments
49-
{
50-
["INPUT"] = "https://storage.googleapis.com/aai-docs-samples/espn.m4a"
51-
};
5247
var result = await kernel.InvokeAsync(
53-
TranscriptPlugin.PluginName,
48+
nameof(TranscriptPlugin),
5449
TranscriptPlugin.TranscribeFunctionName,
55-
arguments
50+
new KernelArguments
51+
{
52+
["INPUT"] = "https://storage.googleapis.com/aai-docs-samples/espn.m4a"
53+
}
5654
);
5755
Console.WriteLine(result.GetValue<string>());
5856
```
@@ -68,17 +66,15 @@ kernel.ImportPluginFromObject(
6866
new TranscriptPlugin(apiKey: apiKey)
6967
{
7068
AllowFileSystemAccess = true
71-
},
72-
TranscriptPlugin.PluginName
69+
}
7370
);
74-
var arguments = new KernelArguments
75-
{
76-
["INPUT"] = "https://storage.googleapis.com/aai-docs-samples/espn.m4a"
77-
};
7871
var result = await kernel.InvokeAsync(
79-
TranscriptPlugin.PluginName,
72+
nameof(TranscriptPlugin),
8073
TranscriptPlugin.TranscribeFunctionName,
81-
arguments
74+
new KernelArguments
75+
{
76+
["INPUT"] = "https://storage.googleapis.com/aai-docs-samples/espn.m4a"
77+
}
8278
);
8379
Console.WriteLine(result.GetValue<string>());
8480
```

src/Sample/FindFilePlugin.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ namespace AssemblyAI.SemanticKernel.Sample;
66

77
public class FindFilePlugin
88
{
9-
public const string PluginName = nameof(FindFilePlugin);
10-
119
private async Task<string?> GetCommonFolderPath(Kernel kernel, string commonFolderName)
1210
{
1311
var prompt = $"The path for the common folder '{commonFolderName}' " +

src/Sample/Program.cs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,10 @@ private static Kernel BuildKernel(IConfiguration config)
3333
new TranscriptPlugin(apiKey: apiKey)
3434
{
3535
AllowFileSystemAccess = true
36-
},
37-
TranscriptPlugin.PluginName
36+
}
3837
);
3938

40-
kernel.ImportPluginFromType<FindFilePlugin>(FindFilePlugin.PluginName);
39+
kernel.ImportPluginFromType<FindFilePlugin>();
4140
return kernel;
4241
}
4342

@@ -54,14 +53,13 @@ private static IConfigurationRoot BuildConfig(string[] args)
5453
private static async Task TranscribeFileUsingPluginDirectly(Kernel kernel)
5554
{
5655
Console.WriteLine("Transcribing file using plugin directly");
57-
var arguments = new KernelArguments
58-
{
59-
["INPUT"] = "https://storage.googleapis.com/aai-docs-samples/espn.m4a"
60-
};
6156
var result = await kernel.InvokeAsync(
62-
TranscriptPlugin.PluginName,
63-
TranscriptPlugin.TranscribeFunctionName,
64-
arguments
57+
nameof(TranscriptPlugin),
58+
TranscriptPlugin.TranscribeFunctionName,
59+
new KernelArguments
60+
{
61+
["INPUT"] = "https://storage.googleapis.com/aai-docs-samples/espn.m4a"
62+
}
6563
);
6664

6765
Console.WriteLine(result.GetValue<string>());

0 commit comments

Comments
 (0)