-
Notifications
You must be signed in to change notification settings - Fork 288
Open
Labels
questionCategory: The issue is seeking information about the library or its usage.Category: The issue is seeking information about the library or its usage.
Description
Are user-uploaded attachments supported yet using assistants 2.0?
Our use-case is that a user uploads a file and asks a question about the text content of the file, and the AI model produces a result based on the text content of the file and the user's question.
I've been going through the provided examples and sifting through the code, but I don't see a way of referencing/including uploaded files in an assistant thread message. I only see examples of uploading files to a newly created assistant, or using images as message content, neither of which are what we are trying to do.
...
RunCreationOptions runCreationOptions = new RunCreationOptions()
{
InstructionsOverride = "Sample role",
ModelOverride = "gpt-4o"
}
runCreationOptions.ToolsOverride.Add(new FileSearchToolDefinition());
ThreadCreationOptions threadCreationOptions = new()
{
InitialMessages =
{
new ThreadInitializationMessage(new List<MessageContent>
{
"Hello, assistant! Please tell me something about the contents of this file",
//MessageContent.FromImageFileId(pictureOfAppleFile.Id), // don't need this
//MessageContent.FromImageUrl(linkToPictureOfOrange), // don't need this
// Is there a different way to get it to reference a file that is not an image?
})
},
};
ThreadRun threadRun = await _assistantsClient.CreateThreadAndRunAsync(_assistantId, threadCreationOptions, runCreationOptions)
...
Metadata
Metadata
Assignees
Labels
questionCategory: The issue is seeking information about the library or its usage.Category: The issue is seeking information about the library or its usage.