| external help file | PSOpenAI-help.xml |
|---|---|
| Module Name | PSOpenAI |
| online version | https://github.com/mkht/PSOpenAI/blob/main/Docs/New-ChatCompletionFunction.md |
| schema | 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://developers.openai.com/api/docs/guides/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: 0Specifies the descriptive text of the PowerShell command. If not specified, the command help description will be used.
Type: String
Required: False
Position: NamedNames of parameters that should not be included in the function definition.
Type: String[]
Required: False
Position: NamedName 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: NamedIf 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: NamedThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
https://developers.openai.com/api/docs/guides/function-calling/