@@ -79,7 +79,20 @@ function Get-Ollama {
79
79
[Parameter (ValueFromPipelineByPropertyName , ParameterSetName = ' /embeddings' )]
80
80
[Alias (' Options' )]
81
81
[PSObject ]
82
- $Option ,
82
+ $Option = [Ordered ]@ {},
83
+
84
+ [Parameter (ValueFromPipelineByPropertyName , ParameterSetName = ' /generate' )]
85
+ [Parameter (ValueFromPipelineByPropertyName , ParameterSetName = ' /chat' )]
86
+ [Parameter (ValueFromPipelineByPropertyName , ParameterSetName = ' /embeddings' )]
87
+ [int ]
88
+ $Seed ,
89
+
90
+ [Parameter (ValueFromPipelineByPropertyName , ParameterSetName = ' /generate' )]
91
+ [Parameter (ValueFromPipelineByPropertyName , ParameterSetName = ' /chat' )]
92
+ [Parameter (ValueFromPipelineByPropertyName , ParameterSetName = ' /embeddings' )]
93
+ [int ]
94
+ $Temperature ,
95
+
83
96
84
97
# When creating a new model, this is the name of the base model
85
98
[Parameter (ValueFromPipelineByPropertyName , ParameterSetName = ' /create' )]
@@ -373,8 +386,24 @@ function Get-Ollama {
373
386
if ($MyInvocation.InvocationName -ne $MyInvocation.MyCommand.Name ) {
374
387
$argumentList = @ (" run" , $MyInvocation.InvocationName ) + $argumentList
375
388
}
389
+ if ($Format -and -not ($ArgumentList -contains ' --format' )) {
390
+ $argumentList += @ (" --format" , $Format )
391
+ }
376
392
& $ollamaCli @ArgumentList
377
393
}
394
+ {
395
+ $Seed -or $Temperature
396
+ } {
397
+ if ($Seed ) {
398
+ # If we have a seed, set the appropriate option
399
+ $Option [' seed' ] = $Seed
400
+ }
401
+
402
+ if ($Temperature ) {
403
+ # If we have a temperature, set the appropriate option
404
+ $Option [' temperature' ] = $Temperature
405
+ }
406
+ }
378
407
# version is the easiest parameter set
379
408
" /version" {
380
409
# If `-WhatIf` was passed, return the splat.
@@ -461,7 +490,7 @@ function Get-Ollama {
461
490
if ($NoStream ) {
462
491
# say so now.
463
492
$invokeSplat.Body.stream = $false
464
- }
493
+ }
465
494
466
495
# If we have any additional options
467
496
if ($Option ) {
0 commit comments