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

✨ #170 Handle unauthorized error in health tracker #180

Merged
merged 6 commits into from
Mar 19, 2024

Conversation

roma-glushko
Copy link
Member

@roma-glushko roma-glushko commented Mar 17, 2024

Handle a wrong API key case to make the model as unavailable permanently

Copy link

codecov bot commented Mar 17, 2024

Codecov Report

Attention: Patch coverage is 46.15385% with 70 lines in your changes are missing coverage. Please review.

Project coverage is 66.37%. Comparing base (3742035) to head (34a316e).

Files Patch % Lines
pkg/providers/anthropic/errors.go 46.66% 13 Missing and 3 partials ⚠️
pkg/providers/azureopenai/errors.go 46.66% 13 Missing and 3 partials ⚠️
pkg/providers/octoml/errors.go 46.66% 13 Missing and 3 partials ⚠️
pkg/gateway.go 0.00% 6 Missing ⚠️
pkg/providers/lang.go 61.53% 4 Missing and 1 partial ⚠️
pkg/routers/health/tracker.go 44.44% 4 Missing and 1 partial ⚠️
pkg/providers/cohere/chat.go 0.00% 3 Missing ⚠️
pkg/providers/openai/errors.go 0.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #180      +/-   ##
===========================================
- Coverage    66.61%   66.37%   -0.24%     
===========================================
  Files           70       73       +3     
  Lines         3082     3126      +44     
===========================================
+ Hits          2053     2075      +22     
- Misses         925      943      +18     
- Partials       104      108       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@roma-glushko roma-glushko linked an issue Mar 17, 2024 that may be closed by this pull request
@@ -40,6 +41,7 @@ func NewClient(providerConfig *Config, clientConfig *clients.ClientConfig, tel *
chatURL: chatURL,
config: providerConfig,
chatRequestTemplate: NewChatRequestFromConfig(providerConfig),
errMapper: NewErrorMapper(tel),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was time to break this thing into a smaller component. We may even end up having one error mapper if there is no much difference between error mapping across providers 👀

@roma-glushko roma-glushko merged commit 369ddea into develop Mar 19, 2024
10 checks passed
@roma-glushko roma-glushko deleted the 170-handle-unauthorized-error-in-health-tracker branch March 19, 2024 21:01
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.

🔧 [Resiliency] Handle 401 error in HealthTracker
2 participants