Implemented the stream_options={"include_usage": True} option in the requests for ChatGPT's stream to utilize the API's new feature for token counting. This change allows the application to receive token usage directly from the API, streamlining the process by reducing the need for manual token counting on our end.
Continues to manually count tokens for Azure OpenAI as it does not support this API feature.
Adjusted tests by removing checks for the openai-model header, which was eliminated in this API update.
Implemented the stream_options={"include_usage": True} option in the requests for ChatGPT's stream to utilize the API's new feature for token counting. This change allows the application to receive token usage directly from the API, streamlining the process by reducing the need for manual token counting on our end.