(ci/cd) vertex ai

This commit is contained in:
ishaan-jaff 2023-12-07 10:44:45 -08:00
parent 8dd6786123
commit 85668ff415

View file

@ -25,12 +25,15 @@ messages = [{"content": user_message, "role": "user"}]
def load_vertex_ai_credentials(): def load_vertex_ai_credentials():
# Define the path to the vertex_key.json file # Define the path to the vertex_key.json file
vertex_key_path = os.getcwd() + '/vertex_key.json' print("loading vertex ai credentials")
filepath = os.path.dirname(os.path.abspath(__file__))
vertex_key_path = filepath + '/vertex_key.json'
# Read the existing content of the file or create an empty dictionary # Read the existing content of the file or create an empty dictionary
try: try:
with open(vertex_key_path, 'r') as file: with open(vertex_key_path, 'r') as file:
# Read the file content # Read the file content
print("Read vertexai file path")
content = file.read() content = file.read()
# If the file is empty or not valid JSON, create an empty dictionary # If the file is empty or not valid JSON, create an empty dictionary