Skip to content

✨ Add ExecuteCommand to SKonsole#31

Open
xbotter wants to merge 5 commits intolemillermicrosoft:mainfrom
xbotter:feat-executor
Open

✨ Add ExecuteCommand to SKonsole#31
xbotter wants to merge 5 commits intolemillermicrosoft:mainfrom
xbotter:feat-executor

Conversation

@xbotter
Copy link
Copy Markdown
Contributor

@xbotter xbotter commented Nov 24, 2023

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)

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.
- Redirect console output to StreamWriter for better control
- Write result to console using StreamWriter
- Add support for specifying an output file for the result
- Load template from file if specified
- Create output file directory if it doesn't exist
- Write result to output file if specified, otherwise print to console
@lemillermicrosoft
Copy link
Copy Markdown
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants