Skip to content

Commit

Permalink
add tags
Browse files Browse the repository at this point in the history
  • Loading branch information
axiomofjoy committed Jul 10, 2024
1 parent 8d3c3aa commit 96a6479
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 18 deletions.
36 changes: 36 additions & 0 deletions schemas/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ paths:
schema: {}
description: Successful Response
summary: List Datasets
tags:
- datasets
/v1/datasets/upload:
post:
description: "summary: Upload dataset as either JSON or file (CSV or PyArrow)\n\
Expand Down Expand Up @@ -69,6 +71,8 @@ paths:
schema: {}
description: Successful Response
summary: Upload Dataset
tags:
- datasets
/v1/datasets/{dataset_id}/experiments:
post:
description: "summary: Create an experiment using a dataset\noperationId: createExperiment\n\
Expand Down Expand Up @@ -112,6 +116,8 @@ paths:
schema: {}
description: Successful Response
summary: Create Experiment
tags:
- private
/v1/datasets/{id}:
delete:
description: "summary: Delete dataset by ID\noperationId: deleteDatasetById\n\
Expand All @@ -127,6 +133,8 @@ paths:
schema: {}
description: Successful Response
summary: Delete Dataset
tags:
- datasets
get:
description: "summary: Get dataset by ID\noperationId: getDatasetById\ntags:\n\
\ - datasets\nparameters:\n - in: path\n name: id\n required: true\n\
Expand All @@ -148,6 +156,8 @@ paths:
schema: {}
description: Successful Response
summary: Get Dataset
tags:
- datasets
/v1/datasets/{id}/csv:
get:
description: "summary: Download dataset examples as CSV text file\noperationId:\
Expand All @@ -168,6 +178,8 @@ paths:
schema: {}
description: Successful Response
summary: Get Dataset Csv
tags:
- datasets
/v1/datasets/{id}/examples:
get:
description: "summary: Get dataset examples by dataset ID\noperationId: getDatasetExamples\n\
Expand Down Expand Up @@ -207,6 +219,8 @@ paths:
schema: {}
description: Successful Response
summary: List Dataset Examples
tags:
- datasets
/v1/datasets/{id}/jsonl/openai_evals:
get:
description: "summary: Download dataset examples as OpenAI Evals JSONL file\n\
Expand All @@ -227,6 +241,8 @@ paths:
schema: {}
description: Successful Response
summary: Get Dataset Jsonl Openai Evals
tags:
- datasets
/v1/datasets/{id}/jsonl/openai_ft:
get:
description: "summary: Download dataset examples as OpenAI Fine-Tuning JSONL\
Expand All @@ -247,6 +263,8 @@ paths:
schema: {}
description: Successful Response
summary: Get Dataset Jsonl Openai Ft
tags:
- datasets
/v1/datasets/{id}/versions:
get:
description: "summary: Get dataset versions (sorted from latest to oldest)\n\
Expand Down Expand Up @@ -274,6 +292,8 @@ paths:
schema: {}
description: Successful Response
summary: Get Dataset Versions
tags:
- datasets
/v1/evaluations:
get:
description: "summary: Get evaluations from Phoenix\noperationId: getEvaluation\n\
Expand All @@ -290,6 +310,8 @@ paths:
schema: {}
description: Successful Response
summary: Get Evaluations
tags:
- private
post:
description: "summary: Add evaluations to a span, trace, or document\noperationId:\
\ addEvaluations\ntags:\n - private\nrequestBody:\n required: true\n content:\n\
Expand All @@ -307,6 +329,8 @@ paths:
schema: {}
description: Successful Response
summary: Post Evaluations
tags:
- private
/v1/experiment_evaluations:
post:
description: "summary: Create an evaluation for a specific experiment run\n\
Expand Down Expand Up @@ -351,6 +375,8 @@ paths:
schema: {}
description: Successful Response
summary: Upsert Experiment Evaluation
tags:
- private
/v1/experiments/{experiment_id}:
get:
description: "summary: Get details of a specific experiment\noperationId: getExperiment\n\
Expand Down Expand Up @@ -385,6 +411,8 @@ paths:
schema: {}
description: Successful Response
summary: Read Experiment
tags:
- private
/v1/experiments/{experiment_id}/runs:
get:
description: "summary: List all runs for a specific experiment\noperationId:\
Expand Down Expand Up @@ -457,6 +485,8 @@ paths:
schema: {}
description: Successful Response
summary: Create Experiment Run
tags:
- private
/v1/spans:
get:
operationId: get_spans_handler_v1_spans_get
Expand All @@ -467,6 +497,8 @@ paths:
schema: {}
description: Successful Response
summary: Get Spans Handler
tags:
- private
post:
description: "summary: Query spans using query DSL\noperationId: querySpans\n\
tags:\n - private\nparameters:\n - name: project_name\n in: query\n \
Expand Down Expand Up @@ -495,6 +527,8 @@ paths:
schema: {}
description: Successful Response
summary: Query Spans Handler
tags:
- private
/v1/traces:
post:
description: "summary: Send traces to Phoenix\noperationId: addTraces\ntags:\n\
Expand All @@ -511,4 +545,6 @@ paths:
schema: {}
description: Successful Response
summary: Post Traces
tags:
- private

2 changes: 1 addition & 1 deletion src/phoenix/server/api/routers/v1/dataset_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
router = APIRouter()


@router.get("/{id}/examples")
@router.get("/{id}/examples", tags=["datasets"])
async def list_dataset_examples(request: Request) -> Response:
"""
summary: Get dataset examples by dataset ID
Expand Down
16 changes: 8 additions & 8 deletions src/phoenix/server/api/routers/v1/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
router.include_router(dataset_experiments_router)


@router.get("")
@router.get("", tags=["datasets"])
async def list_datasets(request: Request) -> Response:
"""
summary: List datasets with cursor-based pagination
Expand Down Expand Up @@ -177,7 +177,7 @@ async def list_datasets(request: Request) -> Response:
return JSONResponse(content={"next_cursor": next_cursor, "data": data})


@router.delete("/{id}")
@router.delete("/{id}", tags=["datasets"])
async def delete_dataset(request: Request) -> Response:
"""
summary: Delete dataset by ID
Expand Down Expand Up @@ -232,7 +232,7 @@ async def delete_dataset(request: Request) -> Response:
return Response(status_code=HTTP_204_NO_CONTENT, background=tasks)


@router.get("/{id}")
@router.get("/{id}", tags=["datasets"])
async def get_dataset(request: Request) -> Response:
"""
summary: Get dataset by ID
Expand Down Expand Up @@ -306,7 +306,7 @@ async def get_dataset(request: Request) -> Response:
return JSONResponse(content={"data": output_dict})


@router.get("/{id}/versions")
@router.get("/{id}/versions", tags=["datasets"])
async def get_dataset_versions(request: Request) -> Response:
"""
summary: Get dataset versions (sorted from latest to oldest)
Expand Down Expand Up @@ -421,7 +421,7 @@ async def get_dataset_versions(request: Request) -> Response:
return JSONResponse(content={"next_cursor": next_cursor, "data": data})


@router.post("/upload")
@router.post("/upload", tags=["datasets"])
async def upload_dataset(request: Request) -> Response:
"""
summary: Upload dataset as either JSON or file (CSV or PyArrow)
Expand Down Expand Up @@ -771,7 +771,7 @@ async def _parse_form_data(
)


@router.get("/{id}/csv")
@router.get("/{id}/csv", tags=["datasets"])
async def get_dataset_csv(request: Request) -> Response:
"""
summary: Download dataset examples as CSV text file
Expand Down Expand Up @@ -821,7 +821,7 @@ async def get_dataset_csv(request: Request) -> Response:
)


@router.get("/{id}/jsonl/openai_ft")
@router.get("/{id}/jsonl/openai_ft", tags=["datasets"])
async def get_dataset_jsonl_openai_ft(request: Request) -> Response:
"""
summary: Download dataset examples as OpenAI Fine-Tuning JSONL file
Expand Down Expand Up @@ -871,7 +871,7 @@ async def get_dataset_jsonl_openai_ft(request: Request) -> Response:
)


@router.get("/{id}/jsonl/openai_evals")
@router.get("/{id}/jsonl/openai_evals", tags=["datasets"])
async def get_dataset_jsonl_openai_evals(request: Request) -> Response:
"""
summary: Download dataset examples as OpenAI Evals JSONL file
Expand Down
4 changes: 2 additions & 2 deletions src/phoenix/server/api/routers/v1/evaluations.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
router = APIRouter(prefix="/evaluations")


@router.post("")
@router.post("", tags=["private"])
async def post_evaluations(request: Request) -> Response:
"""
summary: Add evaluations to a span, trace, or document
Expand Down Expand Up @@ -97,7 +97,7 @@ async def post_evaluations(request: Request) -> Response:
return Response()


@router.get("")
@router.get("", tags=["private"])
async def get_evaluations(request: Request) -> Response:
"""
summary: Get evaluations from Phoenix
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
router = APIRouter(prefix="/experiment_evaluations")


@router.post("")
@router.post("", tags=["private"])
async def upsert_experiment_evaluation(request: Request) -> Response:
"""
summary: Create an evaluation for a specific experiment run
Expand Down
2 changes: 1 addition & 1 deletion src/phoenix/server/api/routers/v1/experiment_runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
router = APIRouter()


@router.post("/{experiment_id}/runs")
@router.post("/{experiment_id}/runs", tags=["private"])
async def create_experiment_run(request: Request) -> Response:
"""
summary: Create a new experiment run for a specific experiment
Expand Down
4 changes: 2 additions & 2 deletions src/phoenix/server/api/routers/v1/experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def _generate_experiment_name(dataset_name: str) -> str:
return f"{short_ds_name}-{_short_uuid()}"


@dataset_experiments_router.post("/{dataset_id}/experiments")
@dataset_experiments_router.post("/{dataset_id}/experiments", tags=["private"])
async def create_experiment(request: Request) -> Response:
"""
summary: Create an experiment using a dataset
Expand Down Expand Up @@ -221,7 +221,7 @@ async def create_experiment(request: Request) -> Response:
return JSONResponse(content={"data": experiment_payload})


@router.get("/{experiment_id}")
@router.get("/{experiment_id}", tags=["private"])
async def read_experiment(request: Request) -> Response:
"""
summary: Get details of a specific experiment
Expand Down
4 changes: 2 additions & 2 deletions src/phoenix/server/api/routers/v1/spans.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


# TODO: Add property details to SpanQuery schema
@router.post("")
@router.post("", tags=["private"])
async def query_spans_handler(request: Request) -> Response:
"""
summary: Query spans using query DSL
Expand Down Expand Up @@ -130,6 +130,6 @@ async def content() -> AsyncIterator[bytes]:
)


@router.get("")
@router.get("", tags=["private"])
async def get_spans_handler(request: Request) -> Response:
return await query_spans_handler(request)
2 changes: 1 addition & 1 deletion src/phoenix/server/api/routers/v1/traces.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
router = APIRouter(prefix="/traces")


@router.post("")
@router.post("", tags=["private"])
async def post_traces(request: Request) -> Response:
"""
summary: Send traces to Phoenix
Expand Down

0 comments on commit 96a6479

Please sign in to comment.