google-gemini/generative-ai-android

Facing error while using a Video as an input

sum20156 opened this issue · 3 comments

Description of the bug:

Configuration:

private val config by lazy {
        generationConfig {
            temperature = 0.7f
        }
    }
    private val generativeModel by lazy {
        GenerativeModel(
            modelName = "gemini-1.5-pro-latest",
            apiKey = "",
            generationConfig = config
        )
    }

val input = content {
            blob(
                mimeType,
                file.readBytes())
            text(message)
        }
        val resp =generativeModel.generateContent(input)

mimeType is video/mp4
video link: drive

Actual vs expected behavior:

Getting error:

com.google.ai.client.generativeai.type.ServerException: An internal error has occurred. Please retry or report in https://developers.generativeai.google/guide/troubleshooting at com.google.ai.client.generativeai.type.GoogleGenerativeAIException$Companion.from(Exceptions.kt:43) at com.google.ai.client.generativeai.GenerativeModel.generateContent(GenerativeModel.kt:115) at com.google.ai.client.generativeai.GenerativeModel$generateContent$1.invokeSuspend(Unknown Source:15) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108) at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115) at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:103) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684) Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@a7848d2, Dispatchers.IO]

Any other information you'd like to share?

No response

@sum20156, Thank you reporting this issue. This looks like an intermittent error and should work now.
This repository is for issues related to Android SDK client bugs or improvements and the client doesn't control the service's responses. For issues related to Gemini API, we would suggest you to use "Send Feedback" option in Gemini docs. Ref: Screenshot below. You can also post this issue on Discourse forum.

image

same issue