Open yschimke opened 10 months ago
My current workaround is
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE", "EXPOSED_FUNCTION_RETURN_TYPE", "EXPOSED_PARAMETER_TYPE")
GenerativeModel(
modelName = "gemini-pro",
apiKey = BuildConfig.GEMINI_API_KEY,
generationConfig = config,
controller = com.google.ai.client.generativeai.internal.api.APIController(
key = BuildConfig.GEMINI_API_KEY,
model = "gemini-pro",
httpEngine = OkHttp.create {
proxy = Proxy(Proxy.Type.HTTP, InetSocketAddress("10.0.2.2", 3125))
}
)
)
https://github.com/google/generative-ai-android/blob/7043908ce793a6d424f8c10985d4654bc1b010e5/generativeai/src/main/java/com/google/ai/client/generativeai/internal/api/APIController.kt#L71
Doesn't allow changing the HttpClient, for example adding logging, or configuring a proxy.
Ideally a Ktor engine could be passed in, or if not possible a OkHttp Call.Factory.