potatoqualitee / PowerShellAIAssistant

Enhance PowerShell scripting with AI using PowerShell AI Assistant module.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Welcome to PowerShell AI Assistant, a module designed for seamless integration with OpenAI Assistant APIs, providing a rich set of functionalities to empower your PowerShell scripts with the latest AI technologies. Dive into an enhanced scripting experience by leveraging an AI-powered assistant in your console.

Why PowerShell AI Assistant?

PowerShell AI Assistant is where advanced AI meets PowerShell scripting. With this module, you can create interactive, intelligent scripts and applications that understand and process natural language with ease.

Install

Note: If you have PowerShellAI you can safely PowerShellAIAssistant using -AllowClobber

Install-Module PowerShellAIAssistant -AllowClobber

Configure

  1. Create an OpenAI account or sign in.
  2. Navigate to the API key page.
  3. Click "Create new secret key", optionally naming the key. Make sure to save this somewhere safe and do not share it with anyone.
  4. Set the environment variable OpenAIKey to your API key.
  5. Open a new PowerShell and type $ENV:OpenAIKey. If you do not see your API key, you may need to either restart your computer or use a script like Refresh-EnvironmentVariables for it to be detected.
  6. Run the Sanity-Check script, which will create and delete an assistant on OpenAI to confirm it's working. If it works, you're good to go.

Examples

There is one example and it is in a Polyglot Interactive Notebook titled Assistants API overview. This notebook shows how to use the Assistants API to build a simple question answering interaction.

Support for Azure OpenAI

After creating an Azure OpenAI resource, you can use the PowerShellAIAssistant module to interact with it.

You need to get the following secrets form the Azure Portal and Azure AI Studio - apiURI,apiVersion,apiKey,deploymentName.

$secrets = @{
    apiURI         = "<Your Azure OpenAI API URI>"
    apiVersion     = "<Your Azure OpenAI API Version>"
    apiKey         = "<Your Azure OpenAI API Key>"
    deploymentName = "<Your Azure OpenAI Deployment Name>"
}

Set-OAIProvider AzureOpenAI
Set-AzOAISecrets @secrets

See: Simple-Tutor-Azure-OpenAI.ps1

A Set-OAIProvider and Get-OAIProvider function are available to switch between OpenAI and Azure OpenAI.

Features

  • Easy integration with OpenAI's Assistants API
  • Build conversational AI models within PowerShell
  • Access a suite of AI capabilities for natural language processing, understanding, and decision making
  • Extend your automation scripts with smart AI assistant features

Links

Build With Us - In Public!

I am developing PowerShell AI Assistant transparently, and I welcome you to participate in this innovative journey:

  • Transparency: Witness the development process as it unfolds.
  • Collaboration: Contribute ideas, code, or feedback to help shape the project.
  • Education: Observe and learn from ongoing development practices and community interaction.

About the Author

I am Doug Finke, a PowerShell expert, AI developer, and a 15x Microsoft MVP, dedicated to merging the potential of AI with the flexibility of PowerShell.

Stay Updated!

Follow the project's progress and stay in touch by following me on

and by watching the repo.

I'm excited to see how PowerShell AI Assistant will revolutionize your scripting and automation tasks.

Join us to push the boundaries of what's possible with AI in PowerShell!

About

Enhance PowerShell scripting with AI using PowerShell AI Assistant module.

License:Apache License 2.0


Languages

Language:PowerShell 100.0%