Fix label issue in metrics (#540)

This commit is contained in:
cybermaggedon 2025-09-26 14:13:22 +01:00 committed by GitHub
parent 10806caac2
commit d1456e547c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -32,7 +32,7 @@ class LlmService(FlowProcessor):
def __init__(self, **params):
id = params.get("id")
id = params.get("id", default_ident)
concurrency = params.get("concurrency", 1)
super(LlmService, self).__init__(**params | {
@ -111,11 +111,12 @@ class LlmService(FlowProcessor):
request.system, request.prompt, model, temperature
)
await __class__.text_completion_model_metric.labels(
processor = self.id, flow = flow.name
__class__.text_completion_model_metric.labels(
processor = self.id,
flow = flow.name
).info({
"model": model,
"temperature": temperature,
"model": str(model) if model is not None else "",
"temperature": str(temperature) if temperature is not None else "",
})
await flow("response").send(