-
Notifications
You must be signed in to change notification settings - Fork 397
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
Ruthless/improve metrics types 2 #474
Conversation
4ff35b6
to
0c20e9e
Compare
@@ -108,6 +126,7 @@ def __init__( | |||
|
|||
# Metrics | |||
self._metrics = FrameProcessorMetrics(name=self.name) | |||
self._metrics_meta = {} |
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.
not to self: this is an artifact of a stale version. remove.
src/pipecat/services/ai_services.py
Outdated
@@ -11,6 +11,7 @@ | |||
from abc import abstractmethod | |||
from typing import AsyncGenerator, List, Optional, Tuple | |||
|
|||
from attr import has |
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.
note to self: remove (not sure why this got added)
346f2bb
to
3a79564
Compare
@@ -212,7 +211,7 @@ async def process_frame(self, frame: Frame, direction: FrameDirection): | |||
context = OpenAILLMContext.from_image_frame(frame) | |||
elif isinstance(frame, LLMModelUpdateFrame): |
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.
theoretically, this can now move into LLMService
and be another thing these processors don't have to remember to do
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.
Makes sense.
2c815e7
to
e0b6629
Compare
e0b6629
to
23af89c
Compare
src/pipecat/services/ai_services.py
Outdated
@@ -46,6 +47,11 @@ | |||
class AIService(FrameProcessor): | |||
def __init__(self, **kwargs): | |||
super().__init__(**kwargs) | |||
self.model_name: str = "" |
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.
could we make this private and a property instead?
@property
def model_name(self):
return self._model_name
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.
done. i think this is ready for final eyes :)
5f0a3ed
to
74005fb
Compare
23af89c
to
01cdb6e
Compare
74005fb
to
56a8429
Compare
01cdb6e
to
d84c4d7
Compare
bc94a8a
to
50b45ac
Compare
d84c4d7
to
6bdf090
Compare
1. Fleshed out MetricsFrames and broke it into a proper set of types 2. Add model_name as a property to the AIService so that it can be automatically included in metrics and also remove that overhead from all the various services themselves Breaking change! Because of the types improvements, the MetricsFrame type has changed. Each frame will have a list of metrics simlilar to before except each item in the list will only contain one type of metric: "ttfb", "tokens", "characters", or "processing". Previously these fields would be in every entry but set to None if they didn't apply. While this changes internal handling of the MetricsFrame, it does NOT break the RTVI/daily messaging of metrics. That format remains the same. Also. Remember to use model_name for accessing a service's current model and set_model_name for setting it.
6bdf090
to
a4edb3d
Compare
Nice! |
Thanks for all the help! |
Cleanup on aisle METRICS.
Note: See below, this is a breaking change
automatically included in metrics and also remove that
overhead from all the various services themselves
Breaking change!
Because of the types improvements, the MetricsFrame type has
changed. Each frame will have a list of metrics simlilar to before
except each item in the list will only contain one type of metric:
"ttfb", "tokens", "characters", or "processing". Previously these
fields would be in every entry but set to None if they didn't apply.
While this changes internal handling of the MetricsFrame, it does NOT
break the RTVI/daily messaging of metrics. That format remains the same.
Also. Remember to use model_name for accessing a service's current
model and set_model_name for setting it.