Skip to content

Commit 757df38

Browse files
committed
Fix outdated references in example READMEs
- Update TaskSession references to ServerTaskContext - Update task_execution() to run_task() - Fix result.taskSupport.taskId to result.task.taskId
1 parent 4516515 commit 757df38

File tree

2 files changed

+6
-6
lines changed
  • examples

2 files changed

+6
-6
lines changed

examples/clients/simple-task-interactive-client/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ async def sampling_callback(context, params) -> CreateMessageResult:
4949
```python
5050
# Call a tool as a task (returns immediately with task reference)
5151
result = await session.experimental.call_tool_as_task("tool_name", {"arg": "value"})
52-
task_id = result.taskSupport.taskId
52+
task_id = result.task.taskId
5353

5454
# Get result - this delivers elicitation/sampling requests and blocks until complete
5555
final = await session.experimental.get_task_result(task_id, CallToolResult)

examples/servers/simple-task-interactive/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ This server exposes two tools:
1919

2020
Asks the user for confirmation before "deleting" a file.
2121

22-
- Uses `TaskSession.elicit()` to request user input
22+
- Uses `task.elicit()` to request user input
2323
- Shows the elicitation flow: task -> input_required -> response -> complete
2424

2525
### `write_haiku` (demonstrates sampling)
2626

2727
Asks the LLM to write a haiku about a topic.
2828

29-
- Uses `TaskSession.create_message()` to request LLM completion
29+
- Uses `task.create_message()` to request LLM completion
3030
- Shows the sampling flow: task -> input_required -> response -> complete
3131

3232
## Usage with the client
@@ -68,7 +68,7 @@ Softly on the quiet pon...
6868

6969
## Key concepts
7070

71-
1. **TaskSession**: Wraps ServerSession to enqueue elicitation/sampling requests
72-
2. **TaskResultHandler**: Delivers queued messages and routes responses
73-
3. **task_execution()**: Context manager for safe task execution with auto-fail
71+
1. **ServerTaskContext**: Provides `elicit()` and `create_message()` for user interaction
72+
2. **run_task()**: Spawns background work, auto-completes/fails, returns immediately
73+
3. **TaskResultHandler**: Delivers queued messages and routes responses
7474
4. **Response routing**: Responses are routed back to waiting resolvers

0 commit comments

Comments
 (0)