Skip to content

Commit

Permalink
Add ID
Browse files Browse the repository at this point in the history
  • Loading branch information
graceshawyan committed Nov 3, 2024
2 parents e44c7ba + ab579b4 commit 8daf183
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions Gemini.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"c:\\Users\\osbey\\AppData\\Local\\anaconda3\\envs\\pytorch-gpu\\python.exe\n"
]
}
],
"source": [
"import sys\n",
"print(sys.executable)\n"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"ename": "ModuleNotFoundError",
"evalue": "No module named 'google'",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[1;32mIn[1], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mgoogle\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mgenerativeai\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m \u001b[38;5;21;01mgenai\u001b[39;00m\n\u001b[0;32m 3\u001b[0m genai\u001b[38;5;241m.\u001b[39mconfigure(api_key\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mAIzaSyDOnEl6Deck7JdVI3wIhOMPnr8UYAq253A\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m 5\u001b[0m prompt \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mGenerate an advertisement for a new manga series targeting international audiences.\u001b[39m\u001b[38;5;124m\"\u001b[39m\n",
"\u001b[1;31mModuleNotFoundError\u001b[0m: No module named 'google'"
]
}
],
"source": [
"import google.generativeai as genai\n",
"\n",
"genai.configure(api_key=\"AIzaSyDOnEl6Deck7JdVI3wIhOMPnr8UYAq253A\")\n",
"\n",
"prompt = \"Generate an advertisement for a new manga series targeting international audiences.\"\n",
"response = genai.generate_content(prompt)\n",
"print(response.result)\n"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "pytorch-gpu",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.14"
}
},
"nbformat": 4,
"nbformat_minor": 2
}

0 comments on commit 8daf183

Please sign in to comment.