Skip to content

Commit 7e43195

Browse files
crickmanglahayeteresaqhoang
authored
.Net - Format agent output for AskAsync (agent as a plug-in) (#4907)
### 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. --> Agent output unclear for multi-turn interactions: ``` Message1Message2Message3 ``` ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> Separate message on a new line: ``` Message1 Message2 Message3 ``` ### 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 😄 Co-authored-by: Gil LaHaye <[email protected]> Co-authored-by: Teresa Hoang <[email protected]>
1 parent 3a7d3bd commit 7e43195

File tree

1 file changed

+1
-1
lines changed
  • dotnet/src/Experimental/Agents/Internal

1 file changed

+1
-1
lines changed

dotnet/src/Experimental/Agents/Internal/Agent.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ private async Task<AgentResponse> AskAsync(
245245
new AgentResponse
246246
{
247247
ThreadId = thread.Id,
248-
Message = string.Concat(messages.Select(m => m.Content)),
248+
Message = string.Join(Environment.NewLine, messages.Select(m => m.Content)),
249249
};
250250

251251
return response;

0 commit comments

Comments
 (0)