From 18a414bb189b487cda7a4484ff6e1b667659e0aa Mon Sep 17 00:00:00 2001 From: Aqsa Ashfaq <90766914+AqsaAshfaq07@users.noreply.github.com> Date: Sun, 9 Jul 2023 22:35:22 +0500 Subject: [PATCH] Add project id When working with services like Vertex AI, you need to provide a project ID to ensure that your requests and operations are associated with the correct project and have the necessary permissions. The project ID serves as a unique identifier for your project within Google Cloud. So its compulsory to add it here! --- app/chat.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/chat.py b/app/chat.py index db48172..3cbeff9 100644 --- a/app/chat.py +++ b/app/chat.py @@ -6,8 +6,9 @@ ) from langchain.schema import HumanMessage, SystemMessage -chat = ChatVertexAI() - +project_id = "gcu-022" # Replace with your actual project ID +chat = ChatVertexAI(project_id = project_id) # adding project id to the ChatVertexAI constructor is compulsory because it enables the chat model to authenticate and authorize its operations using the specified project. +# This allows the model to access the required resources and services associated with your project, such as language processing capabilities, storage, and other APIs. async def chat(commons): messages = [