Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions code365scripts.openai/Private/Functions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,19 @@ function Get-FunctionJson {

# generate a json object based on the help content of the function
$help = Get-Help $functionName

# if the help doesn't include description, return null
if (-not $help.description) {
Write-Warning "Function $functionName does not have a description."
return $null
}

# if any parameters don't include description, return null
if ($help.parameters.parameter | Where-Object { -not $_.description }) {
Write-Warning "Function $functionName has parameters without description."
return $null
}

$json = [pscustomobject]@{
type = "function"
function = @{
Expand Down
3 changes: 1 addition & 2 deletions code365scripts.openai/Public/New-ChatGPTConversation.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,8 @@ function New-ChatGPTConversation {
if ($functions) {
$tools = @(Get-PredefinedFunctions -names $functions)

Write-Verbose ($tools | ConvertTo-Json -Depth 10)

if ($tools.Count -gt 0) {
Write-Verbose ($tools | ConvertTo-Json -Depth 10)
if ($null -eq $config) {
$config = @{}
}
Expand Down