-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
cherry-pick kong-ee
schedule this PR for cherry-picking to kong/kong-ee
plugins/ai-proxy
plugins/ai-request-transformer
plugins/ai-response-transformer
labels
Mar 25, 2024
The failure of test cases should probably be fixed after #12699. |
liverpool8056
force-pushed
the
analytics-for-Anthropic
branch
from
April 9, 2024 08:49
40e970d
to
4b22892
Compare
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
force-pushed
the
analytics-for-Anthropic
branch
from
April 11, 2024 06:33
0320f7b
to
bc0beaf
Compare
tysoekong
approved these changes
Apr 11, 2024
flrgh
approved these changes
Apr 11, 2024
Successfully created cherry-pick PR for |
3 tasks
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
Labels
cherry-pick kong-ee
schedule this PR for cherry-picking to kong/kong-ee
plugins/ai-proxy
plugins/ai-request-transformer
plugins/ai-response-transformer
size/M
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.
Summary
fix a bug that the analystics is not included in the response of the
chat
route_type of anthropicChecklist
changelog/unreleased/kong
orskip-changelog
label added on PR if changelog is unnecessary. README.mdIssue reference
FTI-5769