Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ai-proxy): add analytics for chat route_type of anthropic #12781

Merged
merged 5 commits into from
Apr 11, 2024

Conversation

liverpool8056
Copy link
Contributor

Summary

fix a bug that the analystics is not included in the response of the chat route_type of anthropic

Checklist

Issue reference

FTI-5769

@liverpool8056
Copy link
Contributor Author

The failure of test cases should probably be fixed after #12699.

@RobSerafini RobSerafini added this to the 3.7.0 milestone Apr 8, 2024
log statistics, and fix a bug that Anthropic don't provide log
statistics in `chat` route_type.

FTI-5769
2. remain completions of anthropic only in the unsupported api
@liverpool8056 liverpool8056 marked this pull request as ready for review April 11, 2024 06:53
@flrgh flrgh merged commit 4bcc53c into master Apr 11, 2024
25 checks passed
@flrgh flrgh deleted the analytics-for-Anthropic branch April 11, 2024 16:14
@team-gateway-bot
Copy link
Collaborator

Successfully created cherry-pick PR for master:

liverpool8056 added a commit that referenced this pull request Apr 16, 2024
In this PR, a database migration is added for AI-proxy plugin, disabling
the log_statistics feature of this plugin for providers not supporting
this feature. Also, a changelog entry is added as well to describe it.
windmgc pushed a commit that referenced this pull request Apr 22, 2024
This PR is a follow-up one of #12781.
In #12781 , the default value of log_statistics is changed from true to false for providers not supporting this feature, and a configuration validation is added to prevent from enabling it against those unsupported providers.
However, the new config validation may cause CP DP compatibility issue in case that log_statistics has been enabled upon those unsupported providers. Although the issue can only happen in a very narrow case, it would be better to take care of it.

In this PR, a database migration is added for the case mentioned above, migrating the value of log_statistics from true to false against providers not supporting this feature. Also, a changelog entry is added as well to describe it.
windmgc pushed a commit that referenced this pull request Apr 22, 2024
#12854)

There is a bit difference in the usage data between ai providers, and considering the variability of it, this PR attempts to improve the robustness during the process of transforming the usage data when:

no usage data provided in the upstream response;
some possible changes in structure of usage data in the future;
In #12781 , it is arbitrarily believed that the usage data is always included and the data struct won't change. This may be a potential issue throwing an error. Therefore, this PR is a follow-up one to prevent from it.
locao pushed a commit that referenced this pull request Jun 21, 2024
There is a bit difference in the usage data between ai providers, and considering the variability of it, this PR attempts to improve the robustness during the process of transforming the usage data when:

no usage data provided in the upstream response;
some possible changes in structure of usage data in the future;
In #12781 , it is arbitrarily believed that the usage data is always included and the data struct won't change. This may be a potential issue throwing an error. Therefore, this PR is a follow-up one to prevent from it.

(cherry picked from commit a22d696)

Co-authored-by: Robin Xiang <liverpool8056@163.com>
locao pushed a commit that referenced this pull request Jun 21, 2024
This PR is a follow-up one of #12781.
In #12781 , the default value of log_statistics is changed from true to false for providers not supporting this feature, and a configuration validation is added to prevent from enabling it against those unsupported providers.
However, the new config validation may cause CP DP compatibility issue in case that log_statistics has been enabled upon those unsupported providers. Although the issue can only happen in a very narrow case, it would be better to take care of it.

In this PR, a database migration is added for the case mentioned above, migrating the value of log_statistics from true to false against providers not supporting this feature. Also, a changelog entry is added as well to describe it.

(cherry picked from commit f3b6b2e)


---------

Co-authored-by: Robin Xiang <liverpool8056@163.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants