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

[Enhancement]: Add support for custom Google Generative AI Base URL #481

Closed
1 task done
borrrrring opened this issue Apr 7, 2024 · 10 comments
Closed
1 task done
Assignees
Labels
enhancement New feature or request released

Comments

@borrrrring
Copy link

Before Requesting

  • I have searched the existing issues, and there is no existing issue for my feature request

What feature do you want?

I want a feature! Because it keeps prompting "User location is not supported for the API use." in my country, I need to build a proxy to use it normally.

@borrrrring borrrrring added the enhancement New feature or request label Apr 7, 2024
@intitni
Copy link
Owner

intitni commented Apr 7, 2024

I was hoping Google could do it but apparently, they won't.

google-gemini/generative-ai-swift#76

@borrrrring
Copy link
Author

borrrrring commented Apr 8, 2024

Could you please use the REST API to call Google Generative AI? This way, we can customize the Base URL. Thanks a lot. @intitni

@intitni
Copy link
Owner

intitni commented Apr 8, 2024

Using the REST API is too tricky. I have already made a fork of generative-ai-swift to support changing the base URL.

@intitni intitni added pending release Finished, but not yet released beta Beta testing labels Apr 8, 2024
@intitni
Copy link
Owner

intitni commented Apr 11, 2024

Released in 0.32.0 beta2

@borrrrring
Copy link
Author

borrrrring commented Apr 11, 2024

WX20240411-162742@2x
The new bug of generative-ai-swift about the new model which named "gemini-1.5-pro-latest". Highly recommended to use REST API😂😂 @intitni

@intitni
Copy link
Owner

intitni commented Apr 11, 2024

1.5 models only works for API version v1beta according to this issue google-gemini/generative-ai-python#227 (comment)

Maybe we should just wait until they release it.

The SDK is only responsible for composing the request and handling the response. Behind the scene it still calls the REST API.

@intitni
Copy link
Owner

intitni commented Apr 11, 2024

Since you are already using a proxy, you can try simply rewriting the v1 in the url to v1beta.

@borrrrring
Copy link
Author

borrrrring commented Apr 11, 2024

image image image The SDK is only responsible for composing the request and handling the response. Behind the scene it still calls the REST API. This is what I found. Maybe using "/v1beta" is better than "/v1" because it is compatible with all models.

@intitni
Copy link
Owner

intitni commented Apr 11, 2024

Beta is marked as beta for a reason. The API may not be stable and can break the whole feature when it changes. I can add a feature to allow users to specify the api version in settings. It will be included in the coming major release.

@intitni intitni added released and removed pending release Finished, but not yet released beta Beta testing labels Apr 16, 2024
@intitni
Copy link
Owner

intitni commented Apr 16, 2024

Released in 0.32.0

@intitni intitni closed this as completed Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request released
Projects
None yet
Development

No branches or pull requests

2 participants