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

Adding upload file and poll operation with sample and test #31928

Open
wants to merge 4 commits into
base: feature/azure-ai-sdk
Choose a base branch
from

Conversation

ZachhK
Copy link
Member

@ZachhK ZachhK commented Nov 25, 2024

No description provided.

@ZachhK ZachhK marked this pull request as ready for review November 25, 2024 19:26
@ZachhK ZachhK requested review from bterlson, a team and xirzec as code owners November 25, 2024 19:26
@ZachhK ZachhK changed the title Adding upload file and poll operation with sample Adding upload file and poll operation with sample and test Nov 25, 2024
await new Promise(resolve => setTimeout(resolve, sleepInterval));
const updatedResult = await context.path(`/files/${result.body.id}`, result.body.id).get(options);
result.body = updatedResult.body;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Provide a way to stop polling.

@@ -31,6 +31,19 @@ export async function uploadFile(
return result.body;
}

/** Uploads a file for use by other operations. */
export async function uploadFileAndPoll(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to make this an LRO operation? using @azure/core-lro. /cc @joheredi @MaryGao

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ganeshyb would we want to use an LRO here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure actually, could you help me understand what the traffic will look like?

We leverage the first request to upload the file successfully but when this request is back this doesn't mean the server side is completed. So we have following requests to poll status? Will this be the traffic?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants