acpotts commited on
Commit
0c998db
·
1 Parent(s): 9a9c92d

update env variables

Browse files
Files changed (1) hide show
  1. agent.py +12 -11
agent.py CHANGED
@@ -6,18 +6,19 @@ from typing import List, TypedDict
6
  from langgraph.types import Command
7
  from typing import Literal, List
8
  from langgraph.graph import StateGraph, START, END
9
- import boto3
 
10
 
11
- import streamlit as st
12
 
13
- ssm = boto3.client(
14
- 'ssm',
15
- region_name="us-east-2",
16
- # aws_access_key_id=os.environ['AWS_ACCESS_KEY'],
17
- # aws_secret_access_key=os.environ['AWS_SECRET_ACCESS_KEY']
18
- )
19
 
20
- os.environ['TAVILY_API_KEY'] = ssm.get_parameter(Name="TAVILY_API_KEY", WithDecryption=True)['Parameter']['Value']
21
 
22
  def get_platform_tips(state) -> Command[Literal['web_search']]:
23
  """Conduct a web search to find up-to-date information on how to write an effective post for the provided platform."""
@@ -152,7 +153,7 @@ def fetch_image(state) -> Command[Literal[END]]:
152
  }
153
 
154
  headers = {
155
- "Authorization": ssm.get_parameter(Name="PEXEL_API_KEY", WithDecryption=True)['Parameter']['Value']
156
  }
157
 
158
  response = requests.get(url, headers=headers, params=params)
@@ -182,7 +183,7 @@ model = ChatGoogleGenerativeAI(
182
  max_tokens=None,
183
  timeout=None,
184
  max_retries=2,
185
- google_api_key=ssm.get_parameter(Name="GOOGLE_API_KEY", WithDecryption=True)['Parameter']['Value']
186
  )
187
 
188
  workflow = StateGraph(State)
 
6
  from langgraph.types import Command
7
  from typing import Literal, List
8
  from langgraph.graph import StateGraph, START, END
9
+ # import boto3
10
+ from dotenv import load_dotenv
11
 
12
+ load_dotenv()
13
 
14
+ # ssm = boto3.client(
15
+ # 'ssm',
16
+ # region_name="us-east-2",
17
+ # # aws_access_key_id=os.environ['AWS_ACCESS_KEY'],
18
+ # # aws_secret_access_key=os.environ['AWS_SECRET_ACCESS_KEY']
19
+ # )
20
 
21
+ # os.environ['TAVILY_API_KEY'] = ssm.get_parameter(Name="TAVILY_API_KEY", WithDecryption=True)['Parameter']['Value']
22
 
23
  def get_platform_tips(state) -> Command[Literal['web_search']]:
24
  """Conduct a web search to find up-to-date information on how to write an effective post for the provided platform."""
 
153
  }
154
 
155
  headers = {
156
+ "Authorization": os.getenv("PEXELS_API_KEY")#ssm.get_parameter(Name="PEXEL_API_KEY", WithDecryption=True)['Parameter']['Value']
157
  }
158
 
159
  response = requests.get(url, headers=headers, params=params)
 
183
  max_tokens=None,
184
  timeout=None,
185
  max_retries=2,
186
+ # google_api_key=ssm.get_parameter(Name="GOOGLE_API_KEY", WithDecryption=True)['Parameter']['Value']
187
  )
188
 
189
  workflow = StateGraph(State)