Skip to content

Commit

Permalink
Merge pull request #2080 from solliancenet/cp-tool-prompt-template
Browse files Browse the repository at this point in the history
Adds template replacement of tool prompts
  • Loading branch information
ciprianjichici authored Dec 15, 2024
2 parents 3504a54 + 4663bc1 commit 1c03b02
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/dotnet/Orchestration/Orchestration/OrchestrationBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,16 @@ await cosmosDBService.PatchOperationsItemPropertiesAsync<LongRunningOperationCon
var prompt = await promptResourceProvider.GetResourceAsync<PromptBase>(
resourceObjectId.ObjectId,
currentUserIdentity);
if (prompt is MultipartPrompt multipartPrompt)
{
// prompt template token replacement
if (multipartPrompt is not null)
{

multipartPrompt.Prefix = templatingService.Transform(multipartPrompt.Prefix!);
multipartPrompt.Suffix = templatingService.Transform(multipartPrompt.Suffix!);
}
}
explodedObjectsManager.TryAdd(
resourceObjectId.ObjectId,
prompt);
Expand Down

0 comments on commit 1c03b02

Please sign in to comment.