clients

package
v1.24.11 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 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 Data

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

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"`
	ReturnDocuments bool     `json:"return_documents"`
	Truncation      bool     `json:"truncation"`
}

type RankResponse

type RankResponse struct {
	ID    string `json:"id"`
	Data  []Data `json:"data"`
	Usage Usage  `json:"usage"`
}

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