Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix VertexAI Empty Model Parts Error#2203

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

caesarnine
Copy link
Contributor

Fixes this error that occurs with VertexAI Gemini models fairly often in my experience.

Issue that's open with the same error:#2032

ClientError: 400 INVALID_ARGUMENT. {'error': {'code': 400, 'message': 'Unable to submitrequest because it must include at least one parts field, which describes the promptinput. Learn more:https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/gemini', 'status':'INVALID_ARGUMENT'}}

Due to the last message being something like:

    {        "parts": [{ "content": "", "part_kind": "text" }],        "usage": {            "requests": 1,            "request_tokens": 25308,            "response_tokens": 0,            "total_tokens": 25308,            "details": {                "cached_content_tokens": 15171,                "text_cache_tokens": 15171,                "text_prompt_tokens": 25308            }        },        "model_name": "gemini-2.5-pro",        "timestamp": "2025-07-14T17:33:52.568858Z",        "kind": "response",        "vendor_details": { "finish_reason": "STOP" },        "vendor_id": "fz91aPDpJYienvgP757VgQ0"    }

Tested the change against a session that was previously hard crashing and it works fine now.

@DouweM
Copy link
Contributor

@caesarnine Thanks! Can you please add a test for the scenario that this fixes, to ensure it doesn't accidentally break again in the future?

@caesarnine
Copy link
ContributorAuthor

caesarnine commentedJul 17, 2025
edited
Loading

@DouweM Done - let me know if it looks ok (never used pytest-vcr anymore, so feel free to let me know if I did something wrong there).

@KludexKludex merged commit420166d intopydantic:mainJul 17, 2025
18 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@KludexKludexKludex approved these changes

Assignees

@DouweMDouweM

Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@caesarnine@DouweM@Kludex

[8]ページ先頭

©2009-2025 Movatter.jp