Skip to content

Inconsistent API results in CompleteStreamingAsync #48414

@shaybenel

Description

@shaybenel

Type of issue

Code doesn't work

Description

Hi,
We are unable to consistently get FinishReason and Usage in the StreamingResponse returned by CompleteStreamingAsync().

Example that with high probability does not return Usage and FinishReason responses:

{
"messages": [
{
"role": "System",
"content": "Create an introduction to the topic provided by the user. \r\nReply with JSON string serializable to the class {title:string; intro:string;} wrapped in markdown ```json tags."
},
{
"role": "User",
"content": "* 6.1 Britain's Law-and-Order Strategy and Its Consequences\n* 6.2 The Early Years of the Revolution\n* 6.3 War in the South\n* 6.4 Identity during the American Revolution\n* By the end of this section, you will be able to:\n* Explain how Great Britain's response to the destruction of a British shipment of tea in Boston Harbor in 1773 set the stage for the Revolution\n* Describe the beginnings of the American Revolution\n* Great Britain pursued a policy of law and order when dealing with the crises in the colonies in the late 1760s and 1770s.\n* Relations between the British and many American Patriots worsened over the decade, culminating in an unruly mob destroying a fortune in tea by dumping it into Boston Harbor in December 1773 as a protest against British tax laws.\n* The American Revolution had begun.\n* The decade from 1763 to 1774 was a difficult one for the British Empire.\n* Many British colonists in Virginia, as in the other colonies, disapproved of the destruction of the tea in Boston Harbor.\n* New England readied for war.\n* Arguably the most radical pamphlet of the revolutionary era, Common Sense made a powerful argument for independence."
}
]
}

Page URL

https://learn.microsoft.com/en-us/dotnet/api/azure.ai.inference.streamingchatcompletionsupdate?view=azure-dotnet-preview

Content source URL

https://github.com/Azure/azure-docs-sdk-dotnet/blob/master/xml/Azure.AI.Inference/StreamingChatCompletionsUpdate.xml

Document Version Independent Id

f0cae44c-5d29-c034-0ce0-54c78902b764

Article author

@azure-sdk

Metadata

  • ID: 1cb9fee6-58c5-942b-12a7-3f32a8f6ffc4
  • PlatformId: 5c84afc6-4337-3936-63f8-26fc06130662
  • Service: azure

Metadata

Metadata

Assignees

Labels

AI Model InferenceClientThis issue is related to a non-management packageService AttentionWorkflow: This issue is responsible by Azure service team.customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions