Initial commit to new repository
This commit is contained in:
22
.decompiledproj/AxCopilot/Handlers/JsonSkillLoader.cs
Normal file
22
.decompiledproj/AxCopilot/Handlers/JsonSkillLoader.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System.IO;
|
||||
using System.Text.Json;
|
||||
using AxCopilot.SDK;
|
||||
|
||||
namespace AxCopilot.Handlers;
|
||||
|
||||
public static class JsonSkillLoader
|
||||
{
|
||||
public static IActionHandler? Load(string filePath)
|
||||
{
|
||||
string json = File.ReadAllText(filePath);
|
||||
JsonSkillDefinition jsonSkillDefinition = JsonSerializer.Deserialize<JsonSkillDefinition>(json, new JsonSerializerOptions
|
||||
{
|
||||
PropertyNameCaseInsensitive = true
|
||||
});
|
||||
if (jsonSkillDefinition == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return new JsonSkillHandler(jsonSkillDefinition);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user