Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Missing usage information in npm azure/openai client response

オープン
#40 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
javascript, nodejs
領域
api

調査の方向性

issue に示されている JavaScript のエントリポイントから始め、npm パッケージの @azure/openai と client.getChatCompletions のレスポンスを含めて確認し、そのフィールドをリンク先の Azure OpenAI のレスポンス例と比較します。レスポンスに要求された使用トークンの詳細が含まれているか、このリポジトリではそれらを提供できないことが明確に示されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

This issue is for a: (mark with an x)
- [ ] bug report -> please search issues before submitting
- [X] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)
Minimal steps to reproduce

On a Javascript application, install the package @azure/openai with npm install @azure/openai
This installs version v1.0.0-beta.5
Within the script, include:

const { OpenAIClient, AzureKeyCredential } = require("@azure/openai");

const client = new OpenAIClient(CHATGPT_EP, new AzureKeyCredential(CHATGPT_KEY));
const deploymentId = "DEPLOYMENT";
const data = await client.getChatCompletions(deploymentId, CHAT_LIST);

console.log(data);
Any log messages given by the failure

image

Expected/desired behavior

I expected the response to include have a field of "usage" (with all the tokens consumption details) as presented in example response in:
https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#example-response-2

OS and Version?

Windows Chrome

Versions

Package version is v1.0.0-beta.5 (azure/openai on npm)

Mention any other details that might be useful

I tried asking in the Microsoft Learn forum but was asked to raise an issue on the github repo, I'm not even sure if this is the right place.
However, I hope to know if it is still possible to somehow get that usage details included within the response without manually adding another tokenization package locally.
Appreciate your assistance.

主要言語
Jupyter Notebook
スター
1.4k
フォーク
455
PR マージ指標
30日以内にマージされた PR はありません

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Azure-Samples/openai のほかの issue

Azure-Samples/openai の issue をすべて見る

似ている issue

Backend & API Design の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。