Skip to content

Commit

Permalink
feat: Add evaluations to openapi schema (#5505)
Browse files Browse the repository at this point in the history
* feat: Include evaluations routes in OpenAPI schema

* Update OpenAPI schema

* Explicitly include in schema
  • Loading branch information
anticorrelator authored Nov 26, 2024
1 parent 28b8222 commit 01d45f0
Show file tree
Hide file tree
Showing 2 changed files with 163 additions and 1 deletion.
162 changes: 162 additions & 0 deletions schemas/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -1029,6 +1029,168 @@
}
}
}
},
"/v1/evaluations": {
"post": {
"tags": [
"traces"
],
"summary": "Add span, trace, or document evaluations",
"operationId": "addEvaluations",
"parameters": [
{
"name": "content-type",
"in": "header",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Content-Type"
}
},
{
"name": "content-encoding",
"in": "header",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Content-Encoding"
}
}
],
"responses": {
"204": {
"description": "Successful Response"
},
"403": {
"content": {
"text/plain": {
"schema": {
"type": "string"
}
}
},
"description": "Forbidden"
},
"415": {
"content": {
"text/plain": {
"schema": {
"type": "string"
}
}
},
"description": "Unsupported content type, only gzipped protobuf and pandas-arrow are supported"
},
"422": {
"content": {
"text/plain": {
"schema": {
"type": "string"
}
}
},
"description": "Unprocessable Entity"
}
},
"requestBody": {
"required": true,
"content": {
"application/x-protobuf": {
"schema": {
"type": "string",
"format": "binary"
}
},
"application/x-pandas-arrow": {
"schema": {
"type": "string",
"format": "binary"
}
}
}
}
},
"get": {
"tags": [
"traces"
],
"summary": "Get span, trace, or document evaluations from a project",
"operationId": "getEvaluations",
"parameters": [
{
"name": "project_name",
"in": "query",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "The name of the project to get evaluations from (if omitted, evaluations will be drawn from the `default` project)",
"title": "Project Name"
},
"description": "The name of the project to get evaluations from (if omitted, evaluations will be drawn from the `default` project)"
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"403": {
"content": {
"text/plain": {
"schema": {
"type": "string"
}
}
},
"description": "Forbidden"
},
"404": {
"content": {
"text/plain": {
"schema": {
"type": "string"
}
}
},
"description": "Not Found"
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
}
},
"components": {
Expand Down
2 changes: 1 addition & 1 deletion src/phoenix/server/api/routers/v1/evaluations.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

EvaluationName: TypeAlias = str

router = APIRouter(tags=["traces"], include_in_schema=False)
router = APIRouter(tags=["traces"], include_in_schema=True)


@router.post(
Expand Down

0 comments on commit 01d45f0

Please sign in to comment.