Skip to content

Commit ae373d3

Browse files
committed
Release 1.214.2025
1 parent 4d9c218 commit ae373d3

4 files changed

Lines changed: 46 additions & 40 deletions

File tree

Functions/GenXdev.AI.LMStudio/Get-LMStudioTextEmbedding.ps1

Lines changed: 38 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,7 @@ function Get-LMStudioTextEmbedding {
130130
HelpMessage = 'Text to get embeddings for',
131131
ValueFromPipeline = $true
132132
)]
133-
[ValidateNotNullOrEmpty()]
134-
[string[]]$Text,
133+
[object] $InputObject,
135134
########################################################################
136135
[Parameter(
137136
Mandatory = $false,
@@ -434,40 +433,45 @@ function Get-LMStudioTextEmbedding {
434433

435434
process {
436435

437-
# write verbose message about processing text items
438-
Microsoft.PowerShell.Utility\Write-Verbose ('Processing embeddings ' +
439-
"request for $($Text.Length) text items")
436+
$InputObject | ForEach-Object -ErrorAction SilentlyContinue {
437+
$text = "$PSItem";
438+
if ([string]::IsNullOrWhiteSpace($text)) { return }
440439

441-
# create api request payload with model and input text
442-
$payload = @{
443-
model = $Model
444-
input = $Text
445-
}
440+
# write verbose message about processing text items
441+
Microsoft.PowerShell.Utility\Write-Verbose ('Processing embeddings ' +
442+
"request for $($Text.Length) text items")
443+
444+
# create api request payload with model and input text
445+
$payload = @{
446+
model = $Model
447+
input = $Text
448+
}
446449

447-
# convert payload to compressed json with deep nesting support
448-
$json = $payload |
449-
Microsoft.PowerShell.Utility\ConvertTo-Json -Depth 60 -Compress
450-
451-
# encode json string to utf8 bytes for api transmission
452-
$bytes = [System.Text.Encoding]::UTF8.GetBytes($json)
453-
454-
# invoke embeddings api with extended timeout for large requests
455-
$response = Microsoft.PowerShell.Utility\Invoke-RestMethod `
456-
-Uri $apiUrl `
457-
-Method Post `
458-
-Body $bytes `
459-
-Headers $headers `
460-
-OperationTimeoutSeconds (3600 * 24) `
461-
-ConnectionTimeoutSeconds (3600 * 24)
462-
463-
# process each embedding result and create output objects
464-
foreach ($embedding in $response.data) {
465-
466-
# create custom object with embedding data and context
467-
[PSCustomObject]@{
468-
embedding = $embedding.embedding
469-
index = $embedding.index
470-
text = $Text[$embedding.index]
450+
# convert payload to compressed json with deep nesting support
451+
$json = $payload |
452+
Microsoft.PowerShell.Utility\ConvertTo-Json -Depth 60 -Compress
453+
454+
# encode json string to utf8 bytes for api transmission
455+
$bytes = [System.Text.Encoding]::UTF8.GetBytes($json)
456+
457+
# invoke embeddings api with extended timeout for large requests
458+
$response = Microsoft.PowerShell.Utility\Invoke-RestMethod `
459+
-Uri $apiUrl `
460+
-Method Post `
461+
-Body $bytes `
462+
-Headers $headers `
463+
-OperationTimeoutSeconds (3600 * 24) `
464+
-ConnectionTimeoutSeconds (3600 * 24)
465+
466+
# process each embedding result and create output objects
467+
foreach ($embedding in $response.data) {
468+
469+
# create custom object with embedding data and context
470+
[PSCustomObject]@{
471+
embedding = $embedding.embedding
472+
index = $embedding.index
473+
text = $Text[$embedding.index]
474+
}
471475
}
472476
}
473477
}

Functions/GenXdev.AI.Queries/Get-Fallacy.ps1

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ function Get-Fallacy {
148148
Mandatory = $true,
149149
HelpMessage = 'Text to parse to find Fallacies in'
150150
)]
151-
[string[]]$Text,
151+
[object] $InputObject,
152152
#######################################################################
153153
[Parameter(
154154
Position = 1,
@@ -710,7 +710,9 @@ Return nothing.
710710
process {
711711

712712
# iterate through each text part provided for analysis
713-
foreach ($textPart in $Text) {
713+
$InputObject | ForEach-Object -ErrorAction SilentlyContinue {
714+
$textPart = "$PSItem";
715+
if ([string]::IsNullOrWhiteSpace($textPart)) { return }
714716

715717
# output verbose information about parameter preparation
716718
Microsoft.PowerShell.Utility\Write-Verbose `

Functions/GenXdev.AI/Start-GenXdevMCPServer.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ function Start-GenXdevMCPServer {
9999
}
100100
serverInfo = @{
101101
name = 'GenXdev-PowerShell-MCP-Server'
102-
version = '1.212.2025'
102+
version = '1.214.2025'
103103
}
104104
}
105105
}
@@ -197,7 +197,7 @@ function Start-GenXdevMCPServer {
197197
}
198198
serverInfo = @{
199199
name = 'GenXdev-PowerShell-MCP-Server'
200-
version = '1.212.2025'
200+
version = '1.214.2025'
201201
}
202202
}
203203
}

GenXdev.AI.psd1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
RootModule = 'GenXdev.AI.psm1'
1313

1414
# Version number of this module.
15-
ModuleVersion = '1.212.2025'
15+
ModuleVersion = '1.214.2025'
1616

1717
# Supported PSEditions
1818
CompatiblePSEditions = 'Core'
@@ -51,7 +51,7 @@ ClrVersion = '9.0.0.1'
5151
ProcessorArchitecture = 'Amd64'
5252

5353
# Modules that must be imported into the global environment prior to importing this module
54-
RequiredModules = @(@{ModuleName = 'GenXdev.Queries'; ModuleVersion = '1.212.2025'; })
54+
RequiredModules = @(@{ModuleName = 'GenXdev.Queries'; ModuleVersion = '1.214.2025'; })
5555

5656
# Assemblies that must be loaded prior to importing this module
5757
# RequiredAssemblies = @()

0 commit comments

Comments
 (0)