forked from StartAutomating/PowerShellAI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PowerShellAI.psm1
37 lines (30 loc) · 1.01 KB
/
PowerShellAI.psm1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Set the OpenAI key to null
$Script:OpenAIKey = $null
# Set the chat API provider to OpenAI
$Script:ChatAPIProvider = 'OpenAI'
# Set the chat in progress flag to false
$Script:ChatInProgress = $false
# Create an array list to store chat messages
[System.Collections.ArrayList]$Script:ChatMessages = @()
# Enable chat persistence
$Script:ChatPersistence = $true
# Set the options for the chat session
$Script:ChatSessionOptions = @{
'model' = 'gpt-4'
'temperature' = 0.0
'max_tokens' = 256
'top_p' = 1.0
'frequency_penalty' = 0
'presence_penalty' = 0
'stop' = $null
}
# Set the options for the Azure OpenAI API
$Script:AzureOpenAIOptions = @{
Endpoint = 'not set'
DeploymentName = 'not set'
ApiVersion = 'not set'
}
# Load all PowerShell scripts in the Public and Private directories
foreach ($directory in @('Public', 'Private')) {
Get-ChildItem -Path "$PSScriptRoot\$directory\*.ps1" | ForEach-Object { . $_.FullName }
}