Commit e221d19
fix(vertex): honor max_retries=0 and disable GAPIC retries (#1185)
<!--
# Thank you for contributing to LangChain-google!
-->
<!--
## Checklist for PR Creation
- [ ] PR Title: "[package]: [brief description]"
- Where "package" is genai, vertexai, or community
- Use "docs: ..." for purely docs changes, "templates: ..." for template
changes, "infra: ..." for CI changes
- Example: "community: add foobar LLM"
- [ ] PR Description and Relevant issues:
- Description of the change
- Relevant issues (if applicable)
- Any dependencies required for this change
- [ ] Add Tests and Docs:
- If adding a new integration:
1. Include a test for the integration (preferably unit tests that do not
rely on network access)
2. Add an example notebook showing its use (place in the
`docs/docs/integrations` directory)
- [ ] Lint and Test:
- Run `make format`, `make lint`, and `make test` from the root of the
package(s) you've modified
- See contribution guidelines for more:
https://github.com/langchain-ai/langchain-google/blob/main/README.md#contribute-code
-->
<!--
## Additional guidelines
- [ ] PR title and description are appropriate
- [ ] Necessary tests and documentation have been added
- [ ] Lint and tests pass successfully
- [ ] The following additional guidelines are adhered to:
- Optional dependencies are imported within functions
- No unnecessary dependencies added to pyproject.toml files (except
those required for unit tests)
- PR doesn't touch more than one package
- Changes are backwards compatible
-->
## PR Description
Fixes issue where max_retries did not work for VertexAI and
ChatVertexAI.
Now max_retries=0 correctly disables retries, and GAPIC retries are also
disabled.
## Relevant issues
Fixes #1093
## Type
<!-- Select the type of Pull Request -->
<!-- Keep only the necessary ones -->
🐛 Bug Fix
## Changes(optional)
## Testing(optional)
<!-- Test procedure -->
<!-- Test result -->
## Note(optional)
<!-- Information about the errors fixed by PR -->
<!-- Remaining issue or something -->
<!-- Other information about PR -->
Signed-off-by: jitokim <[email protected]>
Co-authored-by: Mason Daugherty <[email protected]>1 parent 0ab3efc commit e221d19
File tree
3 files changed
+86
-2
lines changed- libs/vertexai
- langchain_google_vertexai
- tests/unit_tests
3 files changed
+86
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
116 | 119 | | |
117 | 120 | | |
118 | | - | |
| 121 | + | |
119 | 122 | | |
120 | 123 | | |
121 | 124 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
173 | | - | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
174 | 181 | | |
175 | 182 | | |
176 | 183 | | |
| |||
775 | 782 | | |
776 | 783 | | |
777 | 784 | | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
778 | 789 | | |
779 | 790 | | |
780 | 791 | | |
| |||
805 | 816 | | |
806 | 817 | | |
807 | 818 | | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
808 | 823 | | |
809 | 824 | | |
810 | 825 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
0 commit comments