You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Google Vertex API requires location","articleBody":"I see this error when using the Vertex API:\r\n\r\n```\r\n\r\nFile [C:\\structure\\code\\bia-bob\\src\\bia_bob\\endpoints\\_googlevertex.py:26](file:///C:/structure/code/bia-bob/src/bia_bob/endpoints/_googlevertex.py#line=25), in generate_response_from_vertex_ai(model, system_prompt, user_prompt, chat_history, image, vision_model, vision_system_prompt)\r\n 24 if image is None:\r\n 25 if Context.client is None or not isinstance(Context.client, ChatSession):\r\n---> 26 gemini_model = GenerativeModel(model)\r\n 27 Context.client = gemini_model.start_chat()\r\n 28 system_result = Context.client.send_message(\r\n 29 system_prompt + \"\\n\\nConfirm these general instructions by answering 'yes'.\").text\r\n\r\nFile [~\\miniconda3\\envs\\bob-env\\Lib\\site-packages\\vertexai\\generative_models\\_generative_models.py:336](http://localhost:8888/lab/tree/demo/~/miniconda3/envs/bob-env/Lib/site-packages/vertexai/generative_models/_generative_models.py#line=335), in _GenerativeModel.__init__(self, model_name, generation_config, safety_settings, tools, tool_config, system_instruction)\r\n 330 model_name = _reconcile_model_name(model_name, project, location)\r\n 332 prediction_resource_name = _get_resource_name_from_model_name(\r\n 333 model_name, project, location\r\n 334 )\r\n--> 336 location = aiplatform_utils.extract_project_and_location_from_parent(\r\n 337 prediction_resource_name\r\n 338 )[\"location\"]\r\n 340 self._model_name = model_name\r\n 341 self._prediction_resource_name = prediction_resource_name\r\n\r\nKeyError: 'location'\r\n```\r\n","author":{"url":"https://github.com/haesleinhuepf","@type":"Person","name":"haesleinhuepf"},"datePublished":"2024-07-21T10:06:13Z","url":"https://github.com/haesleinhuepf/bia-bob/issues/175"}
Activity