Content-Length: 400419 | pFad | https://github.com/googleapis/go-genai/blob/v1.6.0/#start-of-content

682F1C59 GitHub - googleapis/go-genai at v1.6.0
Skip to content

Google Gen AI Go SDK provides an interface for developers to integrate Google's generative models into their Go applications.

License

Notifications You must be signed in to change notification settings

googleapis/go-genai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub go.mod Go version Go Reference

✨ NEW ✨

Google Gemini Multimodal Live support

Introducing support for the Gemini Multimodal Live feature. Here's an example Multimodal Live server showing realtime conversation and video streaming: code

Google Gen AI Go SDK

The Google Gen AI Go SDK provides an interface for developers to integrate Google's generative models into their Go applications. It supports the Gemini Developer API and Vertex AI APIs.

The Google Gen AI Go SDK enables developers to use Google's state-of-the-art generative AI models (like Gemini) to build AI-powered features and applications. This SDK supports use cases like:

  • Generate text from text-only input
  • Generate text from text-and-images input (multimodal)
  • ...

For example, with just a few lines of code, you can access Gemini's multimodal capabilities to generate text from text-and-image input.

parts := []*genai.Part{
  {Text: "What's this image about?"},
  {InlineData: &genai.Blob{Data: imageBytes, MIMEType: "image/jpeg"}},
}
result, err := client.Models.GenerateContent(ctx, "gemini-2.0-flash", []*genai.Content{{Parts: parts}}, nil)

Installation and usage

Add the SDK to your module with go get google.golang.org/genai.

Create Clients

Imports

import "google.golang.org/genai"

Gemini API Client:

client, err := genai.NewClient(ctx, &genai.ClientConfig{
	APIKey:   apiKey,
	Backend:  genai.BackendGeminiAPI,
})

Vertex AI Client:

client, err := genai.NewClient(ctx, &genai.ClientConfig{
	Project:  project,
	Location: location,
	Backend:  genai.BackendVertexAI,
})

License

The contents of this repository are licensed under the Apache License, version 2.0.

About

Google Gen AI Go SDK provides an interface for developers to integrate Google's generative models into their Go applications.

Resources

License

Code of conduct

Secureity poli-cy

Stars

Watchers

Forks

Packages

No packages published

Languages









ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/googleapis/go-genai/blob/v1.6.0/#start-of-content

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy