Package com.microsoft.semantickernel
Interface SkillExecutor
-
- All Known Subinterfaces:
Kernel
public interface SkillExecutor
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ReadOnlyFunctionCollectiongetSkill(String skillName)Get function collection with the skill nameReadOnlySkillCollectiongetSkills()ReadOnlyFunctionCollectionimportSkill(Object nativeSkill, String skillName)Imports the native functions annotated on the given object as a skill.ReadOnlyFunctionCollectionimportSkill(String skillName, Map<String,SemanticFunctionConfig> skills)Import a set of skillsReadOnlyFunctionCollectionimportSkillFromDirectory(String skillName, String parentDirectory)Imports the native functions annotated on the given object as a skill.ReadOnlyFunctionCollectionimportSkillFromDirectory(String skillName, String parentDirectory, String skillDirectoryName)Imports the native functions annotated on the given object as a skill.ReadOnlyFunctionCollectionimportSkillFromResources(String pluginDirectory, String skillName, String functionName)Imports a skill using ClassLoader.getResourceAsStream to load skills from the classpath.ReadOnlyFunctionCollectionimportSkillFromResources(String pluginDirectory, String skillName, String functionName, Class clazz)Imports a skill using clazz.getResourceAsStream to load skills from the classpath.voidimportSkillsFromDirectory(String parentDirectory, String... skillNames)Imports the native functions annotated on the given object as a skill.
-
-
-
Method Detail
-
importSkill
ReadOnlyFunctionCollection importSkill(String skillName, Map<String,SemanticFunctionConfig> skills) throws SkillsNotFoundException
Import a set of skills- Parameters:
skillName- name of the skillskills- map of skill names to skill configs- Returns:
- the function collection
- Throws:
SkillsNotFoundException- if the skill is not found
-
getSkill
ReadOnlyFunctionCollection getSkill(String skillName) throws SkillsNotFoundException
Get function collection with the skill name- Parameters:
skillName- name of the skill- Returns:
- the function collection
- Throws:
SkillsNotFoundException- if the skill is not found
-
importSkillFromDirectory
ReadOnlyFunctionCollection importSkillFromDirectory(String skillName, String parentDirectory, String skillDirectoryName)
Imports the native functions annotated on the given object as a skill.- Parameters:
skillName- name of the skill- Returns:
- the function collection
-
importSkillsFromDirectory
void importSkillsFromDirectory(String parentDirectory, String... skillNames)
Imports the native functions annotated on the given object as a skill.
-
importSkillFromDirectory
ReadOnlyFunctionCollection importSkillFromDirectory(String skillName, String parentDirectory)
Imports the native functions annotated on the given object as a skill. Assumes that the directory that contains the skill is the same as skillName- Parameters:
skillName- name of the skillparentDirectory- directory that contains the skill- Returns:
- the function collection
-
importSkillFromResources
ReadOnlyFunctionCollection importSkillFromResources(String pluginDirectory, String skillName, String functionName) throws KernelException
Imports a skill using ClassLoader.getResourceAsStream to load skills from the classpath.- Parameters:
pluginDirectory- directory within the classpath that contains the skillskillName- name of the skillfunctionName- name of the function- Returns:
- the function collection
- Throws:
KernelException- if it is not possible to correctly load the skill
-
importSkillFromResources
ReadOnlyFunctionCollection importSkillFromResources(String pluginDirectory, String skillName, String functionName, @Nullable Class clazz) throws KernelException
Imports a skill using clazz.getResourceAsStream to load skills from the classpath.- Parameters:
skillName- name of the skillfunctionName- name of the functionclazz- class that contains the skill- Returns:
- the function collection
- Throws:
KernelException- if it is not possible to correctly load the skill
-
importSkill
ReadOnlyFunctionCollection importSkill(Object nativeSkill, @Nullable String skillName)
Imports the native functions annotated on the given object as a skill.- Parameters:
nativeSkill- object containing the native functionsskillName- name of the skill- Returns:
- the function collection
-
getSkills
ReadOnlySkillCollection getSkills()
- Returns:
- Reference to the read-only skill collection containing all the imported functions
-
-