Customizing a FlashLearn skill allows you to tailor its behavior to your specific use case. This involves modifying the key parameters in the skill’s JSON definition, such as system prompts, function definitions, and the output schema. Below is an explanation of important parameters and guidance on how to modify them.
Key Parameters in the Skill JSON Definition #
-
skill_class
- Purpose: Indicates the category or type of skill (e.g., “GeneralSkill”, “ClassificationSkill”).
- Modification: Change this value if you want to use a different processing class or if you’re building a specialized skill.
-
system_prompt
- Purpose: The natural language instruction provided to the LLM. It sets the context and guides how the input should be transformed.
- Modification: Update the prompt text to alter the task behavior. For example, if you’re transitioning from a sentiment analysis task to a purchase prediction task, modify the prompt to reflect the new objective.
-
function_definition
-
Purpose: This section enforces a strict output structure by defining the expected JSON schema of the LLM response. It ensures that every returned answer conforms to a specified format.
-
Components:
- type: Typically set to “function” to indicate a callable schema.
- function: Contains details such as:
- name: The identifier for your skill function.
- description: A summary of what the function does; altering this can help future developers understand its role without examining the details.
- strict: A boolean flag that, when true, mandates that outputs strictly conform to the given schema.
- parameters:
- type: Usually “object”, indicating that the output should be a JSON object.
- properties: A dictionary where each key represents an expected output field. For example:
- likely_to_buy: Could be an integer with a description like “A number from 1 to 100 indicating the likelihood of a purchase.”
- reason: A textual explanation supporting the score.
- required: A list of keys that must be present in every output.
- additionalProperties: A boolean (typically false) to reject any keys not defined in the schema.
-
Modification:
- Adjust property names or types according to your task requirements.
- Update descriptions to provide clearer guidance for the transformation.
- Change the
required
list if additional or fewer outputs should be guaranteed. - Set
additionalProperties
to true if you want to allow extra fields in the output.
-
How to Modify These Parameters #
-
Modifying the System Prompt:
Simply edit the value in the JSON key"system_prompt"
. For example:- Original:
"Evaluate the sentiment of this review, returning an integer score and a brief explanation."
- Modified:
"Assess how likely the user is to purchase the product, returning a score from 1 to 100 under 'likely_to_buy' and a short reason under 'reason'."
- Original:
-
Adjusting Function Definitions:
Navigate to the"function_definition"
section in your skill JSON and make changes as needed:- To change the expected output type from an integer to a string, update the
"type"
field under the relevant property in"properties"
. - To add a new output field, append a new property with its type, description, and add the new key to the
"required"
list if it should always be included. - If you need a less rigid structure, you can set
"strict"
to false or allow additional properties by setting"additionalProperties"
to true.
- To change the expected output type from an integer to a string, update the
By understanding and modifying these parameters in the skill JSON definition, you can effectively customize the behavior of your LLM tasks within FlashLearn. Tailor the system prompt to clearly instruct the LLM, and adjust the function definitions to match your precise output needs—ensuring consistency and clarity across your workflows.