cloud-sean commited on
Commit
5f0bc7f
·
verified ·
1 Parent(s): 24721ae

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -19,6 +19,8 @@ from langchain.tools.json.tool import JsonSpec
19
  from langchain.indexes import VectorstoreIndexCreator
20
 
21
  openai.api_type = "azure"
 
 
22
  os.environ["OPENAI_API_BASE"] = openai.api_base = "https://japan-sean-aoai.openai.azure.com/"
23
  os.environ["OPENAI_API_VERSION"] = openai.api_version = "2024-04-01-preview"
24
  openai.api_key = os.environ["OPENAI_API_KEY"]
@@ -28,6 +30,7 @@ st.set_page_config(layout="wide")
28
 
29
  def analyze_healthcare_text(text):
30
  # Endpoint, headers and subscription key
 
31
  base_url = "https://ta4h-endpoint.cognitiveservices.azure.com/language/analyze-text/jobs"
32
  headers = {
33
  "Content-Type": "application/json",
@@ -304,6 +307,7 @@ with col3:
304
  col3.subheader("Copilot Concept")
305
  question = st.text_input("Ask a question to Copilot:")
306
  grounded = st.selectbox('Would you like to ground the model?', ('Not Grounded', 'Text Analytics for Health', 'Just Text Input', 'Both'))
 
307
  model = st.selectbox("Model", ["gpt-4o"])
308
  ask = st.button("Ask")
309
  report_btn = st.button("Generate SDOH Report")
 
19
  from langchain.indexes import VectorstoreIndexCreator
20
 
21
  openai.api_type = "azure"
22
+
23
+ # OPENAI_API_BASE was also hardcoded here , you should replace with your endpoint.
24
  os.environ["OPENAI_API_BASE"] = openai.api_base = "https://japan-sean-aoai.openai.azure.com/"
25
  os.environ["OPENAI_API_VERSION"] = openai.api_version = "2024-04-01-preview"
26
  openai.api_key = os.environ["OPENAI_API_KEY"]
 
30
 
31
  def analyze_healthcare_text(text):
32
  # Endpoint, headers and subscription key
33
+ # hardcoded , needs replacing with your endpoint but keep the path i.e - juyst replace the base url - https://ta4h-endpoint.cognitiveservices.azure.com
34
  base_url = "https://ta4h-endpoint.cognitiveservices.azure.com/language/analyze-text/jobs"
35
  headers = {
36
  "Content-Type": "application/json",
 
307
  col3.subheader("Copilot Concept")
308
  question = st.text_input("Ask a question to Copilot:")
309
  grounded = st.selectbox('Would you like to ground the model?', ('Not Grounded', 'Text Analytics for Health', 'Just Text Input', 'Both'))
310
+ # model is hardcoded - replace with whatever your deployment name is below
311
  model = st.selectbox("Model", ["gpt-4o"])
312
  ask = st.button("Ask")
313
  report_btn = st.button("Generate SDOH Report")