clients

package
v1.27.13 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2025 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(apiKey string, timeout time.Duration, logger logrus.FieldLogger) *client

Types

type APIVersion

type APIVersion struct {
	Version string `json:"version"`
}

type Document

type Document struct {
	Text string `json:"text"`
}

type RankInput

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

type RankResponse

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

type Result

type Result struct {
	Index          int      `json:"index"`
	RelevanceScore float64  `json:"relevance_score"`
	Document       Document `json:"document"`
}

type Usage

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

Jump to

Keyboard shortcuts

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