Update `inputSchema` parameter for `Tool` to be `any Codable`

Đang mở
#109 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

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
45/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
swift
Lĩnh vực
api

Hướng nghiên cứu

Start at the Tool definition and trace how its inputSchema parameter is encoded; review the linked issue and comment for the intended Codable behavior. Done when Tool accepts a broader schema type without treating nil as a valid null Value, with coverage for the updated API.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement

From https://github.com/modelcontextprotocol/swift-sdk/issues/79#issuecomment-2859460616

There is a potential footgun we should disarm, though. Value conforms to ExpressibleByNilLiteral. So if you pass inputSchema: nil, that turns into a null value which isn't valid. In a future version, I intend to relax inputSchema to something like any Encodable so that you could use something like JSONSchema instead of Value.

Ngôn ngữ chính
Swift
Star
1.6k
Fork
270
Merge trung bình
2 ngày 7 giờ
Pull request đã merge (30 ngày)
15

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của modelcontextprotocol/swift-sdk

Tất cả issue của modelcontextprotocol/swift-sdk

Issue tương tự

Thêm issue về Swift

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.