Method GetContent
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
encodingEncodingThe 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.