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: New Feature: OpenAIAssistantAgent's AddChatMessageAsync for files. #9790

Open
aeras3637 opened this issue Nov 22, 2024 · 1 comment
Open
Assignees
Labels
agents experimental Associated with an experimental feature follow up Issues that require a follow up from the community. .NET Issue or Pull requests regarding .NET code question Further information is requested

Comments

@aeras3637
Copy link


name: OpenAIAssistantAgent's AddChatMessageAsync for files.
Please use OpenAIAssistantAgent's AddChatMessageAsync to correspond to the file.

You may want to upload a file in the middle of an Agent's conversation.
In AssistantMessageFactory.CreateOptions, only Metadata is supported and there is no way to pass FileId.
If FileReferenceContent is included in Items of ChatMessageContent, please set it to Attachments in MessageCreationOptions.


@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code agents and removed triage labels Nov 22, 2024
@github-actions github-actions bot changed the title New Feature: OpenAIAssistantAgent's AddChatMessageAsync for files. .Net: New Feature: OpenAIAssistantAgent's AddChatMessageAsync for files. Nov 22, 2024
@crickman crickman added experimental Associated with an experimental feature question Further information is requested labels Nov 22, 2024
@crickman crickman moved this to Sprint: In Progress in Semantic Kernel Nov 22, 2024
@crickman
Copy link
Contributor

Hi @aeras3637, thank you for this suggestion. I'm curious on which type of file you are aiming to upload?

The Assistant API support both text and image content for input messages; although, Azure services / deployments are restricted to text-only.

All other file content must be either referenced from a Vector Store (for the file-search tool) or as a tool resource (for the code-interpreter tool). You may add files to a referenced vector store at any point using the OpenAIFileClient , as shown here:

https://github.com/microsoft/semantic-kernel/blob/main/dotnet/samples/GettingStartedWithAgents/Step11_AssistantTool_FileSearch.cs

Additionally, files specific to a particular thread may be specified upon thread-creation via: https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/Agents/OpenAI/OpenAIThreadCreationOptions.cs

(Either code-interpreter files, or a Vector Store for file-search).

From a design perspective, we chose to avoid managing , obfuscating, or otherwise interfering with how a developer might defined and update a Vector Store.

In terms of providing file-content to an assistant, we are constrained by what is possible via the API:

https://platform.openai.com/docs/api-reference/assistants

With that said, I'd very much be open to continuing to explore your proposal. Looking forward to your response.

@crickman crickman added the follow up Issues that require a follow up from the community. label Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agents experimental Associated with an experimental feature follow up Issues that require a follow up from the community. .NET Issue or Pull requests regarding .NET code question Further information is requested
Projects
Status: Sprint: In Progress
Development

No branches or pull requests

3 participants