AI Personal Learning
and practical guidance
豆包Marscode1

Free use of gemini-pro in immersive translation

preliminary

It is not suitable for white people to operate, gemini directly used as a translation effect compared to other free translation tools do not have an advantage. The same way this method can do a lot of things.

 


1. Install "Immersion Translation"Plug-ins

2. Have an independent domain name (first level and second level can be)

3. Have a cloudflare account

4. Have a Google account

 

workflow

 

1.Apply for gemini key

 

Visit https://ai.google.dev/ and click Get API key in Google AI Studio to start requesting a KEY:

在沉浸式翻译中免费使用gemini-pro-1

 

Enter the default dialog debug page after confirming the agreement for the first time:

在沉浸式翻译中免费使用gemini-pro-2

 

Click Get API key in the upper right corner, then click Create API key, and finally click Create API key in new project:

在沉浸式翻译中免费使用gemini-pro-3

 

Wait for the KEY to be generated and remember to copy and save it:

在沉浸式翻译中免费使用gemini-pro-4

 

 

2. Establish API access agent

High-frequency multi-user access and domestic IP access will lead to gemini key failure and even account blocking, so you need to hang a proxy access key

 

Login to cloudflare, and create works

 

在沉浸式翻译中免费使用gemini-pro-5

 

Edit the code, paste the following code into worker.js to save and deploy:


export default {
async fetch(request, env) {
const url = new URL(request.url);
url.host = 'generativelanguage.googleapis.com';
return fetch(new Request(url, request))
}
}

 

在沉浸式翻译中免费使用gemini-pro-1

 

Remember to bind the domain name (binding the domain name in the country in order to be able to access normally), you can bind it here directly, or in the DNS to resolve and set up their own routing forwarding:

在沉浸式翻译中免费使用gemini-pro-7

 

3. Get a free domain name and set up route forwarding

https://www.cloudns.org/ can apply for permanent (believe it or not?) Free second level domain name, complicated to set up.

Because it's not a top level domain, it can't can't be configured as shown above.

For more information on how cloudns is configured in cloudflare please do your own tubing.

Simple configuration instructions:

1. will cloudns apply for a second-level domain name set cloudflare's NS record

2. Add A record in cloudflare, A record can fill in the "preferred IP", which can enhance the domestic access speed

3. After setting A record in DNS, select "Workers Routing" from the left side: "Fill in the second-level domain name /*", select the created Worker.

4. A records added in cloudflare may need to be added again in cloudns.

 

4. Splicing API address

 

Back to Google AI Studio

 

在沉浸式翻译中免费使用gemini-pro-8

 

See the full address format here: https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:generateContent?key=YOUR_API_KEY

 

Let's make a substitution.

https://你的域名/v1beta/models/gemini-pro:generateContent?key={KEY}

 

 

5. Final configuration in immersive translation

 

Select the Immersive Translation plugin and choose Settings:

在沉浸式翻译中免费使用gemini-pro-9

 

Select Gemini:

在沉浸式翻译中免费使用gemini-pro-10

 

Fill in the key, address and finally click Test:

在沉浸式翻译中免费使用gemini-pro-11

May not be reproduced without permission:Chief AI Sharing Circle " Free use of gemini-pro in immersive translation
en_USEnglish