request

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2023 License: MIT Imports: 4 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Classify

type Classify struct {
	Inputs   []string          `json:"inputs"`
	Examples []model.Example   `json:"examples,omitempty"`
	Model    *model.EmbedModel `json:"model,omitempty"`
	Preset   *string           `json:"preset,omitempty"`
	Truncate *model.Truncate   `json:"truncate,omitempty"`
}

func (*Classify) ContentType

func (c *Classify) ContentType() string

func (*Classify) Encode

func (c *Classify) Encode() (io.Reader, error)

func (*Classify) Path

func (e *Classify) Path() (string, error)

type DetectLanguage

type DetectLanguage struct {
	Texts []string `json:"texts"`
}

func (*DetectLanguage) ContentType

func (d *DetectLanguage) ContentType() string

func (*DetectLanguage) Encode

func (d *DetectLanguage) Encode() (io.Reader, error)

func (*DetectLanguage) Path

func (d *DetectLanguage) Path() (string, error)

type Detokenize

type Detokenize struct {
	Tokens []int64      `json:"tokens"`
	Model  *model.Model `json:"model,omitempty"`
}

func (*Detokenize) ContentType

func (d *Detokenize) ContentType() string

func (*Detokenize) Encode

func (d *Detokenize) Encode() (io.Reader, error)

func (*Detokenize) Path

func (d *Detokenize) Path() (string, error)

type Embed

type Embed struct {
	Texts    []string          `json:"texts"`
	Model    *model.EmbedModel `json:"model,omitempty"`
	Truncate *model.Truncate   `json:"truncate,omitempty"`
}

func (*Embed) ContentType

func (e *Embed) ContentType() string

func (*Embed) Encode

func (e *Embed) Encode() (io.Reader, error)

func (*Embed) Path

func (e *Embed) Path() (string, error)

type Generate

type Generate struct {
	Prompt            string                   `json:"prompt"`
	Model             *model.Model             `json:"model,omitempty"`
	NumGenerations    *int                     `json:"num_generations,omitempty"`
	MaxTokens         *int                     `json:"max_tokens,omitempty"`
	Preset            *string                  `json:"preset,omitempty"`
	Temperature       *float64                 `json:"temperature,omitempty"`
	K                 *int                     `json:"k,omitempty"`
	P                 *float64                 `json:"p,omitempty"`
	FrequencyPenalty  *float64                 `json:"frequency_penalty,omitempty"`
	PresencePenalty   *float64                 `json:"presence_penalty,omitempty"`
	EndSequences      []string                 `json:"end_sequences,omitempty"`
	StopSequences     []string                 `json:"stop_sequences,omitempty"`
	ReturnLikelihoods *model.ReturnLikelihoods `json:"return_likelihoods,omitempty"`
	LogitBias         model.LogitBias          `json:"logit_bias,omitempty"`
	Truncate          *model.Truncate          `json:"truncate,omitempty"`
	Stream            bool                     `json:"stream,omitempty"`
}

func (*Generate) ContentType

func (g *Generate) ContentType() string

func (*Generate) Encode

func (g *Generate) Encode() (io.Reader, error)

func (*Generate) Path

func (g *Generate) Path() (string, error)

type Rerank

type Rerank struct {
	Query           string             `json:"query"`
	Model           *model.RerankModel `json:"model,omitempty"`
	Documents       []string           `json:"documents"`
	TopN            *int               `json:"top_n,omitempty"`
	ReturnDocuments bool               `json:"return_documents"`
	MaxChunksPerDoc *int               `json:"max_chunks_per_doc,omitempty"`
}

func (*Rerank) ContentType

func (r *Rerank) ContentType() string

func (*Rerank) Encode

func (r *Rerank) Encode() (io.Reader, error)

func (*Rerank) Path

func (r *Rerank) Path() (string, error)

type Summarize

type Summarize struct {
	Text              string                `json:"text"`
	Length            *model.TextLength     `json:"length,omitempty"`
	Format            *model.TextFormat     `json:"format,omitempty"`
	Model             *model.Model          `json:"model,omitempty"`
	Extractiveness    *model.Extractiveness `json:"extractiveness,omitempty"`
	Temperature       *float64              `json:"temperature,omitempty"`
	AdditionalCommand *string               `json:"additional_command,omitempty"`
}

func (*Summarize) ContentType

func (s *Summarize) ContentType() string

func (*Summarize) Encode

func (s *Summarize) Encode() (io.Reader, error)

func (*Summarize) Path

func (s *Summarize) Path() (string, error)

type Tokenize

type Tokenize struct {
	Text  string       `json:"text"`
	Model *model.Model `json:"model,omitempty"`
}

func (*Tokenize) ContentType

func (t *Tokenize) ContentType() string

func (*Tokenize) Encode

func (t *Tokenize) Encode() (io.Reader, error)

func (*Tokenize) Path

func (t *Tokenize) Path() (string, error)

Jump to

Keyboard shortcuts

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