Skip to content

[BUG] Additional messages cannot be added when using CreateRunStreamingAsync or CreateRunAsync #47244

@sandrohanea

Description

@sandrohanea

Library name and version

Azure.AI.Projects 1.0.0-alpha.20241114.1

Describe the bug

When trying to run an assistant turn, and add additional user messages in a single call, the SDK is not allowing it.

The reason is that additionalMessages property is of type IEnumerable<ThreadMessage> additionalMessages = null for both CreateRunStreamingAsync and CreateRunAsync

As an SDK user, I'm not able to construct that object (which requires Id, ThreadId, assistantId, etc) in order to store additional messages before running the thread run,

CreateMessageAsync is using less properties and can be called without these properties (Id, createddate, etc):
Image

Alternative, call the CreateMessageAsync before calling the CreateRunAsync():
Image

But this will result in unnecessary calls the Agent API.

Please, change the additionalMessages to a property similar with CreateMessageRequest (that is currently internal) in order to be able to send additional messages when running the agent response.

Expected behavior

It is expected to be able to add additional messages when creating the thread run.

Actual behavior

It is not possible to add the additional messages

Reproduction Steps

See above

Environment

Host:
Version: 9.0.0
Architecture: x64
Commit: 9d5a6a9aa4

Metadata

Metadata

Assignees

Labels

AI ProjectsClientThis issue is related to a non-management package

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions