lemillermicrosoft / skonsole

A collection of Plugins and example console application built on the Semantic Kernel
MIT License
42 stars 6 forks source link

✨ Add ExecuteCommand to SKonsole #31

Open xbotter opened 11 months ago

xbotter commented 11 months ago

Add a new command called ExecuteCommand to SKonsole. This command allows users to execute semantic functions directly. The command takes a prompt argument and an optional template option. The template option specifies the template to use for the semantic function, with a default value of "{{$input}}". The command uses the KernelProvider to get an instance of the semantic kernel and creates a semantic function based on the template. It then runs the semantic function with the provided prompt and outputs the result. The result is printed to the console.

Description:
  Execute semantic function.

Usage:
  SKonsole exec <prompt> [options]

Arguments:
  <prompt>  The semantic function prompt or input for direct execution

Options:
  -t, --template <template>      The template (file) to use for the semantic function. [default: {{$input}}]
  -o, --outputFile <outputFile>  Output the result to the specified file.
  -?, -h, --help                 Show help and usage information

example:

skonsole exec  "prompt input" -t "template or template file (optional)" -o output.txt(optional)
lemillermicrosoft commented 10 months ago

Hey @xbotter thanks for the PR. Sorry for the delay.