Documentation ¶
Index ¶
- Variables
- type APIVersion
- type ChatMessage
- type ChatMessageRole
- type Citation
- type CitationQuality
- type Classification
- type ClassificationLabel
- type ClassificationLabelConfidence
- type Connector
- type DetectLanguageResult
- type Document
- type EmbedInputType
- type EmbedModel
- type EventType
- type Example
- type Extractiveness
- type FinishReason
- type Generation
- type LogitBias
- type Meta
- type Model
- type NonStreamedChat
- type PromptTruncation
- type RerankModel
- type RerankResult
- type ReturnLikelihoods
- type SearchQuery
- type SearchResult
- type StreamedChat
- type TextFormat
- type TextLength
- type TokenLikelihood
- type Truncate
Constants ¶
This section is empty.
Variables ¶
View Source
var EmbedModelsSize = map[EmbedModel]int{ EmbedModelEnglishV30: 1024, EmbedModelEnglishLightV30: 384, EmbedModelEnglishV20: 4096, EmbedModelEnglishLightV20: 1024, EmbedModelMultilingualV30: 1024, EmbedModelMultilingualLightV30: 384, EmbedModelMultilingualV20: 768, }
Functions ¶
This section is empty.
Types ¶
type APIVersion ¶ added in v1.1.0
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 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 DetectLanguageResult ¶
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 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 Meta ¶
type Meta struct { APIVersion APIVersion `json:"api_version"` Warnings []string `json:"warnings"` }
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 ReturnLikelihoods ¶
type ReturnLikelihoods string
const ( ReturnLikelihoodsGeneration ReturnLikelihoods = "GENERATION" ReturnLikelihoodsAll ReturnLikelihoods = "ALL" ReturnLikelihoodsNone ReturnLikelihoods = "NONE" )
type SearchQuery ¶ added in v1.1.0
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 ¶
Click to show internal directories.
Click to hide internal directories.