mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-05-03 20:32:38 +02:00
Fix label issue in metrics (#540)
This commit is contained in:
parent
10806caac2
commit
d1456e547c
1 changed files with 6 additions and 5 deletions
|
|
@ -32,7 +32,7 @@ class LlmService(FlowProcessor):
|
||||||
|
|
||||||
def __init__(self, **params):
|
def __init__(self, **params):
|
||||||
|
|
||||||
id = params.get("id")
|
id = params.get("id", default_ident)
|
||||||
concurrency = params.get("concurrency", 1)
|
concurrency = params.get("concurrency", 1)
|
||||||
|
|
||||||
super(LlmService, self).__init__(**params | {
|
super(LlmService, self).__init__(**params | {
|
||||||
|
|
@ -111,11 +111,12 @@ class LlmService(FlowProcessor):
|
||||||
request.system, request.prompt, model, temperature
|
request.system, request.prompt, model, temperature
|
||||||
)
|
)
|
||||||
|
|
||||||
await __class__.text_completion_model_metric.labels(
|
__class__.text_completion_model_metric.labels(
|
||||||
processor = self.id, flow = flow.name
|
processor = self.id,
|
||||||
|
flow = flow.name
|
||||||
).info({
|
).info({
|
||||||
"model": model,
|
"model": str(model) if model is not None else "",
|
||||||
"temperature": temperature,
|
"temperature": str(temperature) if temperature is not None else "",
|
||||||
})
|
})
|
||||||
|
|
||||||
await flow("response").send(
|
await flow("response").send(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue