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

list index out of range when following function call with responses #3702

Open
dudizimber opened this issue Apr 30, 2024 · 1 comment · May be fixed by #3703
Open

list index out of range when following function call with responses #3702

dudizimber opened this issue Apr 30, 2024 · 1 comment · May be fixed by #3703
Assignees
Labels
api: vertex-ai Issues related to the googleapis/python-aiplatform API.

Comments

@dudizimber
Copy link

https://github.com/googleapis/python-aiplatform/blame/b8b589ce9fff29d1721450d32b4a84a7f69413c3/vertexai/generative_models/_generative_models.py#L920

The above line throws a list index out of range error when the response returns with no candidates.

@product-auto-label product-auto-label bot added the api: vertex-ai Issues related to the googleapis/python-aiplatform API. label Apr 30, 2024
@Ark-kun
Copy link
Contributor

Ark-kun commented May 3, 2024

Can you please provide code that is causing this issue for you so that I can help you?

Are you using send_message or generate_content?

Responses lack candidates when they are blocked. A blocked response results in exception when using ChatSession. If you want to manually handle blocked responses, please use generate_content instead of send_message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: vertex-ai Issues related to the googleapis/python-aiplatform API.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants