checking if the value of the metric is an int #3911
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
When using the OpenAI connection in a Python code, I was getting the warning
This is due to Azure OpenAI returning the following object in "usage"
The code is adding the value of each key in usage without checking the value type, which is causing it to add a dictionary
completion_tokens_details
instead of avoiding it.I just added a check to ensure it only adds int values.
This error is affecting grouping calls in Application Insights in Azure, and we are unable to see the flow of the request.
Issue: 3910
All Promptflow Contribution checklist:
General Guidelines and Best Practices