dashscoperank

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: Apache-2.0, MIT Imports: 4 Imported by: 0

Documentation

Overview

Package dashscoperank implements Alibaba Model Studio's native text-rerank shape: the same fields as the Cohere dialect, wrapped in input/parameters and answered under output.

https://help.aliyun.com/zh/model-studio/text-rerank-api

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
}

Client talks DashScope's native rerank to one endpoint.

func New

func New(cfg Config) *Client

New builds a client.

func (*Client) BuildRequestBody

func (c *Client) BuildRequestBody(query string, documents []string) (map[string]any, error)

BuildRequestBody is the golden-test entry point.

func (*Client) Rerank

func (c *Client) Rerank(ctx context.Context, query string, documents []string) ([]api.RerankResult, error)

Rerank scores documents against the query.

type Config

type Config struct {
	Endpoint api.Endpoint
	Settings api.RerankSettings
}

Config is everything the client needs, already resolved by the api.

Jump to

Keyboard shortcuts

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