mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-02 08:44:44 +00:00
return metric labels as list
This commit is contained in:
parent
49e93085db
commit
3a82b57a26
3 changed files with 517 additions and 1 deletions
303
docs/_static/llama-stack-spec.html
vendored
303
docs/_static/llama-stack-spec.html
vendored
|
@ -4945,7 +4945,11 @@
|
||||||
"metrics": {
|
"metrics": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
|
<<<<<<< HEAD
|
||||||
"$ref": "#/components/schemas/MetricInResponse"
|
"$ref": "#/components/schemas/MetricInResponse"
|
||||||
|
=======
|
||||||
|
"$ref": "#/components/schemas/MetricEvent"
|
||||||
|
>>>>>>> 6ab59fb65 (return metric labels as list)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"content": {
|
"content": {
|
||||||
|
@ -5273,7 +5277,11 @@
|
||||||
"metrics": {
|
"metrics": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
|
<<<<<<< HEAD
|
||||||
"$ref": "#/components/schemas/MetricInResponse"
|
"$ref": "#/components/schemas/MetricInResponse"
|
||||||
|
=======
|
||||||
|
"$ref": "#/components/schemas/MetricEvent"
|
||||||
|
>>>>>>> 6ab59fb65 (return metric labels as list)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"delta": {
|
"delta": {
|
||||||
|
@ -7967,6 +7975,301 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
<<<<<<< HEAD
|
||||||
|
=======
|
||||||
|
"StringType": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"type": {
|
||||||
|
"type": "string",
|
||||||
|
"const": "string",
|
||||||
|
"default": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false,
|
||||||
|
"required": [
|
||||||
|
"type"
|
||||||
|
],
|
||||||
|
"title": "StringType"
|
||||||
|
},
|
||||||
|
"UnionType": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"type": {
|
||||||
|
"type": "string",
|
||||||
|
"const": "union",
|
||||||
|
"default": "union"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false,
|
||||||
|
"required": [
|
||||||
|
"type"
|
||||||
|
],
|
||||||
|
"title": "UnionType"
|
||||||
|
},
|
||||||
|
"MetricLabelMatcher": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"name": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"value": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"operator": {
|
||||||
|
"$ref": "#/components/schemas/MetricLabelOperator",
|
||||||
|
"default": "="
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false,
|
||||||
|
"required": [
|
||||||
|
"name",
|
||||||
|
"value",
|
||||||
|
"operator"
|
||||||
|
],
|
||||||
|
"title": "MetricLabelMatcher"
|
||||||
|
},
|
||||||
|
"MetricLabelOperator": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"=",
|
||||||
|
"!=",
|
||||||
|
"=~",
|
||||||
|
"!~"
|
||||||
|
],
|
||||||
|
"title": "MetricLabelOperator"
|
||||||
|
},
|
||||||
|
"MetricQueryType": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"range",
|
||||||
|
"instant"
|
||||||
|
],
|
||||||
|
"title": "MetricQueryType"
|
||||||
|
},
|
||||||
|
"GetMetricsRequest": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"start_time": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"end_time": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"step": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"query_type": {
|
||||||
|
"$ref": "#/components/schemas/MetricQueryType"
|
||||||
|
},
|
||||||
|
"label_matchers": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/components/schemas/MetricLabelMatcher"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false,
|
||||||
|
"required": [
|
||||||
|
"start_time",
|
||||||
|
"query_type"
|
||||||
|
],
|
||||||
|
"title": "GetMetricsRequest"
|
||||||
|
},
|
||||||
|
"GetMetricsResponse": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"data": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/components/schemas/MetricSeries"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false,
|
||||||
|
"required": [
|
||||||
|
"data"
|
||||||
|
],
|
||||||
|
"title": "GetMetricsResponse"
|
||||||
|
},
|
||||||
|
"MetricDataPoint": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"timestamp": {
|
||||||
|
"type": "string",
|
||||||
|
"format": "date-time"
|
||||||
|
},
|
||||||
|
"value": {
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false,
|
||||||
|
"required": [
|
||||||
|
"timestamp",
|
||||||
|
"value"
|
||||||
|
],
|
||||||
|
"title": "MetricDataPoint"
|
||||||
|
},
|
||||||
|
"MetricLabel": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"name": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"value": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false,
|
||||||
|
"required": [
|
||||||
|
"name",
|
||||||
|
"value"
|
||||||
|
],
|
||||||
|
"title": "MetricLabel"
|
||||||
|
},
|
||||||
|
"MetricSeries": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"metric": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"labels": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/components/schemas/MetricLabel"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"values": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/components/schemas/MetricDataPoint"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false,
|
||||||
|
"required": [
|
||||||
|
"metric",
|
||||||
|
"labels",
|
||||||
|
"values"
|
||||||
|
],
|
||||||
|
"title": "MetricSeries"
|
||||||
|
},
|
||||||
|
"Model": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"identifier": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"provider_resource_id": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"provider_id": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"type": {
|
||||||
|
"type": "string",
|
||||||
|
"const": "model",
|
||||||
|
"default": "model"
|
||||||
|
},
|
||||||
|
"metadata": {
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": {
|
||||||
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "null"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "array"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "object"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"model_type": {
|
||||||
|
"$ref": "#/components/schemas/ModelType",
|
||||||
|
"default": "llm"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false,
|
||||||
|
"required": [
|
||||||
|
"identifier",
|
||||||
|
"provider_resource_id",
|
||||||
|
"provider_id",
|
||||||
|
"type",
|
||||||
|
"metadata",
|
||||||
|
"model_type"
|
||||||
|
],
|
||||||
|
"title": "Model"
|
||||||
|
},
|
||||||
|
"ModelType": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"llm",
|
||||||
|
"embedding"
|
||||||
|
],
|
||||||
|
"title": "ModelType"
|
||||||
|
},
|
||||||
|
"PaginatedRowsResult": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"rows": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": {
|
||||||
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "null"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "array"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "object"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"description": "The rows in the current page."
|
||||||
|
},
|
||||||
|
"total_count": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "The total number of rows in the dataset."
|
||||||
|
},
|
||||||
|
"next_page_token": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The token to get the next page of rows."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false,
|
||||||
|
"required": [
|
||||||
|
"rows",
|
||||||
|
"total_count"
|
||||||
|
],
|
||||||
|
"title": "PaginatedRowsResult",
|
||||||
|
"description": "A paginated list of rows from a dataset."
|
||||||
|
},
|
||||||
|
>>>>>>> 6ab59fb65 (return metric labels as list)
|
||||||
"ScoringFn": {
|
"ScoringFn": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|
207
docs/_static/llama-stack-spec.yaml
vendored
207
docs/_static/llama-stack-spec.yaml
vendored
|
@ -3434,7 +3434,11 @@ components:
|
||||||
metrics:
|
metrics:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
|
<<<<<<< HEAD
|
||||||
$ref: '#/components/schemas/MetricInResponse'
|
$ref: '#/components/schemas/MetricInResponse'
|
||||||
|
=======
|
||||||
|
$ref: '#/components/schemas/MetricEvent'
|
||||||
|
>>>>>>> 6ab59fb65 (return metric labels as list)
|
||||||
content:
|
content:
|
||||||
type: string
|
type: string
|
||||||
description: The generated completion text
|
description: The generated completion text
|
||||||
|
@ -3708,7 +3712,11 @@ components:
|
||||||
metrics:
|
metrics:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
|
<<<<<<< HEAD
|
||||||
$ref: '#/components/schemas/MetricInResponse'
|
$ref: '#/components/schemas/MetricInResponse'
|
||||||
|
=======
|
||||||
|
$ref: '#/components/schemas/MetricEvent'
|
||||||
|
>>>>>>> 6ab59fb65 (return metric labels as list)
|
||||||
delta:
|
delta:
|
||||||
type: string
|
type: string
|
||||||
description: >-
|
description: >-
|
||||||
|
@ -5548,6 +5556,205 @@ components:
|
||||||
chat_completion_input: '#/components/schemas/ChatCompletionInputType'
|
chat_completion_input: '#/components/schemas/ChatCompletionInputType'
|
||||||
completion_input: '#/components/schemas/CompletionInputType'
|
completion_input: '#/components/schemas/CompletionInputType'
|
||||||
agent_turn_input: '#/components/schemas/AgentTurnInputType'
|
agent_turn_input: '#/components/schemas/AgentTurnInputType'
|
||||||
|
<<<<<<< HEAD
|
||||||
|
=======
|
||||||
|
StringType:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
const: string
|
||||||
|
default: string
|
||||||
|
additionalProperties: false
|
||||||
|
required:
|
||||||
|
- type
|
||||||
|
title: StringType
|
||||||
|
UnionType:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
const: union
|
||||||
|
default: union
|
||||||
|
additionalProperties: false
|
||||||
|
required:
|
||||||
|
- type
|
||||||
|
title: UnionType
|
||||||
|
MetricLabelMatcher:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
value:
|
||||||
|
type: string
|
||||||
|
operator:
|
||||||
|
$ref: '#/components/schemas/MetricLabelOperator'
|
||||||
|
default: '='
|
||||||
|
additionalProperties: false
|
||||||
|
required:
|
||||||
|
- name
|
||||||
|
- value
|
||||||
|
- operator
|
||||||
|
title: MetricLabelMatcher
|
||||||
|
MetricLabelOperator:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- '='
|
||||||
|
- '!='
|
||||||
|
- =~
|
||||||
|
- '!~'
|
||||||
|
title: MetricLabelOperator
|
||||||
|
MetricQueryType:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- range
|
||||||
|
- instant
|
||||||
|
title: MetricQueryType
|
||||||
|
GetMetricsRequest:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
start_time:
|
||||||
|
type: integer
|
||||||
|
end_time:
|
||||||
|
type: integer
|
||||||
|
step:
|
||||||
|
type: string
|
||||||
|
query_type:
|
||||||
|
$ref: '#/components/schemas/MetricQueryType'
|
||||||
|
label_matchers:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/MetricLabelMatcher'
|
||||||
|
additionalProperties: false
|
||||||
|
required:
|
||||||
|
- start_time
|
||||||
|
- query_type
|
||||||
|
title: GetMetricsRequest
|
||||||
|
GetMetricsResponse:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
data:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/MetricSeries'
|
||||||
|
additionalProperties: false
|
||||||
|
required:
|
||||||
|
- data
|
||||||
|
title: GetMetricsResponse
|
||||||
|
MetricDataPoint:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
timestamp:
|
||||||
|
type: string
|
||||||
|
format: date-time
|
||||||
|
value:
|
||||||
|
type: number
|
||||||
|
additionalProperties: false
|
||||||
|
required:
|
||||||
|
- timestamp
|
||||||
|
- value
|
||||||
|
title: MetricDataPoint
|
||||||
|
MetricLabel:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
value:
|
||||||
|
type: string
|
||||||
|
additionalProperties: false
|
||||||
|
required:
|
||||||
|
- name
|
||||||
|
- value
|
||||||
|
title: MetricLabel
|
||||||
|
MetricSeries:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
metric:
|
||||||
|
type: string
|
||||||
|
labels:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/MetricLabel'
|
||||||
|
values:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/MetricDataPoint'
|
||||||
|
additionalProperties: false
|
||||||
|
required:
|
||||||
|
- metric
|
||||||
|
- labels
|
||||||
|
- values
|
||||||
|
title: MetricSeries
|
||||||
|
Model:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
identifier:
|
||||||
|
type: string
|
||||||
|
provider_resource_id:
|
||||||
|
type: string
|
||||||
|
provider_id:
|
||||||
|
type: string
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
const: model
|
||||||
|
default: model
|
||||||
|
metadata:
|
||||||
|
type: object
|
||||||
|
additionalProperties:
|
||||||
|
oneOf:
|
||||||
|
- type: 'null'
|
||||||
|
- type: boolean
|
||||||
|
- type: number
|
||||||
|
- type: string
|
||||||
|
- type: array
|
||||||
|
- type: object
|
||||||
|
model_type:
|
||||||
|
$ref: '#/components/schemas/ModelType'
|
||||||
|
default: llm
|
||||||
|
additionalProperties: false
|
||||||
|
required:
|
||||||
|
- identifier
|
||||||
|
- provider_resource_id
|
||||||
|
- provider_id
|
||||||
|
- type
|
||||||
|
- metadata
|
||||||
|
- model_type
|
||||||
|
title: Model
|
||||||
|
ModelType:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- llm
|
||||||
|
- embedding
|
||||||
|
title: ModelType
|
||||||
|
PaginatedRowsResult:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
rows:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: object
|
||||||
|
additionalProperties:
|
||||||
|
oneOf:
|
||||||
|
- type: 'null'
|
||||||
|
- type: boolean
|
||||||
|
- type: number
|
||||||
|
- type: string
|
||||||
|
- type: array
|
||||||
|
- type: object
|
||||||
|
description: The rows in the current page.
|
||||||
|
total_count:
|
||||||
|
type: integer
|
||||||
|
description: The total number of rows in the dataset.
|
||||||
|
next_page_token:
|
||||||
|
type: string
|
||||||
|
description: The token to get the next page of rows.
|
||||||
|
additionalProperties: false
|
||||||
|
required:
|
||||||
|
- rows
|
||||||
|
- total_count
|
||||||
|
title: PaginatedRowsResult
|
||||||
|
description: A paginated list of rows from a dataset.
|
||||||
|
>>>>>>> 6ab59fb65 (return metric labels as list)
|
||||||
ScoringFn:
|
ScoringFn:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
|
|
|
@ -221,6 +221,12 @@ class MetricLabelMatcher(BaseModel):
|
||||||
operator: MetricLabelOperator = MetricLabelOperator.EQUALS
|
operator: MetricLabelOperator = MetricLabelOperator.EQUALS
|
||||||
|
|
||||||
|
|
||||||
|
@json_schema_type
|
||||||
|
class MetricLabel(BaseModel):
|
||||||
|
name: str
|
||||||
|
value: str
|
||||||
|
|
||||||
|
|
||||||
@json_schema_type
|
@json_schema_type
|
||||||
class MetricDataPoint(BaseModel):
|
class MetricDataPoint(BaseModel):
|
||||||
timestamp: datetime
|
timestamp: datetime
|
||||||
|
@ -230,7 +236,7 @@ class MetricDataPoint(BaseModel):
|
||||||
@json_schema_type
|
@json_schema_type
|
||||||
class MetricSeries(BaseModel):
|
class MetricSeries(BaseModel):
|
||||||
metric: str
|
metric: str
|
||||||
labels: dict[str, str]
|
labels: list[MetricLabel]
|
||||||
values: list[MetricDataPoint]
|
values: list[MetricDataPoint]
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue