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 pydantic warning in prometheus integration #7583

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions litellm/types/integrations/prometheus.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,23 +251,3 @@ class UserAPIKeyLabelValues(BaseModel):
exception_class: Optional[str] = None
status_code: Optional[str] = None
fallback_model: Optional[str] = None

Copy link
Contributor

Choose a reason for hiding this comment

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

we cannot delete this, can you find another work around @SmartManoj

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we cannot delete this

Is there any unexpected side-effect?

class Config:
fields = {
Copy link
Contributor

Choose a reason for hiding this comment

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

cc @krrishdholakia- do you know if this is needed ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"end_user": {"alias": UserAPIKeyLabelNames.END_USER},
"user": {"alias": UserAPIKeyLabelNames.USER},
"hashed_api_key": {"alias": UserAPIKeyLabelNames.API_KEY_HASH},
"api_key_alias": {"alias": UserAPIKeyLabelNames.API_KEY_ALIAS},
"team": {"alias": UserAPIKeyLabelNames.TEAM},
"team_alias": {"alias": UserAPIKeyLabelNames.TEAM_ALIAS},
"requested_model": {"alias": UserAPIKeyLabelNames.REQUESTED_MODEL},
"model": {"alias": UserAPIKeyLabelNames.v1_LITELLM_MODEL_NAME},
"litellm_model_name": {"alias": UserAPIKeyLabelNames.v2_LITELLM_MODEL_NAME},
"model_id": {"alias": UserAPIKeyLabelNames.MODEL_ID},
"api_base": {"alias": UserAPIKeyLabelNames.API_BASE},
"api_provider": {"alias": UserAPIKeyLabelNames.API_PROVIDER},
"exception_status": {"alias": UserAPIKeyLabelNames.EXCEPTION_STATUS},
"exception_class": {"alias": UserAPIKeyLabelNames.EXCEPTION_CLASS},
"status_code": {"alias": UserAPIKeyLabelNames.STATUS_CODE},
"fallback_model": {"alias": UserAPIKeyLabelNames.FALLBACK_MODEL},
}
7 changes: 7 additions & 0 deletions tests/test_import_warnings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import warnings

def test_import_litellm():
SmartManoj marked this conversation as resolved.
Show resolved Hide resolved
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter("always")
import litellm
assert len(w) == 1, f"Warnings were raised: {[str(warning.message) for warning in w]}"