Interfaces to support code explainer feature in ValidMind (#358)
validmind-library
2.8.26
documentation
enhancement
highlight
This update introduces an experimental feature for text generation tasks within the ValidMind project. It includes interfaces to utilize the code_explainer
LLM feature, currently in the experimental namespace to gather feedback.
How to use:
Read the source code as a string:
with open("customer_churn.py", "r") as f: = f.read() source_code
Define the input for the
run_task
task. The input requires two variables in dictionary format:= { code_explainer_input "source_code": source_code, "additional_instructions": """ Please explain the code in a way that is easy to understand. """ }
Run the
code_explainer
task withgeneration_type="code_explainer"
:= vm.experimental.agents.run_task( result ="code_explainer", taskinput=code_explainer_input )
Example Output: