model

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2024 License: MIT Imports: 0 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type APIVersion added in v1.1.0

type APIVersion struct {
	Version        string `json:"version"`
	IsDeprecated   bool   `json:"is_deprecated"`
	IsExperimental bool   `json:"is_experimental"`
}

type ChatMessage added in v1.1.0

type ChatMessage struct {
	Role     ChatMessageRole `json:"role"`
	Message  string          `json:"message"`
	UserName *string         `json:"user_name,omitempty"`
}

type ChatMessageRole added in v1.1.0

type ChatMessageRole string
const (
	ChatMessageRoleUser    ChatMessageRole = "USER"
	ChatMessageRoleChatbot ChatMessageRole = "CHATBOT"
)

type Citation added in v1.1.0

type Citation struct {
	Start       int      `json:"start"`
	End         int      `json:"end"`
	Text        string   `json:"text"`
	DocumentIDs []string `json:"document_ids"`
}

type CitationQuality added in v1.1.0

type CitationQuality string
const (
	CitationQualityAccurate CitationQuality = "accurate"
	CitationQualityFast     CitationQuality = "fast"
)

type Classification

type Classification struct {
	ID         string              `json:"id"`
	Input      *string             `json:"input,omitempty"`
	Prediction string              `json:"prediction"`
	Confidence float64             `json:"confidence"`
	Labels     ClassificationLabel `json:"labels"`
}

type ClassificationLabel

type ClassificationLabel map[string]ClassificationLabelConfidence

type ClassificationLabelConfidence

type ClassificationLabelConfidence struct {
	Confidence float64 `json:"confidence"`
}

type Connector added in v1.1.0

type Connector struct {
	ID                string `json:"id"`
	UserAccessToken   string `json:"user_access_token,omitempty"`
	ContinueOnFailure bool   `json:"continue_on_failure,omitempty"`
	Options           any    `json:"options,omitempty"`
}

type DetectLanguageResult

type DetectLanguageResult struct {
	LanguageName string `json:"language_name"`
	LanguageCode string `json:"language_code"`
}

type Document

type Document struct {
	ID             string `json:"id"`
	Text           string `json:"text"`
	AdditionalProp any    `json:"additionalProp"`
}

type EmbedInputType added in v1.1.0

type EmbedInputType string
const (
	EmbedSearchQuery    EmbedInputType = "search_query"
	EmbedSearchDocument EmbedInputType = "search_document"
	EmbedClassification EmbedInputType = "classification"
	EmbedClustering     EmbedInputType = "clustering"
)

type EmbedModel

type EmbedModel string
const (
	EmbedModelEnglishV30      EmbedModel = "embed-english-v3.0"
	EmbedModelEnglishLightV30 EmbedModel = "embed-english-light-v3.0"
	EmbedModelEnglishV20      EmbedModel = "embed-english-v2.0"
	EmbedModelEnglishLightV20 EmbedModel = "embed-english-light-v2.0"
)

English

const (
	EmbedModelMultilingualV30      EmbedModel = "embed-multilingual-v3.0"
	EmbedModelMultilingualLightV30 EmbedModel = "embed-multilingual-light-v3.0"
	EmbedModelMultilingualV20      EmbedModel = "embed-multilingual-v2.0"
)

Multilingual

type EventType added in v1.1.0

type EventType string
const (
	EventTypeStreamStart             EventType = "stream-start"
	EventTypeSearchQueriesGeneration EventType = "search-queries-generation"
	EventTypeSearchResults           EventType = "search-results"
	EventTypeTextGeneration          EventType = "text-generation"
	EventTypeCitationGeneration      EventType = "citation-generation"
	EventTypeStreamEnd               EventType = "stream-end"
)

type Example

type Example struct {
	Text  string `json:"text"`
	Label string `json:"label"`
}

type Extractiveness

type Extractiveness string
const (
	ExtractivenessLow    Extractiveness = "low"
	ExtractivenessMedium Extractiveness = "medium"
	ExtractivenessHigh   Extractiveness = "high"
	ExtractivenessAuto   Extractiveness = "auto"
)

type FinishReason added in v1.1.0

type FinishReason string
const (
	FinishReasonComplete   FinishReason = "COMPLETE"
	FinishReasonErrorLimit FinishReason = "ERROR_LIMIT"
	FinishReasonMaxTokens  FinishReason = "MAX_TOKENS"
	FinishReasonError      FinishReason = "ERROR"
	FinishReasonErrorToxic FinishReason = "ERROR_TOXIC"
)

type Generation

type Generation struct {
	ID               string            `json:"id"`
	Text             string            `json:"text"`
	Index            *int              `json:"index,omitempty"`
	Likelihood       *float64          `json:"likelihood,omitempty"`
	TokenLikelihoods []TokenLikelihood `json:"token_likelihoods,omitempty"`
}

type LogitBias

type LogitBias map[string]float64

type Meta

type Meta struct {
	APIVersion APIVersion `json:"api_version"`
	Warnings   []string   `json:"warnings"`
}

type Model

type Model string
const (
	ModelCommand             Model = "command"
	ModelCommandNightly      Model = "command-nightly"
	ModelCommandLight        Model = "command-light"
	ModelCommandLightNightly Model = "command-light-nightly"
)

type NonStreamedChat added in v1.1.0

type NonStreamedChat struct {
	Text          string         `json:"text"`
	GenerationID  string         `json:"generation_id"`
	Citations     []Citation     `json:"citations"`
	Documents     []Document     `json:"documents"`
	SearchQueries []SearchQuery  `json:"search_queries"`
	SearchResults []SearchResult `json:"search_results"`
}

type PromptTruncation added in v1.1.0

type PromptTruncation string
const (
	PromptTruncationAuto PromptTruncation = "AUTO"
	PromptTruncationOff  PromptTruncation = "OFF"
)

type RerankModel

type RerankModel string
const (
	RerankModelEnglishV20      RerankModel = "rerank-english-v2.0"
	RerankModelMultilingualV20 RerankModel = "rerank-multilingual-v2.0"
)

type RerankResult

type RerankResult struct {
	Document       Document `json:"document"`
	Index          int64    `json:"index"`
	RelevanceScore float64  `json:"relevance_score"`
}

type ReturnLikelihoods

type ReturnLikelihoods string
const (
	ReturnLikelihoodsGeneration ReturnLikelihoods = "GENERATION"
	ReturnLikelihoodsAll        ReturnLikelihoods = "ALL"
	ReturnLikelihoodsNone       ReturnLikelihoods = "NONE"
)

type SearchQuery added in v1.1.0

type SearchQuery struct {
	Text         string `json:"text"`
	GenerationID string `json:"generation_id"`
}

type SearchResult added in v1.1.0

type SearchResult struct {
	SearchQuery SearchQuery `json:"search_query"`
	Connector   Connector   `json:"connector"`
	DocumentIDs []string    `json:"document_ids"`
}

type StreamedChat added in v1.1.0

type StreamedChat struct {
	EventType    EventType       `json:"event_type"`
	FinishReason FinishReason    `json:"finish_reason"`
	Response     NonStreamedChat `json:"response"`
}

type TextFormat

type TextFormat string
const (
	TextFormatParagraph TextFormat = "paragraph"
	TextFormatBullet    TextFormat = "bullet"
	TextFormatAuto      TextFormat = "auto"
)

type TextLength

type TextLength string
const (
	TextLengthShort  TextLength = "short"
	TextLengthMedium TextLength = "medium"
	TextLengthLong   TextLength = "long"
	TextLengthAuto   TextLength = "auto"
)

type TokenLikelihood

type TokenLikelihood struct {
	Token      string  `json:"token"`
	Likelihood float64 `json:"likelihood"`
}

type Truncate

type Truncate string
const (
	TruncateNone  Truncate = "NONE"
	TruncateStart Truncate = "START"
	TruncateEnd   Truncate = "END"
)

Jump to

Keyboard shortcuts

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