You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### Motivation and Context
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
1. Why is this change required?
2. What problem does it solve?
3. What scenario does it contribute to?
4. If it fixes an open issue, please link to the issue here.
-->
Additional instruction ``Microsoft.SemanticKernel.AIContext` being added
for streaming invocation of `ChatCompletionAgent`
### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
- Centralize all formatting of additional instructions
- Remove typo that results in `Microsoft.SemanticKernel.AIContext`
additional instruction for streaming `ChatCompletionAgent`
- Clarify type usage
### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [X] The code builds clean without any errors or warnings
- [X] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [X] All unit tests pass, and I have added new tests where possible
- [X] I didn't break anyone 😄
/// Default formatting for additional instructions for the AI agent based on the provided context and invocation options.
390
+
/// </summary>
391
+
/// <param name="context">The context containing relevant information for the AI agent's operation.</param>
392
+
/// <param name="options">Optional parameters that influence the invocation behavior. Can be <see langword="null"/>.</param>
393
+
/// <returns>A formatted string representing the additional instructions for the AI agent.</returns>
394
+
#pragma warning disable SKEXP0130// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
#pragma warning restore SKEXP0130// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
// Get the context contributions from the AIContextProviders.
143
-
#pragma warning disable SKEXP0110// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
#pragma warning disable SKEXP0110,SKEXP0130// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
#pragma warning restore SKEXP0110// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
145
+
#pragma warning restore SKEXP0110,SKEXP0130// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
@@ -232,19 +231,19 @@ public async IAsyncEnumerable<AgentResponseItem<StreamingChatMessageContent>> In
232
231
varkernel=(options?.Kernel??this.Kernel).Clone();
233
232
234
233
// Get the context contributions from the AIContextProviders.
235
-
#pragma warning disable SKEXP0110// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
#pragma warning disable SKEXP0110,SKEXP0130// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
#pragma warning restore SKEXP0110// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
237
+
#pragma warning restore SKEXP0110,SKEXP0130// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
Copy file name to clipboardExpand all lines: dotnet/src/Agents/Bedrock/BedrockAgent.cs
+10-25Lines changed: 10 additions & 25 deletions
Original file line number
Diff line number
Diff line change
@@ -121,16 +121,16 @@ public override async IAsyncEnumerable<AgentResponseItem<ChatMessageContent>> In
121
121
cancellationToken).ConfigureAwait(false);
122
122
123
123
// Get the context contributions from the AIContextProviders.
124
-
#pragma warning disable SKEXP0110// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
#pragma warning restore SKEXP0110// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
124
+
#pragma warning disable SKEXP0110,SKEXP0130// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
#pragma warning restore SKEXP0110,SKEXP0130// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
127
127
128
128
// Ensure that the last message provided is a user message
// Get the context contributions from the AIContextProviders.
265
-
#pragma warning disable SKEXP0110// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
#pragma warning restore SKEXP0110// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
265
+
#pragma warning disable SKEXP0110,SKEXP0130// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
#pragma warning restore SKEXP0110,SKEXP0130// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
268
268
269
269
// Ensure that the last message provided is a user message
// Get the context contributions from the AIContextProviders.
79
-
#pragma warning disable SKEXP0110// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
#pragma warning disable SKEXP0110,SKEXP0130// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
#pragma warning restore SKEXP0110// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
82
+
#pragma warning restore SKEXP0110,SKEXP0130// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
83
83
84
84
// Invoke Chat Completion with the updated chat history.
// Get the context contributions from the AIContextProviders.
176
-
#pragma warning disable SKEXP0110// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
#pragma warning disable SKEXP0110,SKEXP0130// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
#pragma warning restore SKEXP0110// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
177
+
#pragma warning restore SKEXP0110,SKEXP0130// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
180
178
181
179
// Invoke Chat Completion with the updated chat history.
0 commit comments