Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.Net Agents - Harden Assistant handling of FunctionResultContent #9706

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

crickman
Copy link
Contributor

@crickman crickman commented Nov 14, 2024

Performing additional testing and adding integration test

Motivation and Context

Normally a ChatMessageContent created in response to a function call result has two entries in its Items collection:

  1. The core FunctionResultContent item
  2. A TextContent item that present the textual representation of the FunctionResultContent.Result

When only the a single FunctionResultContent is present then this results an a thread message being created without any content:

Microsoft.Azure.Migrate.Export.Copilot.AmeCopilotRequestHandler[0]
      One or more errors occurred. (HTTP 400 (invalid_request_error: empty_array)
      Parameter: content 
     Invalid 'content': empty array. Expected an array with minimum length 1, but got an empty array instead.)

Description

Handle case when a message contains only FunctionResultContent and covert result to string.

Contribution Checklist

@crickman crickman added bug Something isn't working PR: ready for review All feedback addressed, ready for reviews .NET Issue or Pull requests regarding .NET code experimental Associated with an experimental feature enhancement agents labels Nov 14, 2024
@crickman crickman self-assigned this Nov 14, 2024
@crickman crickman requested a review from a team as a code owner November 14, 2024 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agents bug Something isn't working enhancement experimental Associated with an experimental feature .NET Issue or Pull requests regarding .NET code PR: ready for review All feedback addressed, ready for reviews
Projects
Status: Sprint: In Review
Development

Successfully merging this pull request may close these issues.

1 participant