Table of Contents

Method GetContent

Namespace
LMKit.Agents.Skills
Assembly
LM-Kit.NET.dll

GetContent(Encoding)

Gets the text content of this resource synchronously.

Content is cached after first load. Subsequent calls return the cached value.

public string GetContent(Encoding encoding = null)

Parameters

encoding Encoding

The encoding to use when reading the file. Defaults to UTF-8 if null.

Returns

string

The text content of the resource file.

Examples

Loading resource content:

var skill = AgentSkill.Load("./skills/api-designer");
var template = skill.GetResource("templates/openapi.yaml");
string content = template.GetContent();
Console.WriteLine(content);

Exceptions

FileNotFoundException

Thrown when the resource file does not exist.

IOException

Thrown when an I/O error occurs while reading the file.