Skip to content

.Net: Add Streaming Support for RestApiOperationRunner - #7949

Closed
zhikaiwang (FriedChickenOnTheWay) wants to merge 3 commits into
microsoft:mainfrom
FriedChickenOnTheWay:main
Closed

zhikaiwang (FriedChickenOnTheWay) wants to merge 3 commits into
microsoft:mainfrom
FriedChickenOnTheWay:main

Conversation

@FriedChickenOnTheWay

Copy link
Copy Markdown

Motivation and Context

When using plugins that run on OpenApi, we may need to perform time consuming tasks such as summarizing large documents. Waiting for the response as a string would be too slow. Therefore, we require the streaming feature to enhance plugin performance. Our Rest API currently supports HTTP streaming based on HTTP/1.1, which can return chunks as a stream if the header includes 'x-stream: true'.

Description

If the request header contains "x-stream": true, send an HTTP request with HttpCompletionOption set to ResponseHeadersRead and serialize and return the response as a Stream object. We use the HttpResponseStream to defer the dispose of HttpResponseMessage.

Contribution Checklist

@markwallace-microsoft Mark Wallace (markwallace-microsoft) added the .NET Issue or Pull requests regarding .NET code label Aug 7, 2024
@github-actions github-actions Bot changed the title Add Streaming Support for RestApiOperationRunner .Net: Add Streaming Support for RestApiOperationRunner Aug 7, 2024
@FriedChickenOnTheWay

Copy link
Copy Markdown
Author

zhikaiwang (@FriedChickenOnTheWay) please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement

@FriedChickenOnTheWay

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree company="Microsoft"

@FriedChickenOnTheWay

Copy link
Copy Markdown
Author

zhikaiwang (@FriedChickenOnTheWay) please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement

@microsoft-github-policy-service agree company="Microsoft"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

.NET Issue or Pull requests regarding .NET code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants