Files
microsoft--semantic-kernel/dotnet/samples/Demos/OllamaFunctionCalling/Plugins/MyLightPlugin.cs
T
wehub-resource-sync b957a53def
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:21:23 +08:00

25 lines
688 B
C#

// Copyright (c) Microsoft. All rights reserved.
using System.ComponentModel;
using Microsoft.SemanticKernel;
namespace OllamaFunctionCalling;
/// <summary>
/// Class that represents a controllable light bulb.
/// </summary>
[Description("Represents a light bulb")]
public class MyLightPlugin(bool turnedOn = false)
{
private bool _turnedOn = turnedOn;
[KernelFunction, Description("Returns whether this light is on")]
public bool IsTurnedOn() => _turnedOn;
[KernelFunction, Description("Turn on this light")]
public void TurnOn() => _turnedOn = true;
[KernelFunction, Description("Turn off this light")]
public void TurnOff() => _turnedOn = false;
}