-
Notifications
You must be signed in to change notification settings - Fork 609
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
Use candidates[0] in makersuite template. #136
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't find any info on why make this change, so assuming you know what you're doing, LGTM :)
Hah, it's not reproducing since Mark Daoust updated the SDK version :(
(side note -- three Marks on a bug!)
Here was the Colab that previously only returned a single result:
https://colab.research.google.com/github/google/generative-ai-docs/blob/main/templates/makersuite_text_prompt.ipynb
Given that it's not reproducing, I don't personally see a need to change
the return syntax
…On Wed, Oct 4, 2023 at 11:31 AM Mark McDonald ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In templates/makersuite_chat_prompt.ipynb
<#136 (comment)>
:
> @@ -112,7 +112,7 @@
" examples=examples,\n",
" messages=messages\n",
")\n",
- "print(response.last)"
+ "print(response.candidates[0]['content'])"
.result is .candidates[0]["output"] but with better edge-case handling:
https://github.com/google/generative-ai-python/blob/2a33920de9de89208e9e7406435a0b15f3064bf6/google/generativeai/text.py#L186
.last is the same:
https://github.com/google/generative-ai-python/blob/2a33920de9de89208e9e7406435a0b15f3064bf6/google/generativeai/discuss.py#L528
Do you have a concrete example? It'd help to see the makersuite prompt as
well as the code where it's being executed. Even slight differences in
prompt can impact the generated result.
—
Reply to this email directly, view it on GitHub
<#136 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABVHNQJOCSGIXFXD64CHVLX5UUI3AVCNFSM6AAAAAA5P3SRTOVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTMNJXGA4TANZUGQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
The main thing here was that if you set the |
Ohhh of course - that makes sense. No objection here then (though it would be nice to add some more onboarding content to these guides one day) |
No description provided.