ALL

  Gemini Example with Go

To connect and use Gemini with Go, Google's LLM, one can use their official Go SDK for doing this. In this post, we will just show a simple chat example to demonstrate how to make it work with Go.The example is just to ask the model to translate some English to Chinese and get its output. The code actually looks like:var client *genai.Client// geminiOnce.Do(func() {client, err = genai.NewClient(ctx, option.WithAPIKey(string(apiKey)))if err != nil { log.Fatal(err)}model := client.GenerativeModel("gemini-1.5-flash-latest")model.SetTemperature(0.1)resp, err := model.GenerateContent(ctx, genai.Tex...

  1,172      2       EXAMPLE GO TRANSLATION GOLANG GEMINI


  First Touch on OpenAI API

It’s been a while since ChatGPT launched, and I’ve been meaning to try out the OpenAI API. Recently, I finally took the plunge, so here’s a walkthrough of my initial experience using it.Objective: I’ve previously used ChatGPT’s interface for language translation tasks between Chinese and English. For this API experiment, I aimed to set up a simple translation function using the OpenAI API.Step 1: Getting the API KeyFirst, to access the API, I created an OpenAI account and generated an API key. This key is required for making API calls. The setup is straightforward...

  890      0       TUTORIAL API TRANSLATION OPENAI FREE ACCOUNT


  Disable foreign language translation in Chrome

When browsing a non-English language(Chinese for example) website when using Chrome, it will offer to translate the page to English every time the page is loaded. To disable the translation for all non-English websites all at once, there is a setting in Chrome you can set.Below are the steps for doing this:1. Go to Settings and scroll down to bottom2. Click the Show advanced settings... link and the advanced settings will be expanded3. Find the section Languages and uncheck the option "Offer to translate pages that aren't in a language you read".Or if you are a web developer and you don't want...

  4,067      0       CHROME TRANSLATION DISABLE