Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a notebook test script. #187

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Story writing - Use standard userdata cell
  • Loading branch information
MarkDaoust committed May 30, 2024
commit 0faf9613df3cdc280ae71ed9d0346ead10b85358
29 changes: 24 additions & 5 deletions examples/Story_Writing_with_Prompt_Chaining.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -113,18 +113,37 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "sTedGxE7_eah"
"id": "ed07713014be"
},
"outputs": [],
"source": [
"import google.generativeai as genai\n",
"from google.api_core import retry\n",
"from google.colab import userdata\n",
"from pprint import pprint\n",
"\n",
"from pprint import pprint"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "14c8b88a75ef"
},
"outputs": [],
"source": [
"from google.colab import userdata\n",
"GOOGLE_API_KEY=userdata.get('GOOGLE_API_KEY')\n",
"genai.configure(api_key=GOOGLE_API_KEY)\n",
"\n",
"genai.configure(api_key=GOOGLE_API_KEY)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "sTedGxE7_eah"
},
"outputs": [],
"source": [
"model = genai.GenerativeModel('gemini-1.0-pro')\n",
"\n",
"# For convenience, a simple wrapper to let the SDK handle error retries\n",
Expand Down