Commit a555f72
[agentserver] core: make TaskRun awaitable (return .result())
Adds TaskRun.__await__ so callers can write:
run = await my_task.start(task_id=..., input=...)
...
result = await run
as shorthand for the existing:
result = await run.result()
This is the natural Pythonic shape for handle-style awaitables and
removes a pyright complaint when users naively do 'await run' on a
TaskRun handle.
Both APIs continue to work: .__await__ delegates to .result().
Test: tests/durable/test_lifecycle.py::test_task_run_is_awaitable
verifies both 'await run' and 'await run.result()' return equivalent
TaskResults.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 17af169 commit a555f72
2 files changed
Lines changed: 42 additions & 0 deletions
File tree
- sdk/agentserver/azure-ai-agentserver-core
- azure/ai/agentserver/core/durable
- tests/durable
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
293 | 315 | | |
294 | 316 | | |
295 | 317 | | |
| |||
0 commit comments