This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- config.json | |
{ | |
"schema": 1, | |
"description": "Given a by category request for a time range, format the resulting monetary value", | |
"execution_settings": { | |
"default": { | |
"max_tokens": 70, | |
"temperature": 0.9, | |
"top_p": 0.0, | |
"presence_penalty": 0.0, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public sealed class CosmosPlugin | |
{ | |
private readonly IConfiguration _configuration; | |
public CosmosPlugin(IConfiguration configuration) | |
{ | |
_configuration = configuration; | |
} | |
[KernelFunction("byCategoryInDateRange")] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var builder = Kernel.CreateBuilder(); | |
builder.Plugins.AddFromType<MathPlugin>(); | |
builder.Plugins.AddFromPromptDirectory(Path.Combine(Directory.GetCurrentDirectory(), "Plugins", "GenStatementPlugin")); | |
builder.AddAzureOpenAIChatCompletion("<deployment name>", "<endpoint>", "<key>"); | |
var kernel = builder.Build(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WRITE EXACTLY ONE STATEMENT USING THE NUMBER BELOW ABOUT ANY TOPIC. | |
STATEMENT MUST BE: | |
- G RATED | |
- WORKPLACE/FAMILY SAFE | |
NO SEXISM, RACISM OR OTHER BIAS/BIGOTRY. | |
BE CREATIVE AND FUNNY. I WANT TO BE AMUSED. | |
+++++ | |
{{$number}} | |
+++++ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"schema": 1, | |
"description": "Generate a statement that uses the provided number in that statement", | |
"execution_settings": { | |
"default": { | |
"max_tokens": 70, | |
"temperature": 0.9, | |
"top_p": 0.0, | |
"presence_penalty": 0.0, | |
"frequency_penalty": 0.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var builder = Kernel.CreateBuilder(); | |
builder.Plugins.AddFromType<MathPlugin>(); | |
builder.AddAzureOpenAIChatCompletion("<deployment name>", "<endpoint>", "<key>"); | |
var kernel = builder.Build(); | |
#pragma warning disable // Suppress the diagnostic messages | |
var planner = new HandlebarsPlanner(new HandlebarsPlannerOptions() { AllowLoops = true }); | |
var plan = await planner.CreatePlanAsync(kernel, $"Get the result of subtracting 10 from the sum of factorials {numberOne} and {numberTwo}"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var builder = Kernel.CreateBuilder(); | |
builder.Plugins.AddFromType<MathPlugin>(); | |
builder.AddAzureOpenAIChatCompletion( | |
"<deploymentname>", | |
"<open ai instance endpoint>", | |
"<api key>"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.ComponentModel; | |
using Microsoft.SemanticKernel; | |
namespace FactorialAdder.Plugins | |
{ | |
public sealed class MathPlugin | |
{ | |
[KernelFunction("factorial"), Description("Calculates the factorial of a number")] | |
public static int Factorial( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int numberOne = int.Parse(args[0]); | |
int numberTwo = int.Parse(args[1]); | |
var builder = Kernel.CreateBuilder(); | |
builder.Plugins.AddFromType<MathPlugin>(); | |
var kernel = builder.Build(); | |
var result = await kernel.InvokeAsync<int>("MathPlugin", "factorial", new() { { "number", numberOne } }); | |
Console.WriteLine(result); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.ComponentModel; | |
using Microsoft.SemanticKernel; | |
namespace FactorialAdder.Plugins | |
{ | |
public sealed class MathPlugin | |
{ | |
[KernelFunction("factorial"), Description("Calculates the factorial of a number")] | |
public static int Factorial( |
NewerOlder