Add `RerankerModel` to `effect/ai`.

Đang mở
#10,814 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 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
30/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
ai

Hướng nghiên cứu

Start by reading the existing EmbeddingModel, LanguageModel and DecisionModel modules in the effect/ai package to see the shared interface shape and how provider implementations plug in. The linked prototype at thomasfosterau/effect-ext (RerankerModel.ts) sketches a possible API for query-plus-documents input and scored results. Done means the new module exists alongside the others, is exported, and has at least one provider integration plus tests; expect to discuss the public interface with maintainers before writing much code.

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

Mô tả

enhancement
What is the problem this feature would solve?

Effect’s AI modules currently have an EmbeddingModel module for generating embeddings. A common use case for these embeddings is to use some sort of vector database, storing them and then querying them. A reranker model, by contrast, is typically given a query (as a string) and a list of candidate documents to rank (as a list of strings), and scores them against the query.

Several of the providers Effect already supports offer reranker models:

What is the feature you are proposing to solve the problem?

A RerankerModel module, analogous to LanguageModel, EmbeddingModel, and DecisionModel.

The input to a reranker model is typically a query (a string) and a list of documents (a string[]). The order of the documents in the list matters for some providers because they either return the index of the document.

The output is typically a list of the documents and their scores. As far as I know, most providers return the score as a float in the range [0, 1], but Cloudflare seems to leave that for the caller.

What alternatives have you considered?

I got Claude to throw together a prototype and released it as an NPM package, so this can be easily solved outside of Effect itself: https://github.com/thomasfosterau/effect-ext/blob/trunk/packages/effect-ext/src/RerankerModel.ts

Ngôn ngữ chính
TypeScript
Star
16.7k
Fork
808
Merge trung bình
21 giờ 22 phút
Pull request đã merge (30 ngày)
486

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

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

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 Effect-TS/effect

Tất cả issue của Effect-TS/effect

Issue tương tự

Thêm issue về TypeScript

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.