Skip to content

Commit 8b6385f

Browse files
committed
Revert "remove max_tokens from example (google#425)"
This reverts commit e285bb4.
1 parent 695b0fd commit 8b6385f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

site/en/gemini-api/docs/get-started/python.ipynb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1752,6 +1752,7 @@
17521752
" # Only one candidate for now.\n",
17531753
" candidate_count=1,\n",
17541754
" stop_sequences=['x'],\n",
1755+
" max_output_tokens=20,\n",
17551756
" temperature=1.0)\n",
17561757
")"
17571758
]
@@ -1779,6 +1780,10 @@
17791780
],
17801781
"source": [
17811782
"text = response.text\n",
1783+
"\n",
1784+
"if response.candidates[0].finish_reason.name == \"MAX_TOKENS\":\n",
1785+
" text += '...'\n",
1786+
"\n",
17821787
"to_markdown(text)"
17831788
]
17841789
},

0 commit comments

Comments
 (0)