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

[BUG] Unable to upload a file through UploadFileAsync #43800

Open
shivanandpatil512 opened this issue May 1, 2024 · 6 comments
Open

[BUG] Unable to upload a file through UploadFileAsync #43800

shivanandpatil512 opened this issue May 1, 2024 · 6 comments
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention This issue is responsible by Azure service team. Storage Storage Service (Queues, Blobs, Files)

Comments

@shivanandpatil512
Copy link

Library name and version

Azure.AI.OpenAI.Assistants 1.0.0-beta.4

Describe the bug

We have a .Net Core API and we have installed Azure.AI.OpenAI.Assistants 1.0.0-beta.4 nuget package.
We are trying to upload a file through .Net Core API using the AssistantsClient.UploadFileAsync it is failing with weird error.
Below is the code we tried with

var workingDirectory = AppContext.BaseDirectory;
string filePath = Path.Combine(workingDirectory, fileName);
await File.WriteAllTextAsync(filePath, fileContent);
var fileUploadResponse = await _assistantsClient.UploadFileAsync(filePath, OpenAIFilePurpose.Assistants);
await _assistantsClient.LinkAssistantFileAsync(assistantId, fileUploadResponse.Value.Id);

But, await _assistantsClient.UploadFileAsync(filePath, OpenAIFilePurpose.Assistants); fails with below error

Additional properties are not allowed ('filename' was unexpected)
Status: 400 (Bad Request)

Content:
{
  "error": {
    "message": "Additional properties are not allowed ('filename' was unexpected)",
    "type": "invalid_request_error",
    "param": null,
    "code": null
  }
}

But same code works fine if we try it in windows form application.

Expected behavior

File should get uploaded to Assistant.

Actual behavior

We get this error

Additional properties are not allowed ('filename' was unexpected)
Status: 400 (Bad Request)

Content:
{
  "error": {
    "message": "Additional properties are not allowed ('filename' was unexpected)",
    "type": "invalid_request_error",
    "param": null,
    "code": null
  }
}

Reproduction Steps

In any .Net Core API application try the code mentioned in the description.

Environment

No response

@github-actions github-actions bot added Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention This issue is responsible by Azure service team. Storage Storage Service (Queues, Blobs, Files) labels May 1, 2024
Copy link

github-actions bot commented May 1, 2024

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @xgithubtriage.

@shivanandpatil512
Copy link
Author

Do we have any ETA on this?

@denileo82
Copy link

same issue here, any solution?

@Esmeralda2001
Copy link

I'm having the exact same issue, is there any update on when Azure will fix this?

@nicklasjepsen
Copy link

I had the same issue after updating nugets.

🛠️Downgrading to the following nuget versions is a workaround for the time being🛠️
Azure.AI.OpenAI 1.0.0-beta.16
Azure.AI.OpenAI.Assistants 1.0.0-beta.3

Here's the request that is working fine with 1.0.0-beta.16 and 1.0.0-beta.3:
image

And this is after updating to 1.0.0-beta.17 and 1.0.0-beta.4:
image

...which is failing with:

{
  "error": {
    "message": "Additional properties are not allowed ('filename' was unexpected)",
    "type": "invalid_request_error",
    "param": null,
    "code": null
  }
}

@aaronsarkissian
Copy link

Same here, downgrading helped for the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention This issue is responsible by Azure service team. Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
Development

No branches or pull requests

5 participants