We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 69bd5f4 + f5aacf1 commit 73a50c0Copy full SHA for 73a50c0
1 file changed
Public/Invoke-OAIFunctionCall.ps1
@@ -26,7 +26,12 @@ function Invoke-OAIFunctionCall {
26
Write-Verbose "$toolFunctionName $($toolFunctionArgs | ConvertTo-Json -Compress)"
27
28
if (Get-Command $toolFunctionName -ErrorAction SilentlyContinue) {
29
- $result = & $toolFunctionName @toolFunctionArgs
+ try {
30
+ $result = & $toolFunctionName @toolFunctionArgs
31
+ }
32
+ catch {
33
+ $result = "Error invoking function $($toolFunctionName) with arguments $($toolCall.function.arguments): $_"
34
35
}
36
else {
37
$result = "Function $toolFunctionName not found"
0 commit comments