microsoft / microsoft/semantic-kernel-java

Java: Add rate limit metadata values to OpenAIStreamingChatMessageContent and OpenAIChatMessageContent

Open
#203 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

java
Dominant language
Java
Stars
276
Forks
56
Avg merge
17h 45m
Merged PRs (30d)
4

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate OpenAIStreamingChatMessageContent and OpenAIChatMessageContent, then trace how their Metadata dictionaries are populated from Azure OpenAI chat completion responses. Add the x-rate-limit-remaining-requests and x-ratelimit-remaining-tokens values to both metadata dictionaries and verify that streaming and non-streaming responses expose them.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.