microsoft / semantic-kernel-java

Semantic Kernel for Java. Integrate cutting-edge LLM technology quickly and easily into your Java based apps. See https://aka.ms/semantic-kernel.
MIT License
98 stars 18 forks source link

Java: Add rate limit metadata values to OpenAIStreamingChatMessageContent and OpenAIChatMessageContent #203

Open d3r3kk opened 2 months ago

d3r3kk commented 2 months ago

Raw Azure OpenAi chat completion response contains additional headers, which contain information about rate limits: x-rate-limit-remaining-requests and x-ratelimit-remaining-tokens. Would it be possible to add these values to the Metadata dictionary in both OpenAIStreamingChatMessageContent and OpenAIChatMessageContent class? I find rate limit information useful, but in current .Net implementation there is no way to access it.

See microsoft/semantic-kernel#8421 for the .NET version of this issue.