Documentation
¶
Index ¶
- Constants
- Variables
- type Google
- func (g *Google) Embed(request *embed.Request) (*embed.Response, error)
- func (g *Google) EmbedDocument(request *embed.DocumentRequest) (*embed.DocumentResponse, error)
- func (g *Google) Generator(options ...gen.Option) *gen.Generator
- func (g *Google) Provider() string
- func (g *Google) SetLogger(logger *slog.Logger) *Google
- type GoogleConfig
- type GoogleEmbedRequest
- type GoogleEmbedResponse
- type JSONSchema
- type Type
Constants ¶
View Source
const EmbedDimensions = 768
View Source
const Provider = "VertexAI"
View Source
const TypeClassification embed.Type = "CLASSIFICATION"
View Source
const TypeClustering embed.Type = "CLUSTERING"
View Source
const TypeCodeRetrieval embed.Type = "CODE_RETRIEVAL_QUERY"
View Source
const TypeDocument embed.Type = "RETRIEVAL_DOCUMENT"
View Source
const TypeFactVerification embed.Type = "FACT_VERIFICATION"
View Source
const TypeQuery embed.Type = "RETRIEVAL_QUERY"
View Source
const TypeQuestionAnswer embed.Type = "QUESTION_ANSWERING"
View Source
const TypeSemanticSimilarity embed.Type = "SEMANTIC_SIMILARITY"
Variables ¶
View Source
var EmbedMode_multilang_002 = embed.Model{ Provider: Provider, Name: "text-multilingual-embedding-002", Description: "see https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/text-embeddings-api", InputMaxTokens: 2048, OutputDimensions: 768, }
View Source
var EmbedModel_gemini_001 = embed.Model{ Provider: Provider, Name: "gemini-embedding-001", Description: "State-of-the-art performance across English, multilingual and code tasks. It unifies the previously specialized models like text-embedding-005 and text-multilingual-embedding-002 and achieves better performance in their respective domains.", InputMaxTokens: 2048, OutputDimensions: 3072, }
View Source
var EmbedModel_text_004 = embed.Model{ Provider: Provider, Name: "text-embedding-004", Description: "see https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/text-embeddings-api", InputMaxTokens: 2048, OutputDimensions: 768, }
View Source
var EmbedModel_text_005 = embed.Model{ Provider: Provider, Name: "text-embedding-005", Description: "see https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/text-embeddings-api", InputMaxTokens: 2048, OutputDimensions: 768, }
View Source
var EmbedModel_text_gecko_003 = embed.Model{ Provider: Provider, Name: "textembedding-gecko@003", Description: "see https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/text-embeddings-api", InputMaxTokens: 2048, OutputDimensions: 768, }
var EmbedModel_text_gecko_001 = embed.Model{ // deprecated?
Provider: Provider, Name: "textembedding-gecko@001", Description: "see https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/text-embeddings-api", InputMaxTokens: 2048, OutputDimensions: 768, }
View Source
var EmbedModel_text_gecko_multilang_001 = embed.Model{ Provider: Provider, Name: "textembedding-gecko-multilingual@001", Description: "see https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/text-embeddings-api", InputMaxTokens: 2048, OutputDimensions: 768, }
View Source
var EmbedModels = map[string]embed.Model{ EmbedModel_text_005.Name: EmbedModel_text_005, EmbedModel_text_004.Name: EmbedModel_text_004, EmbedMode_multilang_002.Name: EmbedMode_multilang_002, EmbedModel_gemini_001.Name: EmbedModel_gemini_001, }
View Source
var GenModel_gemini_2_5_flash_latest = gen.Model{ Provider: Provider, Name: "gemini-2.5-flash", InputMaxToken: 1_048_576, OutputMaxToken: 65_536, }
View Source
var GenModel_gemini_2_5_flash_lite_latest = gen.Model{ Provider: Provider, Name: "gemini-2.5-flash-lite", InputMaxToken: 1_048_576, OutputMaxToken: 65_536, }
View Source
var GenModel_gemini_2_5_pro_latest = gen.Model{ Provider: Provider, Name: "gemini-2.5-pro", InputMaxToken: 1_048_576, OutputMaxToken: 65_536, }
View Source
var GenModel_gemini_3_1_flash_lite_preview = gen.Model{ Provider: Provider, Name: "gemini-3.1-flash-lite-preview", InputMaxToken: 1_048_576, OutputMaxToken: 65_536, }
View Source
var GenModel_gemini_3_1_pro_preview = gen.Model{ Provider: Provider, Name: "gemini-3.1-pro-preview", InputMaxToken: 1_048_576, OutputMaxToken: 65_536, }
View Source
var GenModel_gemini_3_flash_preview = gen.Model{ Provider: Provider, Name: "gemini-3-flash-preview", InputMaxToken: 1_048_576, OutputMaxToken: 65_536, }
View Source
var GenModel_gemini_3_pro_preview = gen.Model{ Provider: Provider, Name: "gemini-3-pro-preview", InputMaxToken: 1_048_576, OutputMaxToken: 65_536, }
View Source
var GenModels = map[string]gen.Model{ GenModel_gemini_2_5_pro_latest.Name: GenModel_gemini_2_5_pro_latest, GenModel_gemini_2_5_flash_latest.Name: GenModel_gemini_2_5_flash_latest, }
Functions ¶
This section is empty.
Types ¶
type Google ¶
func New ¶
func New(config GoogleConfig) (*Google, error)
func (*Google) EmbedDocument ¶ added in v1.0.0
func (g *Google) EmbedDocument(request *embed.DocumentRequest) (*embed.DocumentResponse, error)
type GoogleConfig ¶
type GoogleEmbedRequest ¶
type GoogleEmbedRequest struct {
Instances []googleEmbedRequestInstance `json:"instances"`
}
type GoogleEmbedResponse ¶
type JSONSchema ¶ added in v0.8.0
type JSONSchema struct {
Ref string `json:"ref,omitempty"` // #/defs/... etc, overrides everything else
Defs map[string]*JSONSchema `json:"defs,omitempty"` // for ref
// Optional. The type of the data.
Type Type `json:"type,omitempty"`
// Optional. The format of the data.
// Supported formats:
//
// for STRING type: "date", "date-time", "duration", "time", etc
Format string `json:"format,omitempty"`
// Optional. The title of the Schema.
Title string `json:"title,omitempty"`
// Optional. The description of the data.
Description string `json:"description,omitempty"`
// Optional. Indicates if the value may be null.
Nullable bool `json:"nullable,omitempty"`
// Optional. SCHEMA FIELDS FOR TYPE ARRAY
// Schema of the elements of Type.ARRAY.
Items *JSONSchema `json:"items,omitempty"`
// Optional. Minimum number of the elements for Type.ARRAY.
MinItems int `json:"minItems,omitempty"`
// Optional. Maximum number of the elements for Type.ARRAY.
MaxItems int `json:"maxItems,omitempty"`
// Optional. Possible values of the element of Type.STRING with enum format.
// For example we can define an Enum Direction as :
// {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]}
Enum []string `json:"enum,omitempty"`
// Optional. SCHEMA FIELDS FOR TYPE OBJECT
// Properties of Type.OBJECT.
Properties map[string]*JSONSchema `json:"properties,omitempty"`
// Optional. Required properties of Type.OBJECT.
Required []string `json:"required,omitempty"`
// Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER
// Minimum value of the Type.INTEGER and Type.NUMBER
Minimum float64 `json:"minimum,omitempty"`
// Optional. Maximum value of the Type.INTEGER and Type.NUMBER
Maximum float64 `json:"maximum,omitempty"`
}
JSONSchema is used to define the format of input/output data. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema). More fields may be added in the future as needed.
Click to show internal directories.
Click to hide internal directories.