Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

streamGenerateContent works with gemini-pro but not gemini-1.5-flash

I am experiencing the following:

MethodModelOutcome
generateContentgemini-1.5-flashReturns expected response
generateContentgemini-proReturns expected response
streamGenerateContentgemini-1.5-flashSee below
streamGenerateContentgemini-proReturns expected responses

Specifically for streamGenerateContent with gemini-1.5-flash, using the following:

 

curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash:streamGenerateContent?key=api_key_here" \
-H 'Content-Type: application/json' -X POST -d '{"contents":[{"parts":[{"text": "Test"}]}]}'

 

The response is:

 

{
  "error": {
    "code": 400,
    "message": "Invalid resource field value in the request.",
    "status": "INVALID_ARGUMENT",
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.ErrorInfo",
        "reason": "RESOURCE_PROJECT_INVALID",
        "domain": "googleapis.com",
        "metadata": {
          "method": "google.cloud.aiplatform.internal.PredictionService.StreamGenerateContent",
          "service": "aiplatform.googleapis.com"
        }
      }
    ]
  }
}

 

Changing the model or the method within the command gets correct results again.
Any idea what could be the issue here?

2 1 420
1 REPLY 1