Skip to content

Commit 700851a

Browse files
committed
feat: add explicit run resume endpoints
- add PATCH /runs/resume, /runs/resume/wait, /runs/resume/stream to let clients resume interrupted threads (thread_id required, if_not_exists removed) - new RunResume/RunResumeStream schemas; 409 on non-interrupted threads, 404 on missing threads, same streaming shape as /runs/stream - regenerate server/client stubs from updated OpenAPI so resume handlers are wired up and return Run/RunWaitResponse/SSE with run_id in responses
1 parent dc9e258 commit 700851a

File tree

23 files changed

+2287
-9
lines changed

23 files changed

+2287
-9
lines changed

client-python/.openapi-generator/FILES

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ ap_client/models/message_any_block.py
2929
ap_client/models/message_text_block.py
3030
ap_client/models/run.py
3131
ap_client/models/run_create.py
32+
ap_client/models/run_resume.py
33+
ap_client/models/run_resume_stream.py
3234
ap_client/models/run_search_request.py
3335
ap_client/models/run_status.py
3436
ap_client/models/run_stream.py
@@ -40,6 +42,7 @@ ap_client/models/store_list_namespaces_request.py
4042
ap_client/models/store_put_request.py
4143
ap_client/models/store_search_request.py
4244
ap_client/models/stream_mode.py
45+
ap_client/models/stream_mode1.py
4346
ap_client/models/thread.py
4447
ap_client/models/thread_checkpoint.py
4548
ap_client/models/thread_create.py
@@ -65,6 +68,8 @@ docs/MessageAnyBlock.md
6568
docs/MessageTextBlock.md
6669
docs/Run.md
6770
docs/RunCreate.md
71+
docs/RunResume.md
72+
docs/RunResumeStream.md
6873
docs/RunSearchRequest.md
6974
docs/RunStatus.md
7075
docs/RunStream.md
@@ -78,6 +83,7 @@ docs/StoreListNamespacesRequest.md
7883
docs/StorePutRequest.md
7984
docs/StoreSearchRequest.md
8085
docs/StreamMode.md
86+
docs/StreamMode1.md
8187
docs/Thread.md
8288
docs/ThreadCheckpoint.md
8389
docs/ThreadCreate.md
@@ -93,4 +99,7 @@ setup.cfg
9399
setup.py
94100
test-requirements.txt
95101
test/__init__.py
102+
test/test_run_resume.py
103+
test/test_run_resume_stream.py
104+
test/test_stream_mode1.py
96105
tox.ini

client-python/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ Class | Method | HTTP request | Description
9797
*BackgroundRunsApi* | [**wait_run**](docs/BackgroundRunsApi.md#wait_run) | **GET** /runs/{run_id}/wait | Wait for Run output
9898
*RunsApi* | [**create_and_stream_run**](docs/RunsApi.md#create_and_stream_run) | **POST** /runs/stream | Create Run, Stream Output
9999
*RunsApi* | [**create_and_wait_run**](docs/RunsApi.md#create_and_wait_run) | **POST** /runs/wait | Create Run, Wait for Output
100+
*RunsApi* | [**resume_and_stream_run**](docs/RunsApi.md#resume_and_stream_run) | **PATCH** /runs/resume/stream | Resume Run and Stream Output
101+
*RunsApi* | [**resume_and_wait_run**](docs/RunsApi.md#resume_and_wait_run) | **PATCH** /runs/resume/wait | Resume Run and Wait
102+
*RunsApi* | [**resume_run**](docs/RunsApi.md#resume_run) | **PATCH** /runs/resume | Resume Run (start execution from interrupted thread)
100103
*StoreApi* | [**delete_item**](docs/StoreApi.md#delete_item) | **DELETE** /store/items | Delete Store Item
101104
*StoreApi* | [**get_item**](docs/StoreApi.md#get_item) | **GET** /store/items | Get Store Item
102105
*StoreApi* | [**list_namespaces**](docs/StoreApi.md#list_namespaces) | **POST** /store/namespaces | List namespaces
@@ -127,6 +130,8 @@ Class | Method | HTTP request | Description
127130
- [MessageTextBlock](docs/MessageTextBlock.md)
128131
- [Run](docs/Run.md)
129132
- [RunCreate](docs/RunCreate.md)
133+
- [RunResume](docs/RunResume.md)
134+
- [RunResumeStream](docs/RunResumeStream.md)
130135
- [RunSearchRequest](docs/RunSearchRequest.md)
131136
- [RunStatus](docs/RunStatus.md)
132137
- [RunStream](docs/RunStream.md)
@@ -138,6 +143,7 @@ Class | Method | HTTP request | Description
138143
- [StorePutRequest](docs/StorePutRequest.md)
139144
- [StoreSearchRequest](docs/StoreSearchRequest.md)
140145
- [StreamMode](docs/StreamMode.md)
146+
- [StreamMode1](docs/StreamMode1.md)
141147
- [Thread](docs/Thread.md)
142148
- [ThreadCheckpoint](docs/ThreadCheckpoint.md)
143149
- [ThreadCreate](docs/ThreadCreate.md)

client-python/ap_client/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@
4848
from ap_client.models.message_text_block import MessageTextBlock
4949
from ap_client.models.run import Run
5050
from ap_client.models.run_create import RunCreate
51+
from ap_client.models.run_resume import RunResume
52+
from ap_client.models.run_resume_stream import RunResumeStream
5153
from ap_client.models.run_search_request import RunSearchRequest
5254
from ap_client.models.run_status import RunStatus
5355
from ap_client.models.run_stream import RunStream
@@ -59,6 +61,7 @@
5961
from ap_client.models.store_put_request import StorePutRequest
6062
from ap_client.models.store_search_request import StoreSearchRequest
6163
from ap_client.models.stream_mode import StreamMode
64+
from ap_client.models.stream_mode1 import StreamMode1
6265
from ap_client.models.thread import Thread
6366
from ap_client.models.thread_checkpoint import ThreadCheckpoint
6467
from ap_client.models.thread_create import ThreadCreate

0 commit comments

Comments
 (0)