2026/6/7 10:11:38
网站建设
项目流程
网站怎么做关键词内链,做门户网站最重要的是什么,泉州网站建设论坛,怎么注册自己的域名第一步#xff1a;白嫖gemini 3 pro白嫖gemini 3 pro方法-CSDN博客
第二步#xff1a;官网gemini3 pro创建密钥
官网链接#xff1a;Google AI Studio
第三步#xff1a;创建一个ai项目
python创建一个环境#xff08;这里我用的是conda#xff09;
conda create -n…第一步白嫖gemini 3 pro白嫖gemini 3 pro方法-CSDN博客第二步官网gemini3 pro创建密钥官网链接Google AI Studio第三步创建一个ai项目python创建一个环境这里我用的是condaconda create -n gemini python3.11 -y conda activate gemini引入依赖pip install -q -U google-genai然后编写代码要替换你的key而且你环境要导出这个keyexport GOOGLE_API_KEYyour_api_key_herefrom google import genai # The client gets the API key from the environment variable GEMINI_API_KEY. client genai.Client() response client.models.generate_content( modelgemini-2.5-flash, contentsExplain how AI works in a few words ) print(response.text)又或者改写代码同样替换你的key这个方式目前没成功过咱们还是第一个方法from google import genai import os api_key os.getenv(GOOGLE_API_KEY) # The client gets the API key from the environment variable GEMINI_API_KEY. client genai.Client() response client.models.generate_content( modelgemini-2.5-flash, contentsExplain how AI works in a few words ) print(response.text)set GEMINI_API_KEY您的API密钥因为咱们是windows当然我试过了目前只有下面这个方法可以成功。填入key,(然后关闭pycharm在打开就好了)运行结果然后咱们问一下问题。from google import genai # The client gets the API key from the environment variable GEMINI_API_KEY. client genai.Client() response client.models.generate_content( modelgemini-2.5-flash, contents夸一下我帅气 ) print(response.text)