Azure / azure-sdk-for-net

This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
MIT License
5.25k stars 4.59k forks source link

Add Usage to OpenAI Assistants ThreadRun/RunStep Objects [FEATURE REQ] #42784

Open dmeyeroc opened 6 months ago

dmeyeroc commented 6 months ago

Library name

Azure.AI.OpenAI.Assistants

Please describe the feature.

OpenAI's API reference entries for the Run and Run Step objects shows that there is a nested Usage object that is returned alongside the other properties, however this property doesn't appear to be supported yet in the Azure OpenAI Assistants package.

Would love to see the Usage node added to the ThreadRun and RunStep objects in the Azure OpenAI Assistants package, as this would bring better parity to the OpenAI API.

As it is, it seems like the only way to get this information is to query the OpenAI API outside the Azure SDK.

...
"usage": {
    "prompt_tokens": 123,
    "completion_tokens": 456,
    "total_tokens": 579
}
...

https://platform.openai.com/docs/api-reference/runs/object https://platform.openai.com/docs/api-reference/runs/step-object

github-actions[bot] commented 6 months ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @jpalvarezl @trrwilson.