Documentation ¶
Overview ¶
package googleai implements a langchaingo provider for Google AI LLMs. See https://ai.google.dev/ for more details.
Index ¶
- Constants
- Variables
- type GoogleAI
- func (g *GoogleAI) Call(ctx context.Context, prompt string, options ...llms.CallOption) (string, error)
- func (g *GoogleAI) CreateEmbedding(ctx context.Context, texts []string) ([][]float32, error)
- func (g *GoogleAI) GenerateContent(ctx context.Context, messages []llms.MessageContent, ...) (*llms.ContentResponse, error)
- type Option
Constants ¶
const ( CITATIONS = "citations" SAFETY = "safety" RoleModel = "model" RoleUser = "user" )
Variables ¶
var ( ErrNoContentInResponse = errors.New("no content in generation response") ErrUnknownPartInResponse = errors.New("unknown part type in generation response") ErrInvalidMimeType = errors.New("invalid mime type on content") ErrSystemRoleNotSupported = errors.New("system role isn't supporeted yet") )
Functions ¶
This section is empty.
Types ¶
type GoogleAI ¶
type GoogleAI struct { CallbacksHandler callbacks.Handler // contains filtered or unexported fields }
GoogleAI is a type that represents a Google AI API client.
func (*GoogleAI) Call ¶
func (g *GoogleAI) Call(ctx context.Context, prompt string, options ...llms.CallOption) (string, error)
Call implements the llms.Model interface.
func (*GoogleAI) CreateEmbedding ¶
CreateEmbedding creates embeddings from texts.
func (*GoogleAI) GenerateContent ¶
func (g *GoogleAI) GenerateContent(ctx context.Context, messages []llms.MessageContent, options ...llms.CallOption) (*llms.ContentResponse, error)
GenerateContent implements the llms.Model interface.
type Option ¶
type Option func(*options)
func WithAPIKey ¶
WithAPIKey passes the API KEY (token) to the client.
func WithDefaultEmbeddingModel ¶
WithDefaultModel passes a default embedding model name to the client. This model name is used if not explicitly provided in specific client invocations.
func WithDefaultModel ¶
WithDefaultModel passes a default content model name to the client. This model name is used if not explicitly provided in specific client invocations.
Directories ¶
Path | Synopsis |
---|---|
internal
|
|
cmd
Code generator for vertex.go from googleai.go nolint
|
Code generator for vertex.go from googleai.go nolint |
package palm implements a langchaingo provider for Google Vertex AI legacy PaLM models.
|
package palm implements a langchaingo provider for Google Vertex AI legacy PaLM models. |
package vertex implements a langchaingo provider for Google Vertex AI LLMs, including the new Gemini models.
|
package vertex implements a langchaingo provider for Google Vertex AI LLMs, including the new Gemini models. |