GoogleCloudPlatform / firebase-extensions

Apache License 2.0
77 stars 41 forks source link

[firestore-genai-chatbot] [VertexAI.ClientError]: got status: 404 Not Found when I use gemini-1.5-pro #472

Closed suztomo closed 7 months ago

suztomo commented 7 months ago

[READ] Step 1: Are you in the right place?

In https://extensions.dev/extensions/googlecloud/firestore-genai-chatbot , the source code points to this repository.

(Previously in https://github.com/GoogleCloudPlatform/firebase-extensions/issues/380, the cause of 404 Not Found was the location. It was with gemini-1.0-pro. Now it seems gemini-1.5-pro generates the same error.)

[REQUIRED] Step 2: Describe your configuration

Gemini API Provider
vertex-ai
Google AI API Key (Optional)
Parameter not set
Gemini model
gemini-1.5-pro
Firestore Collection Path
gemini/{userId}/notes
Prompt Field
prompt
Response Field
response
Order Field (Optional)
createTime
Cloud Functions location
us-west4
Context (Optional)
Parameter not set
Temperature (Optional)
Parameter not set
Nucleus sampling probability (Optional)
Parameter not set
Sampling strategy parameter (Optional)
Parameter not set
Candidate count (Optional)
1
Max Output Tokens (Optional)
Parameter not set
Candidates field (Optional)
candidates
Enable per document overrides.
no
Hate Speech Threshold (Optional)
HARM_BLOCK_THRESHOLD_UNSPECIFIED
Dangerous Content Threshold (Optional)
HARM_BLOCK_THRESHOLD_UNSPECIFIED
harassment Content Threshold (Optional)
HARM_BLOCK_THRESHOLD_UNSPECIFIED
Sexual Content Threshold (Optional)
HARM_BLOCK_THRESHOLD_UNSPECIFIED

[REQUIRED] Step 3: Describe the problem

When I tried to use gemini-1.5-pro, the extension fails to generate respond. The log shows "404 Not Found"

Screenshot 2024-04-12 at 11 29 22 PM
[VertexAI.ClientError]: got status: 404 Not Found
    at throwErrorIfNotOK (/workspace/node_modules/@google-cloud/vertexai/build/src/index.js:395:15)
    at GenerativeModel.generateContentStream (/workspace/node_modules/@google-cloud/vertexai/build/src/index.js:321:9)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async VertexDiscussionClient.generateResponse (/workspace/lib/generative-client/vertex_ai.js:54:36)
    at async VertexDiscussionClient.send (/workspace/lib/generative-client/base_class.js:26:16)
    at async FirestoreOnWriteProcessor.generateChatResponse [as processFn] (/workspace/lib/generate_chat_response.js:25:20)
    at async FirestoreOnWriteProcessor.run (/workspace/lib/firestore-onwrite-processor/index.js:83:28) {
  stack_trace: undefined
}

It was working fine with gemini-1.0-pro.

Steps to reproduce:

  1. Create a document with "prompt" field to a document that matches the specified collection path (Firestore Collection Path).
Expected result

The extension just works to respond message using gemini-1.5-pro.

Actual result

The document is populated with the error message "An error occurred while processing the provided message, Failed to generate response, see function logs for more details."

Screenshot 2024-04-12 at 11 36 06 PM

Read the Cloud Functions log for the function. It has the 404 error of the screenshot above.

Notes

Gemini 1.5 is in preview. https://cloud.google.com/products?hl=en#product-launch-stages:

Preview offerings are often publicly announced, but are not necessarily feature-complete, and no SLAs or technical support commitments are provided for these

So this might not get an answer.

suztomo commented 7 months ago

It turned out that the valid value for Gemini 1.5 is "gemini-1.5-pro-preview-0409".

Screenshot 2024-04-13 at 11 03 58 PM

After I set this value there, it started working.

Note that the reason I was able to know the working model name was because I tried Gemini 1.5, which belongs to the multimodal section, in Vertex AI Studio and its "GET CODE" button showed the model name.

Screenshot 2024-04-13 at 10 49 46 PM