Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ public async Task<IActionResult> ChatAsync(
/// </summary>
private async Task RegisterPlannerSkillsAsync(CopilotChatPlanner planner, OpenApiSkillsAuthHeaders openApiSkillsAuthHeaders, ContextVariables variables)
{
// Register Transform output skill
planner.Kernel.ImportSemanticSkillFromDirectory(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "CopilotChat", "Skills"), "DataTransformationSkills");

// Register authenticated skills with the planner's kernel only if the request includes an auth header for the skill.

// Klarna Shopping
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"schema": 1,
"description": "Format or transform context variables for plan functions. Use this method when a function parameter requires a specific format (such as list or JSON string) or transformation (such as filtering or capitalization) that is not already done by another function. If unsure whether a function's output matches a subsequent function's input, use this method.",
"type": "completion",
"completion": {
"max_tokens": 1000,
"temperature": 0.0,
"top_p": 0.0,
"presence_penalty": 0.0,
"frequency_penalty": 0.0,
"stop_sequences": [
"[END FORMATTEDOUTPUT]"
]
},
"input": {
"parameters": [
{
"name": "rationale",
Comment thread
thomasgobin marked this conversation as resolved.
"description": "Description of the specific format or transformation that must be applied to inputVariable to respect the requested format or transformation. Must be as precise as possible and can contain examples of the expected result if available",
"defaultValue": ""
},
{
"name": "outputFormat",
Comment thread
thomasgobin marked this conversation as resolved.
"description": "Description of the format of the output. Must be as precized as possible and can contain examples of the expected result if available (it can for example include the specific request format such a the JSON description or an example given in the parameter description of the called function)",
"defaultValue": ""
},
{
"name": "inputVariable",
"description": "Input data, coming from a previous function, that must be formatted or transformed",
"defaultValue": ""
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
A function is composed of parameters, the goal is to apply a transformation or specific formatting to respect the requirement of a parameter function. Considering the description of the transformation or formatting to apply ([RATIONALE] section), format of the expected output ([outputFormat] section) and goal of the global plan ([GOAL] section), format the content of the input ([inputVariable] section) to respect all requirements.

[START EXAMPLE]
[START inputVariable]
Here is the list of Stores: [Paris Saint Sulpice,Paris Auteuil, Cannes]
[END inputVariable]
[START outputFormat]Comma separated list of store names (example: Paris Saint Sulpice,Cannes)[END outputFormat]
[START GOAL]User intent: Please search for black t-shirts made of wool fabric and provide me with their availability at stores located in Paris.[END GOAL]
[START RATIONALE]Filter the list of stores to only include stores located in Paris[END RATIONALE]
[START FORMATTEDOUTPUT]
Paris Saint Sulpice,Paris Auteuil
[END FORMATTEDOUTPUT]
[END EXAMPLE]

Real data start here :
[START inputVariable]
{{$inputVariable}}
[END inputVariable]
[START outputFormat]
{{$outputFormat}}
[END outputFormat]
[START GOAL]{{$planUserIntent}}[END GOAL]
[START RATIONALE]{{$rationale}}[END RATIONALE]
[START FORMATTEDOUTPUT]
12 changes: 12 additions & 0 deletions samples/apps/copilot-chat-app/webapi/CopilotChatWebApi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,16 @@
<_Parameter1>false</_Parameter1>
</AssemblyAttribute>
</ItemGroup>

<ItemGroup>
<Content Include="CopilotChat\Skills\DataTransformationSkills\TransformOutputSkill\skprompt.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>

<ItemGroup>
<Content Update="CopilotChat\Skills\DataTransformationSkills\TransformOutputSkill\config.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
</Project>