-
Notifications
You must be signed in to change notification settings - Fork 431
Nicole cybul/litellm proxy instrumentation2 #13286
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
base: main
Are you sure you want to change the base?
Conversation
This reverts commit 80ee6c6.
) | ||
|
||
@staticmethod | ||
def _extract_llmobs_metrics(resp: Any) -> Dict[str, Any]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟠 Code Quality Violation
do not use Any, use a concrete type (...read more)
Use the Any
type very carefully. Most of the time, the Any
type is used because we do not know exactly what type is being used. If you want to specify that a value can be of any type, use object
instead of Any
.
Learn More
@@ -284,6 +292,187 @@ def get_messages_from_converse_content(role: str, content: list): | |||
return messages | |||
|
|||
|
|||
def openai_set_meta_tags_from_completion(span: Span, kwargs: Dict[str, Any], completions: Any) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟠 Code Quality Violation
do not use Any, use a concrete type (...read more)
Use the Any
type very carefully. Most of the time, the Any
type is used because we do not know exactly what type is being used. If you want to specify that a value can be of any type, use object
instead of Any
.
Learn More
if data: | ||
model = data.get("model", None) | ||
except Exception: | ||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔴 Code Quality Violation
silent exception (...read more)
Using the pass
statement in an exception block ignores the exception. Exceptions should never be ignored. Instead, the user must add code to notify an exception occurred and attempt to handle it or recover from it.
The exception to this rule is the use of StopIteration
or StopAsyncIteration
when implementing a custom iterator (as those errors are used to acknowledge the end of a successful iteration).
|
Bootstrap import analysisComparison of import times between this PR and base. SummaryThe average import time from this PR is: 256 ± 5 ms. The average import time from base is: 256 ± 4 ms. The import time difference between this PR and base is: 0.9 ± 0.2 ms. Import time breakdownThe following import paths have grown:
|
Checklist
Reviewer Checklist