From 4663bc1e09e36ece4b3f1ff47f64d05002f53ab8 Mon Sep 17 00:00:00 2001 From: Carey Payette Date: Sun, 15 Dec 2024 15:15:21 -0500 Subject: [PATCH] Adds template replacement of tool prompts --- .../Orchestration/OrchestrationBuilder.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/dotnet/Orchestration/Orchestration/OrchestrationBuilder.cs b/src/dotnet/Orchestration/Orchestration/OrchestrationBuilder.cs index a73ef25d2..f10bfb6c7 100644 --- a/src/dotnet/Orchestration/Orchestration/OrchestrationBuilder.cs +++ b/src/dotnet/Orchestration/Orchestration/OrchestrationBuilder.cs @@ -442,6 +442,16 @@ await cosmosDBService.PatchOperationsItemPropertiesAsync( 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);