Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenAI skill trigger/Return value from pipeline #1102

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
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
19 changes: 19 additions & 0 deletions src/FunctionInfoUtilities.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//

using System.Linq;

namespace Microsoft.Azure.Functions.PowerShellWorker
{
internal class FunctionInfoUtilities
{
private const string assistantSkillTriggerName = "assistantSkillTrigger";

public static bool hasAssistantSkillTrigger(AzFunctionInfo info)
{
return info.InputBindings.Where(x => x.Value.Type == assistantSkillTriggerName).Any();
}
}
}
2 changes: 1 addition & 1 deletion src/PowerShell/PowerShellManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ public Hashtable InvokeFunction(
{
_pwsh.AddCommand(Utils.TracePipelineObjectCmdlet);
}
return ExecuteUserCode(isActivityFunction, outputBindings);
return ExecuteUserCode(isActivityFunction || FunctionInfoUtilities.hasAssistantSkillTrigger(functionInfo), outputBindings);
}
}
catch (RuntimeException e)
Expand Down
2 changes: 1 addition & 1 deletion src/RequestProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ private static void BindOutputFromResult(InvocationResponse response, AzFunction
}
}

if (functionInfo.DurableFunctionInfo.ProvidesForcedDollarReturnValue)
if (functionInfo.DurableFunctionInfo.ProvidesForcedDollarReturnValue || FunctionInfoUtilities.hasAssistantSkillTrigger(functionInfo))
{
response.ReturnValue = results[AzFunctionInfo.DollarReturn].ToTypedData(isDurableData: true);
}
Expand Down
Loading