request

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: MIT Imports: 5 Imported by: 6

Documentation

Index

Constants

View Source
const (
	ContentTypeJSON = "application/json"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Chat added in v1.1.0

type Chat struct {
	Message          string                 `json:"message"`
	Model            model.Model            `json:"model,omitempty"`
	Stream           bool                   `json:"stream,omitempty"`
	Preamble         string                 `json:"preamble,omitempty"`
	ChatHistory      []model.ChatMessage    `json:"chat_history,omitempty"`
	ConversationID   string                 `json:"conversation_id,omitempty"`
	PromptTruncation model.PromptTruncation `json:"prompt_truncation,omitempty"`
	Connectors       []model.Connector      `json:"connectors,omitempty"`
	SearchQueryOnly  bool                   `json:"search_query_only,omitempty"`
	Documents        []model.Document       `json:"documents,omitempty"`
	CitationQuality  model.CitationQuality  `json:"citation_quality,omitempty"`
	Temperature      *float64               `json:"temperature,omitempty"`
	MaxTokens        *int                   `json:"max_tokens,omitempty"`
	MaxInputTokens   *int                   `json:"max_input_tokens,omitempty"`
	K                *int                   `json:"k,omitempty"`
	P                *float64               `json:"p,omitempty"`
	Seed             *float64               `json:"seed,omitempty"`
	StopSequences    []string               `json:"stop_sequences,omitempty"`
	FrequencyPenalty *float64               `json:"frequency_penalty,omitempty"`
	PresencePenalty  *float64               `json:"presence_penalty,omitempty"`
	Tools            []model.Tool           `json:"tools,omitempty"`
	ToolResults      []model.ToolResult     `json:"tool_results,omitempty"`
	ForceSingleStep  bool                   `json:"force_single_step,omitempty"`
}

func (*Chat) ContentType added in v1.1.0

func (c *Chat) ContentType() string

func (*Chat) Encode added in v1.1.0

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

func (*Chat) Path added in v1.1.0

func (c *Chat) Path() (string, error)

type CheckAPIKey added in v1.2.0

type CheckAPIKey struct {
}

func (*CheckAPIKey) ContentType added in v1.2.0

func (r *CheckAPIKey) ContentType() string

func (*CheckAPIKey) Encode added in v1.2.0

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

func (*CheckAPIKey) Path added in v1.2.0

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

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 (c *Classify) 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"`
	InputType *model.EmbedInputType `json:"input_type,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 ListModels added in v1.2.0

type ListModels struct {
	PageSize    int    `json:"-"`
	PageToken   string `json:"-"`
	Endpoint    string `json:"-"`
	DefaultOnly bool   `json:"-"`
}

func (*ListModels) ContentType added in v1.2.0

func (c *ListModels) ContentType() string

func (*ListModels) Encode added in v1.2.0

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

nolint: nilnil

func (*ListModels) Path added in v1.2.0

func (c *ListModels) Path() (string, error)

type Model added in v1.2.0

type Model struct {
	Model model.Model `json:"-"`
}

func (*Model) ContentType added in v1.2.0

func (c *Model) ContentType() string

func (*Model) Encode added in v1.2.0

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

nolint: nilnil

func (*Model) Path added in v1.2.0

func (c *Model) 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"`
	RankFields      []string           `json:"rank_fields,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