Commit d62df7a
authored
# Improvement
SDK users sometimes need to know which JSON-RPC method is being
processed to adjust their implementation, e.g.:
* If the method is `message/send`, they may want to use
`invoke()`/`run()` when calling their LLM API, and
`stream()`/`run_streamed()` for `message/stream`.
# Implementation
Added a `method` field to `ServerCallContext.state`, similar to
`headers`.
# Tests
Added a small test to ensure that method parsing is correct.
Fixes #451
1 parent ceeb4ef commit d62df7a
File tree
2 files changed
+21
-0
lines changed- src/a2a/server/apps/jsonrpc
- tests/server/apps/jsonrpc
2 files changed
+21
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
337 | 337 | | |
338 | 338 | | |
339 | 339 | | |
| 340 | + | |
340 | 341 | | |
341 | 342 | | |
342 | 343 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
292 | 312 | | |
293 | 313 | | |
294 | 314 | | |
| |||
0 commit comments