reranker

package
v0.5.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 19, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(apiKey, endpoint string) *Client

func (*Client) Rerank

func (c *Client) Rerank(ctx context.Context, req RerankRequest) (*RerankResponse, error)

type MockServer

type MockServer struct {
	// contains filtered or unexported fields
}

func NewMockServer

func NewMockServer() *MockServer

func (*MockServer) AuthToken

func (s *MockServer) AuthToken() string

func (*MockServer) Close

func (s *MockServer) Close() error

func (*MockServer) Ready

func (s *MockServer) Ready()

func (*MockServer) Start

func (s *MockServer) Start() error

func (*MockServer) URL

func (s *MockServer) URL() string

type RerankRequest

type RerankRequest struct {
	Model     string   `json:"model"`
	Query     string   `json:"query"`
	TopN      int      `json:"top_n,omitempty"`
	Documents []string `json:"documents"`
}

type RerankResponse

type RerankResponse struct {
	Model   string         `json:"model"`
	Usage   Usage          `json:"usage"`
	Results []RerankResult `json:"results"`
}

type RerankResult

type RerankResult struct {
	Index          int     `json:"index"`
	RelevanceScore float64 `json:"relevance_score"`
}

type Usage

type Usage struct {
	TotalTokens int `json:"total_tokens"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL