`ClientSessionGroup` has no routed `read_resource` / `get_prompt` (only `call_tool`)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 65/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- python
- Lĩnh vực
- backend-api-design
Hướng nghiên cứu
Look at the ClientSessionGroup class to understand how call_tool works and the existing reverse indexes for tools. Identify where resources and prompts are aggregated. The new methods read_resource and get_prompt should follow the same routing pattern, using the component_name_hook. Check the disconnect_from_server method to ensure cleanup. Start by examining the session aggregation logic and the existing indexes.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
### What I ran into
`ClientSessionGroup` aggregates tools, resources, and prompts into one view, and
`call_tool(name, ...)` routes to the session that owns the tool. But that routing
exists only for tools. There's no equivalent way to read an aggregated resource
or fetch an aggregated prompt through the group.
### Why it matters
To read a resource or get a prompt, a caller has to track the owning
`ClientSession` themselves and bypass the group, which defeats the "one object,
one view" purpose of the abstraction. The asymmetry is surprising given
`call_tool` is already there.
### Proposed change
Add `read_resource(name, ...)` and `get_prompt(name, arguments, ...)` mirroring
`call_tool`: resolve the aggregate key (honoring `component_name_hook`) to the
owning session via resource/prompt reverse indexes, forward the real wire
URI/name, carry the same `allow_input_required` overloads, and clean the indexes
up on `disconnect_from_server`.
### Example
```python
result = await group.read_resource("Library.hours")
prompt = await group.get_prompt("Greeter.greet", {"name": "Ada"})
- Ngôn ngữ chính
- Python
- Star
- 24.3k
- Fork
- 4k
- Merge trung bình
- 1 ngày 16 giờ
- Pull request đã merge (30 ngày)
- 25
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của modelcontextprotocol/python-sdk
-
v1 v2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
modelcontextprotocol/python-sdk#3578 · 1 bình luận ·
-
v1 v2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
modelcontextprotocol/python-sdk#3573 · 2 bình luận ·
-
v2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
modelcontextprotocol/python-sdk#3566 ·
-
Streamable HTTP client logs a WARNING for valid 202 Accepted on session termination (DELETE) Đang mởv1 v2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
modelcontextprotocol/python-sdk#3546 · 5 bình luận ·
-
v1 v2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
modelcontextprotocol/python-sdk#3545 · 2 bình luận ·
Tất cả issue của modelcontextprotocol/python-sdk
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
stephrobert/dsoxlab#238 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
sublimehq/package_control#1780 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
nwg-piotr/nwg-displays#145 ·