azure-rest-api-specs icon indicating copy to clipboard operation
azure-rest-api-specs copied to clipboard

[Question] When Azure will sync OpenAI ChatCompletion stream_options feature ?

Open SKYhuangjing opened this issue 1 year ago • 15 comments

API Spec link

https://github.com/Azure/azure-rest-api-specs/blob/main/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2024-04-01-preview/inference.json

API Spec version

2024-04-01-preview

Question/Query

OpenAI ChatCompletion API has add stream_options {include_usage} for stream get usage, it will help developer to statistics the api cost, it's very good for us, so when azure will sync it?

Environment

REST API invoke it

SKYhuangjing avatar May 20 '24 02:05 SKYhuangjing

@YunsongB Please help have a look, thank you.

zzhxiaofeng avatar May 20 '24 07:05 zzhxiaofeng

+1

dq7532183 avatar May 20 '24 07:05 dq7532183

+1

dbg-raghulkrishna avatar May 22 '24 07:05 dbg-raghulkrishna

+1

dzmitryi-h avatar May 24 '24 09:05 dzmitryi-h

Feat request here https://github.com/Azure/azure-sdk-for-net/issues/44237

janaka avatar May 28 '24 10:05 janaka

any update? @zzhxiaofeng @YunsongB

SKYhuangjing avatar Jun 03 '24 01:06 SKYhuangjing

+1

elabbarw avatar Jun 04 '24 07:06 elabbarw

+1+1+1

supuwoerc avatar Jun 05 '24 04:06 supuwoerc

+1

pedro-n-rocha avatar Jun 11 '24 10:06 pedro-n-rocha

I'm guessing this all now comes along with the new OpenAI client that pulled in v2.0.x

janaka avatar Jun 11 '24 12:06 janaka

when?

dq7532183 avatar Jun 21 '24 02:06 dq7532183

https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/openai/Azure.AI.OpenAI/CHANGELOG.md#200-beta3-unreleased

janaka avatar Jun 21 '24 14:06 janaka

Hi, I tried with 2024-05-01-preview but still get the error. 400 bad request. I think it needs to be enabled on the server side, not client.

sandangel avatar Jun 28 '24 03:06 sandangel

+1

sergiogarlez avatar Jul 03 '24 10:07 sergiogarlez

Even in the new OpenAI lib (That Azure OpenAI v2.0.* depends on), this isn't implemented yet.

See https://github.com/openai/openai-dotnet/issues/103#issuecomment-2201442467

janaka avatar Jul 03 '24 13:07 janaka

Are there any update on this issue?

mfournioux avatar Jul 17 '24 06:07 mfournioux

Bump. Hoping to see this implemented.

Funnyguy77 avatar Jul 31 '24 18:07 Funnyguy77

It appears that the OpenAI API is prepared to accommodate token usage reporting, as evidenced by the IncludeUsage = true setting in the Azure.AI.OpenAI v2 SDK implementation. While the specific obstacles preventing REST API support remain unclear, there is likely a substantial number of developers who desire to obtain token usage information via the Streaming API. Given that the current situation necessitates manual calculation of token usage, which is a considerable inconvenience, we earnestly hope for prompt support of this feature.

xin9le avatar Aug 06 '24 03:08 xin9le

Given that the current situation necessitates manual calculation of token usage, which is a considerable inconvenience, we earnestly hope for prompt support of this feature.

I would also like to note that manual token calculation is often not accurate, in addition to being a large inconvenience. Making this feature even more desirable to developers, like myself.

Funnyguy77 avatar Aug 07 '24 13:08 Funnyguy77

This would be very useful - as @Funnyguy77 said, counting tokens manually is very error prone, and not maintainable.

DrShushen avatar Aug 10 '24 14:08 DrShushen

It would be great if the Azure OpenAI team could give customers some indication as to when this feature will be released.

In general you really need to do a better job communicating the policy for maintaining feature parity with OpenAI feature releases. Right not this is one of several inference features that many are waiting on with absolutely no info on the Azure OpenAI teams intentions.

janaka avatar Aug 12 '24 12:08 janaka

When I try to request gpt-4o-mini, stream_options is valid for me but not for other models. Why is this inconsistency happening?

MartialBE avatar Aug 21 '24 08:08 MartialBE

https://github.com/Azure/azure-rest-api-specs/pull/30087 it seems have some update, but not nofity us.

SKYhuangjing avatar Aug 22 '24 01:08 SKYhuangjing

When I try to request gpt-4o-mini, stream_options is valid for me but not for other models. Why is this inconsistency happening?

Compare eastus & northcentralus API Result (api_version = 2024-07-01-preview)

  • eastus has support stream_options
  • northcentralus has not support it hard to see why...

SKYhuangjing avatar Aug 22 '24 10:08 SKYhuangjing

When I try to request gpt-4o-mini, stream_options is valid for me but not for other models. Why is this inconsistency happening?

Compare eastus & northcentralus API Result (api_version = 2024-07-01-preview)

  • eastus has support stream_options
  • northcentralus has not support it hard to see why...

iirc for another feature (tool_choice=required) somebody reported similar that it's avail in one region but not another. I think with that it was avail in one of the euro region but not in eastus.

janaka avatar Aug 22 '24 13:08 janaka

How is it going? Can't imagine it has been a long long time and Azure still cannot catch up with this feature even in the preview API version! :))

SoulBlaze4j avatar Sep 03 '24 06:09 SoulBlaze4j

I'm currently in the swedencentral/northcentralus/japaneast regions, and stream_options is working correctly. Is it fully available now? api-version: 2024-07-01-preview

MartialBE avatar Oct 05 '24 18:10 MartialBE

has been released https://learn.microsoft.com/zh-cn/azure/ai-services/openai/api-version-deprecation#changes-between-2024-09-01-preview-and-2024-08-01-preview

SKYhuangjing avatar Oct 09 '24 02:10 SKYhuangjing

has been released learn.microsoft.com/zh-cn/azure/ai-services/openai/api-version-deprecation#changes-between-2024-09-01-preview-and-2024-08-01-preview

GPT-4 vision-preview still does not support this feature, I tested in westus region and it returned { "error": { "message": "1 validation error for Request\nbody -> stream_options\n extra fields not permitted (type=value_error.extra)", "type": "invalid_request_error", "param": null, "code": null } }

SoulBlaze4j avatar Oct 09 '24 06:10 SoulBlaze4j

+1

kglmcodes avatar Nov 19 '24 03:11 kglmcodes