ragas icon indicating copy to clipboard operation
ragas copied to clipboard

feat: Add utility to extract token usage from Azure AI-compatible LLM results

Open GoncaloGuedes opened this issue 8 months ago • 0 comments

Description: This PR adds a helper function to extract token usage from LLMResult or ChatResult, using the Azure AI response format returned by LangChain.

Key Changes:

  • Added get_token_usage_for_azure_ai utility, supporting Azure AI's token usage format as returned by LangChain.
  • Implemented unit tests to validate behavior.

GoncaloGuedes avatar Apr 11 '25 09:04 GoncaloGuedes