spring-ai icon indicating copy to clipboard operation
spring-ai copied to clipboard

The withStreamUsage() of the OpenAiChatOptions is not supported in AzureOpenAiChatOptions.

Open hy4470 opened this issue 1 year ago • 3 comments

When using Azure OpenAI, the 'usage' metadata is always returned as empty in the stream().

I understand that 'usage' is supported in the latest OpenAIServiceVersion, V2024_08_01_PREVIEW. Therefore, the AzureOpenAiChatOptions should also support the withStreamUsage() method to align with this.

hy4470 avatar Nov 12 '24 02:11 hy4470

Related Issue: https://github.com/Azure/azure-sdk-for-java/issues/40998

garethjevans avatar Nov 19 '24 15:11 garethjevans

Can we implement this feature now that the issue in the Azure SDK has been resolved?

andresssantos avatar Apr 13 '25 22:04 andresssantos

@andresssantos yes, it seems like this should be possible if you want to take a look, that would be appreciated.

markpollack avatar Apr 21 '25 18:04 markpollack

@markpollack, opened PR https://github.com/spring-projects/spring-ai/pull/2858.

This is my first PR for Spring projects, please feel free to review and share any feedback or suggestions for improvement. I’m open to making adjustments as needed.

andresssantos avatar Apr 23 '25 12:04 andresssantos

closing issue as it has been resolved

markpollack avatar May 06 '25 01:05 markpollack