Skip to content

Commit

Permalink
generate openapi spec
Browse files Browse the repository at this point in the history
  • Loading branch information
dineshyv committed Feb 5, 2025
1 parent 5f9375e commit 8177a2c
Show file tree
Hide file tree
Showing 3 changed files with 389 additions and 6 deletions.
224 changes: 224 additions & 0 deletions docs/_static/llama-stack-spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,79 @@
]
}
},
"/v1/telemetry/metrics/{metric_name}": {
"get": {
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GetMetricsResponse"
}
}
}
}
},
"tags": [
"Telemetry"
],
"description": "",
"parameters": [
{
"name": "metric_name",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "start_time",
"in": "query",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "end_time",
"in": "query",
"required": false,
"schema": {
"type": "integer"
}
},
{
"name": "step",
"in": "query",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "query_type",
"in": "query",
"required": true,
"schema": {
"$ref": "#/components/schemas/MetricQueryType"
}
},
{
"name": "label_matchers",
"in": "query",
"required": false,
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/MetricLabelMatcher"
}
}
}
]
}
},
"/v1/models/{model_id}": {
"get": {
"responses": {
Expand Down Expand Up @@ -3106,6 +3179,12 @@
"ChatCompletionResponse": {
"type": "object",
"properties": {
"metrics": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Metric"
}
},
"completion_message": {
"$ref": "#/components/schemas/CompletionMessage",
"description": "The complete response message"
Expand All @@ -3124,6 +3203,32 @@
],
"description": "Response from a chat completion request."
},
"Metric": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "token_usage",
"default": "token_usage"
},
"prompt_tokens": {
"type": "integer"
},
"completion_tokens": {
"type": "integer"
},
"total_tokens": {
"type": "integer"
}
},
"additionalProperties": false,
"required": [
"type",
"prompt_tokens",
"completion_tokens",
"total_tokens"
]
},
"TokenLogProbs": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -3195,6 +3300,12 @@
"CompletionResponse": {
"type": "object",
"properties": {
"metrics": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Metric"
}
},
"content": {
"type": "string",
"description": "The generated completion text"
Expand Down Expand Up @@ -3388,6 +3499,12 @@
"ChatCompletionResponseStreamChunk": {
"type": "object",
"properties": {
"metrics": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Metric"
}
},
"event": {
"$ref": "#/components/schemas/ChatCompletionResponseEvent",
"description": "The event containing the new content"
Expand Down Expand Up @@ -3537,6 +3654,12 @@
"CompletionResponseStreamChunk": {
"type": "object",
"properties": {
"metrics": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Metric"
}
},
"delta": {
"type": "string",
"description": "New content generated since last chunk. This can be one or more tokens."
Expand Down Expand Up @@ -4480,6 +4603,12 @@
"EmbeddingsResponse": {
"type": "object",
"properties": {
"metrics": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Metric"
}
},
"embeddings": {
"type": "array",
"items": {
Expand Down Expand Up @@ -5265,6 +5394,101 @@
"metadata"
]
},
"MetricQueryType": {
"type": "string",
"enum": [
"range",
"instant"
]
},
"MetricLabelMatcher": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"value": {
"type": "string"
},
"operator": {
"$ref": "#/components/schemas/MetricLabelOperator",
"default": "="
}
},
"additionalProperties": false,
"required": [
"name",
"value",
"operator"
]
},
"MetricLabelOperator": {
"type": "string",
"enum": [
"=",
"!=",
"=~",
"!~"
]
},
"GetMetricsResponse": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/MetricSeries"
}
}
},
"additionalProperties": false,
"required": [
"data"
]
},
"MetricDataPoint": {
"type": "object",
"properties": {
"timestamp": {
"type": "string",
"format": "date-time"
},
"value": {
"type": "number"
}
},
"additionalProperties": false,
"required": [
"timestamp",
"value"
]
},
"MetricSeries": {
"type": "object",
"properties": {
"metric": {
"type": "string"
},
"labels": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"values": {
"type": "array",
"items": {
"$ref": "#/components/schemas/MetricDataPoint"
}
}
},
"additionalProperties": false,
"required": [
"metric",
"labels",
"values"
]
},
"Model": {
"type": "object",
"properties": {
Expand Down
Loading

0 comments on commit 8177a2c

Please sign in to comment.