Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Add ExecuteCommand to SKonsole #31

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

xbotter
Copy link
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
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