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

add timeout option #7

Merged
merged 1 commit into from
Dec 26, 2023
Merged

add timeout option #7

merged 1 commit into from
Dec 26, 2023

Conversation

naoa
Copy link
Contributor

@naoa naoa commented Dec 26, 2023

We would like to set timeout for Faraday.

@gbaptista
Copy link
Owner

Hi @naoa, thank you for your contribution!

I took the liberty to slightly change your implementation to the following:

Gemini.new(
  credentials: { service: 'vertex-ai-api', region: 'us-east4' },
  options: {
    model: 'gemini-pro',
    connection: { request: { timeout: 5 } }
  }
)

The changes have been made to allow for more precise timeout configurations and also to pave the way for additional options related to Faraday in the future:

Gemini.new(
  credentials: { service: 'vertex-ai-api', region: 'us-east4' },
  options: {
    model: 'gemini-pro',
    connection: {
      request: {
        timeout: 5,
        open_timeout: 5,
        read_timeout: 5,
        write_timeout: 5
      }
    }
  }
)

Hope that's okay; feel free to open another PR if you prefer to change something.

@gbaptista gbaptista merged commit ee6e9d5 into gbaptista:main Dec 26, 2023
@gbaptista
Copy link
Owner

gbaptista commented Dec 26, 2023

Merged and released; the new version is now available on RubyGems:

gem 'gemini-ai', '~> 3.1'

@naoa
Copy link
Contributor Author

naoa commented Dec 26, 2023

Thanks for your quick action!

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.

None yet

2 participants