Skip to content

Commit 1720b40

Browse files
authored
Merge pull request #48 from langchain-ai/nc/11apr/move-runs
Move /threads/{tid}/runs/{rid} endpoints to /runs/{rid}
2 parents c19bfdc + 41b49c4 commit 1720b40

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

openapi.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@
686686
}
687687
}
688688
},
689-
"/threads/{thread_id}/runs/{run_id}": {
689+
"/runs/{run_id}": {
690690
"get": {
691691
"tags": [
692692
"Background Runs"
@@ -813,7 +813,7 @@
813813
}
814814
}
815815
},
816-
"/threads/{thread_id}/runs/{run_id}/wait": {
816+
"/runs/{run_id}/wait": {
817817
"get": {
818818
"tags": [
819819
"Background Runs"
@@ -881,7 +881,7 @@
881881
}
882882
}
883883
},
884-
"/threads/{thread_id}/runs/{run_id}/stream": {
884+
"/runs/{run_id}/stream": {
885885
"get": {
886886
"tags": [
887887
"Background Runs"
@@ -947,7 +947,7 @@
947947
}
948948
}
949949
},
950-
"/threads/{thread_id}/runs/{run_id}/cancel": {
950+
"/runs/{run_id}/cancel": {
951951
"post": {
952952
"tags": [
953953
"Background Runs"

server/ap_server/routers/background_runs.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -39,22 +39,7 @@ def run_stateless_runs_post(body: RunCreate) -> Union[Any, ErrorResponse]:
3939

4040

4141
@router.get(
42-
"/threads/{thread_id}/runs",
43-
response_model=ThreadsThreadIdRunsGetResponse,
44-
responses={"404": {"model": ErrorResponse}, "422": {"model": ErrorResponse}},
45-
tags=["Background Runs"],
46-
)
47-
def list_runs_http_threads__thread_id__runs_get(
48-
thread_id: UUID, limit: Optional[int] = 10, offset: Optional[int] = 0
49-
) -> Union[ThreadsThreadIdRunsGetResponse, ErrorResponse]:
50-
"""
51-
List Runs
52-
"""
53-
pass
54-
55-
56-
@router.get(
57-
"/threads/{thread_id}/runs/{run_id}",
42+
"/runs/{run_id}",
5843
response_model=Run,
5944
responses={"404": {"model": ErrorResponse}, "422": {"model": ErrorResponse}},
6045
tags=["Background Runs"],
@@ -69,7 +54,7 @@ def get_run_http_threads__thread_id__runs__run_id__get(
6954

7055

7156
@router.delete(
72-
"/threads/{thread_id}/runs/{run_id}",
57+
"/runs/{run_id}",
7358
response_model=None,
7459
status_code=204,
7560
responses={"404": {"model": ErrorResponse}, "422": {"model": ErrorResponse}},
@@ -85,7 +70,7 @@ def delete_run_threads__thread_id__runs__run_id__delete(
8570

8671

8772
@router.post(
88-
"/threads/{thread_id}/runs/{run_id}/cancel",
73+
"/runs/{run_id}/cancel",
8974
response_model=None,
9075
status_code=204,
9176
responses={"404": {"model": ErrorResponse}, "422": {"model": ErrorResponse}},
@@ -104,7 +89,7 @@ def cancel_run_http_threads__thread_id__runs__run_id__cancel_post(
10489

10590

10691
@router.get(
107-
"/threads/{thread_id}/runs/{run_id}/stream",
92+
"/runs/{run_id}/stream",
10893
response_model=Any,
10994
responses={"404": {"model": ErrorResponse}, "422": {"model": ErrorResponse}},
11095
tags=["Background Runs"],
@@ -119,7 +104,7 @@ def stream_run_http_threads__thread_id__runs__run_id__join_get(
119104

120105

121106
@router.get(
122-
"/threads/{thread_id}/runs/{run_id}/wait",
107+
"/runs/{run_id}/wait",
123108
response_model=RunWaitResponse,
124109
responses={"404": {"model": ErrorResponse}, "422": {"model": ErrorResponse}},
125110
tags=["Background Runs"],
@@ -131,3 +116,18 @@ def join_run_http_threads__thread_id__runs__run_id__join_get(
131116
Wait for Run output
132117
"""
133118
pass
119+
120+
121+
@router.get(
122+
"/threads/{thread_id}/runs",
123+
response_model=ThreadsThreadIdRunsGetResponse,
124+
responses={"404": {"model": ErrorResponse}, "422": {"model": ErrorResponse}},
125+
tags=["Background Runs"],
126+
)
127+
def list_runs_http_threads__thread_id__runs_get(
128+
thread_id: UUID, limit: Optional[int] = 10, offset: Optional[int] = 0
129+
) -> Union[ThreadsThreadIdRunsGetResponse, ErrorResponse]:
130+
"""
131+
List Runs
132+
"""
133+
pass

0 commit comments

Comments
 (0)