external help file | Module Name | online version | schema |
---|---|---|---|
PSOpenAI-help.xml |
PSOpenAI |
2.0.0 |
Generate function spcifications for ChatGPT Function calling from PowerShell commands
New-ChatCompletionFunction
[-Command] <String>
[-Description <String>]
[-IncludeParameters <String[]>]
[-ExcludeParameters <String[]>]
[-ParameterSetName <String>]
[<CommonParameters>]
Generate function spcifications for ChatGPT Function calling from PowerShell commands
The generated function spcification is a hash table that can be converted to a JSON string following JSON Schema.
https://platform.openai.com/docs/guides/gpt/function-calling
PS C:\> New-ChatCompletionFunction -Command "New-Item"
Generates a function definition for the New-Item
command.
PS C:\> New-ChatCompletionFunction -Command "Test-Connection" -IncludeParameters ('TargetName', 'Count', 'Delay')
Generate a function spcification for the Test-Connection
command. Only three parameters are included in the function definition: TargetName
, Count
, and Delay
.
PS C:\> New-ChatCompletionFunction -Command "Test-NetConnection" -ParameterSetName "RemotePort" -Description "This command tests TCP connectivity of the specified hosts or address and displays the results."
Generate a function definition for the Test-NetConnection
command. Explicitly specifies the parameter set name and command description.
Specify the name of the PowerShell command.
Type: String
Required: True
Position: 0
Specifies the descriptive text of the PowerShell command. If not specified, the command help description will be used.
Type: String
Required: False
Position: Named
Names of parameters that should not be included in the function definition.
Type: String[]
Required: False
Position: Named
Name of the parameter to be included in the function definition. If this parameter is specified, any unspecified parameters will not be included in the function definition.
Type: String[]
Required: False
Position: Named
If a PowerShell command has multiple parameter sets, the default parameter set is selected by default.
If you want to use a non-default parameter set, specify the set name in this parameter.
Type: String
Required: False
Position: Named
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
https://platform.openai.com/docs/guides/gpt/function-calling