Skip to content

Commit

Permalink
add tokens and claude stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
potatoqualitee committed Oct 23, 2024
1 parent c6b336b commit e04dee2
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 32 deletions.
70 changes: 39 additions & 31 deletions .aider/aider.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,16 @@ function Update-PesterTest {
$cmdPrompt = $cmdPrompt -replace "--PARMZ--", ($parameters.Name -join "`n")
$cmdprompt = $cmdPrompt -join "`n"

$params = @(
"--message", $cmdPrompt,
"--file", $filename,
"--yes-always",
"--no-stream",
"--cache-prompts",
"--read", $CacheFilePath
)

aider @params
$aiderParams = @{
Message = $cmdPrompt
File = $filename
YesAlways = $true
Stream = $false
CachePrompts = $true
ReadFile = $CacheFilePath
}

Invoke-Aider @aiderParams
}
}

Expand Down Expand Up @@ -169,15 +169,15 @@ function Repair-Error {
$cmdPrompt += "Line: $($err.LineNumber)`n"
}

# Run Aider in non-interactive mode with auto-confirmation
$parms = @(
"--message", $cmdPrompt,
"--file", $filename,
"--no-stream",
"--cache-prompts",
"--read", $CacheFilePath
)
aider @parms
$aiderParams = @{
Message = $cmdPrompt
File = $filename
Stream = $false
CachePrompts = $true
ReadFile = $CacheFilePath
}

Invoke-Aider @aiderParams
}
}

Expand Down Expand Up @@ -249,15 +249,15 @@ function Repair-ParameterTest {
$parameters = $parameters.Name -join ", "
$cmdPrompt = $promptTemplate -replace "--PARMZ--", $parameters

# Run Aider in non-interactive mode with auto-confirmation
$params = @(
"--message", $cmdPrompt,
"--file", $filename,
"--yes-always",
"--no-stream",
"--model", $Model
)
aider @params
$aiderParams = @{
Message = $cmdPrompt
File = $filename
YesAlways = $true
Stream = $false
Model = $Model
}

Invoke-Aider @aiderParams
}
}

Expand Down Expand Up @@ -310,7 +310,7 @@ function Invoke-Aider {
.PARAMETER ShowPrompts
Show system prompts.
.PARAMETER Verbose
.PARAMETER VerboseOutput
Enable verbose output.
.PARAMETER EditFormat
Expand All @@ -334,7 +334,13 @@ function Invoke-Aider {
Runs aider with the specified message and file.
.EXAMPLE
PS C:\> Invoke-Aider -Message "Update tests" -File "tests.ps1" -Model "gpt-4o" -CachePrompts
PS C:\> $params = @{
>> Message = "Update tests"
>> File = "tests.ps1"
>> Model = "gpt-4o"
>> CachePrompts = $true
>> }
PS C:\> Invoke-Aider @params
Runs aider using GPT-4 model with prompt caching enabled.
#>
[CmdletBinding()]
Expand All @@ -357,9 +363,11 @@ function Invoke-Aider {
[bool]$AutoLint = $true,
[bool]$AutoTest = $false,
[switch]$ShowPrompts,
[switch]$VerboseOutput,
[string]$EditFormat = 'whole',
[string]$MessageFile,
[string[]]$ReadFile,
[ValidateSet('utf-8', 'ascii', 'unicode', 'utf-16', 'utf-32', 'utf-7')]
[string]$Encoding = 'utf-8'
)

Expand Down Expand Up @@ -423,7 +431,7 @@ function Invoke-Aider {
$params += "--show-prompts"
}

if ($Verbose) {
if ($VerboseOutput) {
$params += "--verbose"
}

Expand Down
4 changes: 3 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
"oderwat.indent-rainbow",
"wengerk.highlight-bad-chars",
"dbatools.search",
"streetsidesoftware.code-spell-checker"
"streetsidesoftware.code-spell-checker",
"bedirt.gpt-token-counter-live",
"saoudrizwan.claude-dev"
],
"settings": {
"powershell.powerShellAdditionalExePaths": {
Expand Down

0 comments on commit e04dee2

Please sign in to comment.