Skip to content

Conversation

@Tombiczek
Copy link
Contributor

@Tombiczek Tombiczek commented Nov 25, 2025

Description

Added timeout parameter support to ChatVertexAI and VertexAI classes to control API request timeouts.

Relevant issues

Fixes #1286

Type

🆕 New Feature
🐛 Bug Fix
✅ Test

Changes

  • Added timeout parameter to ChatVertexAI and VertexAI
  • Refactored timeout field to _VertexAICommon parent class (also used by ChatAnthropicVertex)
  • Added integration tests for ChatVertexAI timeout (streaming and non-streaming modes)
  • Added unit test for VertexAI timeout parameter pass-through
  • Minor formatting change in test_anthropic_utils.py (auto-formatted by make format)

Testing

All new and existing tests pass:

  • 2 new integration tests:

    • test_chat_vertexai_timeout_non_streaming() - verifies timeout in non-streaming mode
    • test_chat_vertexai_timeout_streaming() - verifies timeout in streaming mode
  • 1 new unit test:

    • test_timeout_parameter() - verifies timeout parameter is passed to underlying client

Additionally:

  • make format - passed
  • make lint - passed
  • make test - passed

Note

ChatAnthropicVertex already had timeout support (now inherited from _VertexAICommon). No new tests were added for this class to keep changes minimal per contribution guidelines.

@Tombiczek Tombiczek marked this pull request as ready for review November 25, 2025 22:52
@mdrxy mdrxy merged commit 6265a3f into langchain-ai:main Dec 1, 2025
14 checks passed
@Tombiczek Tombiczek deleted the fix/vertexai-timeout-handling-1286 branch December 2, 2025 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(vertexai): timeout config not working in ChatVertexAI and VertexAI

2 participants