feat: add timeout to gemini_image;
This pull request adds support for specifying a request timeout in the `gemini_image` and `gemini_image.vertex` functions, improving robustness for slow or unreliable network conditions. The timeout parameter is now documented and implemented in both the R code and the associated documentation.
**New timeout parameter support:**
* Added a `timeout` parameter (default 60 seconds) to both `gemini_image` and `gemini_image.vertex` functions, allowing users to control the maximum duration for API requests. [[1]](diffhunk://#diff-aab8a9f0d182ac84275a450bb48320772e3d34568da1e50758100603b5bc09f9R18) [[2]](diffhunk://#diff-aab8a9f0d182ac84275a450bb48320772e3d34568da1e50758100603b5bc09f9L40-R41) [[3]](diffhunk://#diff-aab8a9f0d182ac84275a450bb48320772e3d34568da1e50758100603b5bc09f9R157-R167)
* Updated API requests in both functions to use the specified timeout by incorporating the `req_timeout` function from `httr2`. [[1]](diffhunk://#diff-aab8a9f0d182ac84275a450bb48320772e3d34568da1e50758100603b5bc09f9R116) [[2]](diffhunk://#diff-aab8a9f0d182ac84275a450bb48320772e3d34568da1e50758100603b5bc09f9R243)
**Documentation updates:**
* Updated Roxygen comments and `.Rd` documentation files to include the new `timeout` parameter and its default value. [[1]](diffhunk://#diff-ee6d053f64cce6de1cad20bde1907d543ec4772cf6cabeacd3f9a9f37ad4cb6dL16-R17) [[2]](diffhunk://#diff-ee6d053f64cce6de1cad20bde1907d543ec4772cf6cabeacd3f9a9f37ad4cb6dR44-R45) [[3]](diffhunk://#diff-76553075d73848d2d1eff7a53c7f2376ff6c95c372e0919647539dcfe370aea4L16-R17) [[4]](diffhunk://#diff-76553075d73848d2d1eff7a53c7f2376ff6c95c372e0919647539dcfe370aea4R43-R44)
* Added `req_timeout` to the list of imported functions from `httr2` in both functions. [[1]](diffhunk://#diff-aab8a9f0d182ac84275a450bb48320772e3d34568da1e50758100603b5bc09f9L28-R29) [[2]](diffhunk://#diff-aab8a9f0d182ac84275a450bb48320772e3d34568da1e50758100603b5bc09f9R157-R167)close #69
合并状态:未合并 关闭于 2025-12-05 1 条评论