Skip to content

Commit

Permalink
awesome
Browse files Browse the repository at this point in the history
  • Loading branch information
potatoqualitee committed Nov 2, 2024
1 parent 7821850 commit 3117d18
Show file tree
Hide file tree
Showing 2 changed files with 231 additions and 37 deletions.
15 changes: 10 additions & 5 deletions .aider/aider.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ function Update-PesterTest {
.PARAMETER Model
The AI model to use (e.g., azure/gpt-4o, gpt-4o-mini, claude-3-5-sonnet).
.PARAMETER LargeFileModel
The AI model to use for files exceeding the MaxFileSize limit. Defaults to "gpt-4o-mini".
.PARAMETER EditFormat
Specifies the format for edits. Choices include "whole", "diff", "diff-fenced", "unified diff", "editor-diff", "editor-whole".
Expand Down Expand Up @@ -67,7 +70,7 @@ function Update-PesterTest {
[string]$Model,
[string]$LargeFileModel = "gpt-4o-mini",
[ValidateSet("whole", "diff", "diff-fenced", "unified diff", "editor-diff", "editor-whole")]
[string]$EditFormat
[string]$EditFormat = "whole"
)
begin {
$commandsToProcess = @()
Expand Down Expand Up @@ -127,9 +130,11 @@ function Update-PesterTest {
# Determine processing mode based on file size
if ((Get-Item $filename).Length -gt $MaxFileSize) {
# Process large files in segmented passes
if ($PSBoundParameters.PrompFilePath) {
$files = $PSBoundParameters.PromptFilePath
if ($PSBoundParameters.ContainsKey("PromptFilePath")) {
Write-Verbose "Using specified prompt file for segmented pass"
$files = Get-ChildItem -Path $PSBoundParameters.PromptFilePath
} else {
Write-Verbose "Using default prompt files for segmented pass"
$files = Get-ChildItem -Path "/workspace/.aider/prompts/segmented" -Filter "*.md"
}

Expand All @@ -146,7 +151,7 @@ function Update-PesterTest {
NoStream = $true
CachePrompts = $true
Model = $LargeFileModel
EditFormat = if ($EditFormat) { $EditFormat } else { "whole" }
EditFormat = $EditFormat
}

Write-Verbose "Invoking Aider for segmented pass on $filename using $($file.Name)"
Expand All @@ -168,7 +173,7 @@ function Update-PesterTest {
CachePrompts = $true
ReadFile = $CacheFilePath
Model = $Model
EditFormat = if ($EditFormat) { $EditFormat } else { "whole" }
EditFormat = $EditFormat
}

Write-Verbose "Invoking Aider to update test file normally"
Expand Down
Loading

0 comments on commit 3117d18

Please sign in to comment.