Skip to content

Commit

Permalink
.Net - Format agent output for AskAsync (agent as a plug-in) (microso…
Browse files Browse the repository at this point in the history
…ft#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]>
  • Loading branch information
3 people authored Feb 7, 2024
1 parent 3a7d3bd commit 7e43195
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dotnet/src/Experimental/Agents/Internal/Agent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ private async Task<AgentResponse> AskAsync(
new AgentResponse
{
ThreadId = thread.Id,
Message = string.Concat(messages.Select(m => m.Content)),
Message = string.Join(Environment.NewLine, messages.Select(m => m.Content)),
};

return response;
Expand Down

0 comments on commit 7e43195

Please sign in to comment.