forked from Azure/azure-sdk-for-net
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Azure OpenAI: Revise streaming behavior for better usability (complet…
…ions + chat completions) (Azure#39347) * DRAFT: unvetted proposal for flattened streaming * add ported functions test * remaining tests ported * completions for consistency * comments, tests, and other cleanup * one orphaned test comment cleanup * xml comment fix * test assets, making it real * test assets pt. 2 (re-record functions) * revised pattern using new StreamingResponse<T> * use delegate resolver for stronger response/enum connection * add a snippet for streaming functions * also add a snippet for streaming with multiple choices * speculative CHANGELOG update * basic, standalone test coverage for StreamingResponse<T> * feedback: keep StreamingResponse<T> in Azure.AI.OpenAI * address missing 'using' on JsonDocument * tie up broken link from changelog * Post-merge: export-api and update-snippets
- Loading branch information
1 parent
f08bdc7
commit 4f17bea
Showing
22 changed files
with
1,195 additions
and
954 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
sdk/openai/Azure.AI.OpenAI/src/Custom/AzureChatExtensionsMessageContext.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
// <auto-generated/> | ||
|
||
#nullable disable | ||
|
||
using System.Collections.Generic; | ||
using Azure.Core; | ||
|
||
namespace Azure.AI.OpenAI | ||
{ | ||
/// <summary> | ||
/// A representation of the additional context information available when Azure OpenAI chat extensions are involved | ||
/// in the generation of a corresponding chat completions response. This context information is only populated when | ||
/// using an Azure OpenAI request configured to use a matching extension. | ||
/// </summary> | ||
public partial class AzureChatExtensionsMessageContext | ||
{ | ||
public ContentFilterResults RequestContentFilterResults { get; internal set; } | ||
public ContentFilterResults ResponseContentFilterResults { get; internal set; } | ||
|
||
internal AzureChatExtensionsMessageContext( | ||
IList<ChatMessage> messages, | ||
ContentFilterResults requestContentFilterResults, | ||
ContentFilterResults responseContentFilterResults) | ||
: this(messages) | ||
{ | ||
RequestContentFilterResults = requestContentFilterResults; | ||
ResponseContentFilterResults = responseContentFilterResults; | ||
} | ||
} | ||
} |
Oops, something went wrong.