bailian

package
v2.10.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2025 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RerankInput

type RerankInput struct {
	Query     string   `json:"query"`
	Documents []string `json:"documents"`
}

type RerankParameter

type RerankParameter struct {
	ReturnDocuments bool   `json:"return_documents"`
	TopN            int    `json:"top_n,omitempty"`
	Instruct        string `json:"instruct,omitempty"`
}

type RerankRequest

type RerankRequest struct {
	Model      string           `json:"model"`
	Input      RerankInput      `json:"input"`
	Parameters *RerankParameter `json:"parameters,omitempty"`
}

type Reranker

type Reranker struct {
	Ctx    context.Context
	Config RerankerConfig
}

func NewReranker

func NewReranker(ctx context.Context, config RerankerConfig) *Reranker

func (*Reranker) Rerank

type RerankerConfig

type RerankerConfig struct {
	APIKey  string
	Model   string
	BaseUrl string
}

Jump to

Keyboard shortcuts

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