code: from langchain.prompts import PromptTemplate
  from langchain.output_parsers import PydanticOutputParser
  
  from llama_index import VectorStoreIndex, ServiceContext, StorageContext
  from llama_index.vector_stores import FaissVectorStore
  from llama_index.tools import QueryEngineTool, ToolMetadata
  from llama_index.query_engine import SubQuestionQueryEngine
  from llama_index.embeddings import OpenAIEmbedding
  from llama_index.schema import Document
  from llama_index.node_parser import UnstructuredElementNodeParser
  
  from src.utils import get_model, process_pdf2, generate_pydantic_model
  from src.pydantic_models import FiscalYearHighlights, StrategyOutlookFutureDirection, RiskManagement, CorporateGovernanceSocialResponsibility, InnovationRnD
  # from src.fields import (
  #     fiscal_year_fields, fiscal_year_attributes, 
  #     strat_outlook_fields, strat_outlook_attributes, 
  #     risk_management_fields, risk_management_attributes, 
  #     innovation_fields, innovation_attributes
  # )
  
  from src.fields2 import (
      fiscal_year, fiscal_year_attributes,
      strat_outlook, strat_outlook_attributes,
      risk_management, risk_management_attributes,
      innovation, innovation_attributes
  )
  
  import streamlit as st
  import os
  import faiss
  import time
  from pypdf import PdfReader
  
  
  st.set_page_config(page_title="Annual Report Analyzer", page_icon=":card_index_dividers:", initial_sidebar_state="expanded", layout="wide")
  
  st.title(":card_index_dividers: Annual Report Analyzer")
  st.info("""
  Begin by uploading the annual report of your chosen company in PDF format. Afterward, click on 'Process PDF'. Once the document has been processed, tap on 'Analyze Report' and the system will start its magic. After a brief wait, you'll be presented with a detailed analysis and insights derived from the report for your reading.
  """)
  
  def process_pdf(pdf):
      file = PdfReader(pdf)
  
      document_list = []
      for page in file.pages:
          document_list.append(Document(text=str(page.extract_text())))
  
      node_paser = UnstructuredElementNodeParser()
      nodes = node_paser.get_nodes_from_documents(document_list, show_progress=True)
      
      return nodes
  
  
  def get_vector_index(nodes, vector_store):
      print(nodes)
      llm = get_model("openai")
      if vector_store == "faiss":
          d = 1536
          faiss_index = faiss.IndexFlatL2(d)
          vector_store = FaissVectorStore(faiss_index=faiss_index)
          storage_context = StorageContext.from_defaults(vector_store=vector_store)
          # embed_model = OpenAIEmbedding()
          # service_context = ServiceContext.from_defaults(embed_model=embed_model)
          service_context = ServiceContext.from_defaults(llm=llm) 
          index = VectorStoreIndex(nodes, 
              service_context=service_context,
              storage_context=storage_context
          )
      elif vector_store == "simple":
          index = VectorStoreIndex.from_documents(nodes)
  
  
      return index
  
  
  
  def generate_insight(engine, insight_name, section_name, output_format):
  
      with open("prompts/report.prompt", "r") as f:
          template = f.read()
  
      prompt_template = PromptTemplate(
          template=template,
          input_variables=['insight_name', 'section_name', 'output_format']
      )
  
      formatted_input = prompt_template.format(insight_name=insight_name, section_name=section_name, output_format=output_format)
      print(formatted_input)
      response = engine.query(formatted_input)
      return response.response
      
  
  
  def report_insights(engine, section_name, fields_to_include, section_num):
  
      fields = None
      attribs = None
  
      if section_num == 1:
          fields = fiscal_year
          attribs = fiscal_year_attributes
      elif section_num == 2:
          fields = strat_outlook
          attribs = strat_outlook_attributes
      elif section_num == 3:
          fields = risk_management
          attribs = risk_management_attributes
      elif section_num == 4:
          fields = innovation
          attribs = innovation_attributes
  
      ins = {}
      for i, field in enumerate(attribs):
          if fields_to_include[i]:
              response = generate_insight(engine, field, section_name, str({field: fields[field]}))
              ins[field] = response
  
      return {
          "insights": ins
      }
  
  def get_query_engine(engine):
      llm = get_model("openai")
      service_context = ServiceContext.from_defaults(llm=llm)
  
      query_engine_tools = [
          QueryEngineTool(
              query_engine=engine,
              metadata=ToolMetadata(
                  name="Annual Report",
                  description=f"Provides information about the company from its annual report.",
              ),
          ),
      ]
  
  
      s_engine = SubQuestionQueryEngine.from_defaults(
          query_engine_tools=query_engine_tools,
          service_context=service_context
      )
      return s_engine
  
  
  for insight in fiscal_year_attributes:
      if insight not in st.session_state:
          st.session_state[insight] = None
  
  for insight in strat_outlook_attributes:
      if insight not in st.session_state:
          st.session_state[insight] = None
  
  for insight in risk_management_attributes:
      if insight not in st.session_state:
          st.session_state[insight] = None
  
  for insight in innovation_attributes:
      if insight not in st.session_state:
          st.session_state[insight] = None
  
  if "end_time" not in st.session_state:
      st.session_state.end_time = None
  
  
  if "process_doc" not in st.session_state:
          st.session_state.process_doc = False
  
  
  st.sidebar.info("""
  You can get your OpenAI API key [here](https://openai.com/blog/openai-api)
  """)
  OPENAI_API_KEY = st.sidebar.text_input("OpenAI API Key", type="password")
  os.environ["OPENAI_API_KEY"] = OPENAI_API_KEY
  
  if not OPENAI_API_KEY:
      st.error("Please enter your OpenAI API Key")
  
  if OPENAI_API_KEY:
      pdfs = st.sidebar.file_uploader("Upload the annual report in PDF format", type="pdf")
      st.sidebar.info("""
      Example reports you can upload here: 
      - [Apple Inc.](https://s2.q4cdn.com/470004039/files/doc_financials/2022/q4/_10-K-2022-(As-Filed).pdf)
      - [Microsoft Corporation](https://microsoft.gcs-web.com/static-files/07cf3c30-cfc3-4567-b20f-f4b0f0bd5087)
      - [Tesla Inc.](https://digitalassets.tesla.com/tesla-contents/image/upload/IR/TSLA-Q4-2022-Update)
      """)
  
      if st.sidebar.button("Process Document"):
          with st.spinner("Processing Document..."):
              nodes = process_pdf(pdfs)
              st.session_state.index = get_vector_index(nodes, vector_store="faiss")
              st.session_state.process_doc = True
              
  
          st.toast("Document Processsed!")
  
  
      if st.session_state.process_doc:
  
          col1, col2 = st.columns([0.25, 0.75])
  
          with col1:
              st.write("""
                  ### Select Insights
              """)
              
              with st.expander("**Fiscal Year Highlights**", expanded=True):
                  performance_highlights = st.toggle("Performance Highlights")
                  major_events = st.toggle("Major Events")
                  challenges_encountered = st.toggle("Challenges Encountered")
  
                  fiscal_year_highlights_list = [performance_highlights, major_events, challenges_encountered]
  
              with st.expander("**Strategy Outlook and Future Direction**", expanded=True):
                  strategic_initiatives = st.toggle("Strategic Initiatives")
                  market_outlook = st.toggle("Market Outlook")
                  product_roadmap = st.toggle("Product Roadmap")
  
                  strategy_outlook_future_direction_list = [strategic_initiatives, market_outlook, product_roadmap]
  
              with st.expander("**Risk Management**", expanded=True):
                  risk_factors = st.toggle("Risk Factors")
                  risk_mitigation = st.toggle("Risk Mitigation")
  
                  risk_management_list = [risk_factors, risk_mitigation]
  
              with st.expander("**Innovation and R&D**", expanded=True):
                  r_and_d_activities = st.toggle("R&D Activities")
                  innovation_focus = st.toggle("Innovation Focus")
  
                  innovation_and_rd_list = [r_and_d_activities, innovation_focus]
  
  
          with col2:
              if st.button("Analyze Report"):
                  engine = get_query_engine(st.session_state.index.as_query_engine(similarity_top_k=3))
                  start_time = time.time()
  
                  with st.status("**Analyzing Report...**"):
  
  
                      if any(fiscal_year_highlights_list):
                          st.write("Fiscal Year Highlights...")
  
                          for i, insight in enumerate(fiscal_year_attributes):
                              if st.session_state[insight]:
                                  fiscal_year_highlights_list[i] = False
  
                          response = report_insights(engine, "Fiscal Year Highlights", fiscal_year_highlights_list, 1)
  
                          for key, value in response["insights"].items():
                              st.session_state[key] = value
  
                      if any(strategy_outlook_future_direction_list):
                          st.write("Strategy Outlook and Future Direction...")
  
                          for i, insight in enumerate(strat_outlook_attributes):
                              if st.session_state[insight]:
                                  strategy_outlook_future_direction_list[i] = False
                          response = report_insights(engine, "Strategy Outlook and Future Direction", strategy_outlook_future_direction_list, 2)
  
                          for key, value in response["insights"].items():
                              st.session_state[key] = value
  
  
                      if any(risk_management_list):
                          st.write("Risk Management...")
  
                          for i, insight in enumerate(risk_management_attributes):
                              if st.session_state[insight]:
                                  risk_management_list[i] = False
                          
                          response = report_insights(engine, "Risk Management", risk_management_list, 3)
  
                          for key, value in response["insights"].items():
                              st.session_state[key] = value
  
                      if any(innovation_and_rd_list):
                          st.write("Innovation and R&D...")
  
                          for i, insight in enumerate(innovation_attributes):
                              if st.session_state[insight]:
                                  innovation_and_rd_list[i] = False
  
                          response = report_insights(engine, "Innovation and R&D", innovation_and_rd_list, 4)
                          st.session_state.innovation_and_rd = response
  
                          for key, value in response["insights"].items():
                              st.session_state[key] = value
  
                      st.session_state["end_time"] = "{:.2f}".format((time.time() - start_time))
  
  
  
                      st.toast("Report Analysis Complete!")
              
              if st.session_state.end_time:
                  st.write("Report Analysis Time: ", st.session_state.end_time, "s")
  
  
          # if st.session_state.all_report_outputs:
          #     st.toast("Report Analysis Complete!")
              
              tab1, tab2, tab3, tab4 = st.tabs(["Fiscal Year Highlights", "Strategy Outlook and Future Direction", "Risk Management", "Innovation and R&D"])
  
              
                  
  
              with tab1:
                  st.write("## Fiscal Year Highlights")
                  try: 
                      if performance_highlights:
                          if st.session_state['performance_highlights']:
                              st.write("### Performance Highlights")
                              st.write(st.session_state['performance_highlights'])
                          else:
                              st.error("fiscal Year Highlights insight has not been generated")
                  except:
                      st.error("This insight has not been generated")
  
                  try:
                      if major_events:
                          if st.session_state["major_events"]:
                              st.write("### Major Events")
                              st.write(st.session_state["major_events"])
                          else:
                              st.error("Major Events insight has not been generated")
                  except:
                      st.error("This insight has not been generated")
                  try:
                      if challenges_encountered:
                          if st.session_state["challenges_encountered"]:
                              st.write("### Challenges Encountered")
                              st.write(st.session_state["challenges_encountered"])
                          else:
                              st.error("Challenges Encountered insight has not been generated")
                  except:
                      st.error("This insight has not been generated")
                  # st.write("### Milestone Achievements")
                  # st.write(str(st.session_state.fiscal_year_highlights.milestone_achievements))
  
  
              
              with tab2:
                  st.write("## Strategy Outlook and Future Direction")
                  try:
                      if strategic_initiatives:
                          if st.session_state["strategic_initiatives"]:
                              st.write("### Strategic Initiatives")
                              st.write(st.session_state["strategic_initiatives"])
                          else:
                              st.error("Strategic Initiatives insight has not been generated")
                  except:
                      st.error("This insight has not been generated")
  
                  try:
                      if market_outlook:
                          if st.session_state["market_outlook"]:
                              st.write("### Market Outlook")
                              st.write(st.session_state["market_outlook"])
                          else:
                              st.error("Market Outlook insight has not been generated")
  
                  except:
                      st.error("This insight has not been generated")
  
                  try:
                      if product_roadmap:
                          if st.session_state["product_roadmap"]:
                              st.write("### Product Roadmap")
                              st.write(st.session_state["product_roadmap"])
                          else:
                              st.error("Product Roadmap insight has not been generated")
                  except:
                      st.error("This insight has not been generated")
  
              with tab3:
                  st.write("## Risk Management")
  
                  try:
                      if risk_factors:
                          if st.session_state["risk_factors"]:
                              st.write("### Risk Factors")
                              st.write(st.session_state["risk_factors"])
                          else:
                              st.error("Risk Factors insight has not been generated")
                  except:
                      st.error("This insight has not been generated")
  
                  try:
                      if risk_mitigation:
                          if st.session_state["risk_mitigation"]:
                              st.write("### Risk Mitigation")
                              st.write(st.session_state["risk_mitigation"])
                          else:
                              st.error("Risk Mitigation insight has not been generated")
                  except:
                      st.error("This insight has not been generated")
  
  
              with tab4:
                  st.write("## Innovation and R&D")
  
                  try:
                      if r_and_d_activities:
                          if st.session_state["r_and_d_activities"]:
                              st.write("### R&D Activities")
                              st.write(st.session_state["r_and_d_activities"])
                          else:
                              st.error("R&D Activities insight has not been generated")
                  except:
                      st.error("This insight has not been generated")
  
                  try:
                      if innovation_focus:
                          if st.session_state["innovation_focus"]:
                              st.write("### Innovation Focus")
                              st.write(st.session_state["innovation_focus"])
                          else:
                              st.error("Innovation Focus insight has not been generated")
                  except:
                      st.error("This insight has not been generated")
  
apis: llama_index.VectorStoreIndex.from_documents llama_index.tools.ToolMetadata llama_index.query_engine.SubQuestionQueryEngine.from_defaults llama_index.vector_stores.FaissVectorStore llama_index.ServiceContext.from_defaults llama_index.StorageContext.from_defaults llama_index.node_parser.UnstructuredElementNodeParser llama_index.VectorStoreIndex
extract_api: [((1272, 1416), 'streamlit.set_page_config', 'st.set_page_config', ([], {'page_title': '"""Annual Report Analyzer"""', 'page_icon': '""":card_index_dividers:"""', 'initial_sidebar_state': '"""expanded"""', 'layout': '"""wide"""'}), "(page_title='Annual Report Analyzer', page_icon=\n    ':card_index_dividers:', initial_sidebar_state='expanded', layout='wide')\n", (1290, 1416), True, 'import streamlit as st\n'), ((1413, 1469), 'streamlit.title', 'st.title', (['""":card_index_dividers: Annual Report Analyzer"""'], {}), "(':card_index_dividers: Annual Report Analyzer')\n", (1421, 1469), True, 'import streamlit as st\n'), ((1470, 1825), 'streamlit.info', 'st.info', (['"""\nBegin by uploading the annual report of your chosen company in PDF format. Afterward, click on \'Process PDF\'. Once the document has been processed, tap on \'Analyze Report\' and the system will start its magic. After a brief wait, you\'ll be presented with a detailed analysis and insights derived from the report for your reading.\n"""'], {}), '(\n    """\nBegin by uploading the annual report of your chosen company in PDF format. Afterward, click on \'Process PDF\'. Once the document has been processed, tap on \'Analyze Report\' and the system will start its magic. After a brief wait, you\'ll be presented with a detailed analysis and insights derived from the report for your reading.\n"""\n    )\n', (1477, 1825), True, 'import streamlit as st\n'), ((5455, 5564), 'streamlit.sidebar.info', 'st.sidebar.info', (['"""\nYou can get your OpenAI API key [here](https://openai.com/blog/openai-api)\n"""'], {}), '(\n    """\nYou can get your OpenAI API key [here](https://openai.com/blog/openai-api)\n"""\n    )\n', (5470, 5564), True, 'import streamlit as st\n'), ((5572, 5628), 'streamlit.sidebar.text_input', 'st.sidebar.text_input', (['"""OpenAI API Key"""'], {'type': '"""password"""'}), "('OpenAI API Key', type='password')\n", (5593, 5628), True, 'import streamlit as st\n'), ((1850, 1864), 'pypdf.PdfReader', 'PdfReader', (['pdf'], {}), '(pdf)\n', (1859, 1864), False, 'from pypdf import PdfReader\n'), ((2005, 2036), 'llama_index.node_parser.UnstructuredElementNodeParser', 'UnstructuredElementNodeParser', ([], {}), '()\n', (2034, 2036), False, 'from llama_index.node_parser import UnstructuredElementNodeParser\n'), ((2214, 2233), 'src.utils.get_model', 'get_model', (['"""openai"""'], {}), "('openai')\n", (2223, 2233), False, 'from src.utils import get_model, process_pdf2, generate_pydantic_model\n'), ((3089, 3193), 'langchain.prompts.PromptTemplate', 'PromptTemplate', ([], {'template': 'template', 'input_variables': "['insight_name', 'section_name', 'output_format']"}), "(template=template, input_variables=['insight_name',\n    'section_name', 'output_format'])\n", (3103, 3193), False, 'from langchain.prompts import PromptTemplate\n'), ((4263, 4282), 'src.utils.get_model', 'get_model', (['"""openai"""'], {}), "('openai')\n", (4272, 4282), False, 'from src.utils import get_model, process_pdf2, generate_pydantic_model\n'), ((4305, 4342), 'llama_index.ServiceContext.from_defaults', 'ServiceContext.from_defaults', ([], {'llm': 'llm'}), '(llm=llm)\n', (4333, 4342), False, 'from llama_index import VectorStoreIndex, ServiceContext, StorageContext\n'), ((4646, 4758), 'llama_index.query_engine.SubQuestionQueryEngine.from_defaults', 'SubQuestionQueryEngine.from_defaults', ([], {'query_engine_tools': 'query_engine_tools', 'service_context': 'service_context'}), '(query_engine_tools=query_engine_tools,\n    service_context=service_context)\n', (4682, 4758), False, 'from llama_index.query_engine import SubQuestionQueryEngine\n'), ((5703, 5747), 'streamlit.error', 'st.error', (['"""Please enter your OpenAI API Key"""'], {}), "('Please enter your OpenAI API Key')\n", (5711, 5747), True, 'import streamlit as st\n'), ((5779, 5857), 'streamlit.sidebar.file_uploader', 'st.sidebar.file_uploader', (['"""Upload the annual report in PDF format"""'], {'type': '"""pdf"""'}), "('Upload the annual report in PDF format', type='pdf')\n", (5803, 5857), True, 'import streamlit as st\n'), ((5862, 6262), 'streamlit.sidebar.info', 'st.sidebar.info', (['"""\n    Example reports you can upload here: \n    - [Apple Inc.](https://s2.q4cdn.com/470004039/files/doc_financials/2022/q4/_10-K-2022-(As-Filed).pdf)\n    - [Microsoft Corporation](https://microsoft.gcs-web.com/static-files/07cf3c30-cfc3-4567-b20f-f4b0f0bd5087)\n    - [Tesla Inc.](https://digitalassets.tesla.com/tesla-contents/image/upload/IR/TSLA-Q4-2022-Update)\n    """'], {}), '(\n    """\n    Example reports you can upload here: \n    - [Apple Inc.](https://s2.q4cdn.com/470004039/files/doc_financials/2022/q4/_10-K-2022-(As-Filed).pdf)\n    - [Microsoft Corporation](https://microsoft.gcs-web.com/static-files/07cf3c30-cfc3-4567-b20f-f4b0f0bd5087)\n    - [Tesla Inc.](https://digitalassets.tesla.com/tesla-contents/image/upload/IR/TSLA-Q4-2022-Update)\n    """\n    )\n', (5877, 6262), True, 'import streamlit as st\n'), ((6261, 6298), 'streamlit.sidebar.button', 'st.sidebar.button', (['"""Process Document"""'], {}), "('Process Document')\n", (6278, 6298), True, 'import streamlit as st\n'), ((2305, 2325), 'faiss.IndexFlatL2', 'faiss.IndexFlatL2', (['d'], {}), '(d)\n', (2322, 2325), False, 'import faiss\n'), ((2349, 2390), 'llama_index.vector_stores.FaissVectorStore', 'FaissVectorStore', ([], {'faiss_index': 'faiss_index'}), '(faiss_index=faiss_index)\n', (2365, 2390), False, 'from llama_index.vector_stores import FaissVectorStore\n'), ((2417, 2472), 'llama_index.StorageContext.from_defaults', 'StorageContext.from_defaults', ([], {'vector_store': 'vector_store'}), '(vector_store=vector_store)\n', (2445, 2472), False, 'from llama_index import VectorStoreIndex, ServiceContext, StorageContext\n'), ((2623, 2660), 'llama_index.ServiceContext.from_defaults', 'ServiceContext.from_defaults', ([], {'llm': 'llm'}), '(llm=llm)\n', (2651, 2660), False, 'from llama_index import VectorStoreIndex, ServiceContext, StorageContext\n'), ((2678, 2772), 'llama_index.VectorStoreIndex', 'VectorStoreIndex', (['nodes'], {'service_context': 'service_context', 'storage_context': 'storage_context'}), '(nodes, service_context=service_context, storage_context=\n    storage_context)\n', (2694, 2772), False, 'from llama_index import VectorStoreIndex, ServiceContext, StorageContext\n'), ((6542, 6574), 'streamlit.toast', 'st.toast', (['"""Document Processsed!"""'], {}), "('Document Processsed!')\n", (6550, 6574), True, 'import streamlit as st\n'), ((6636, 6660), 'streamlit.columns', 'st.columns', (['[0.25, 0.75]'], {}), '([0.25, 0.75])\n', (6646, 6660), True, 'import streamlit as st\n'), ((2853, 2891), 'llama_index.VectorStoreIndex.from_documents', 'VectorStoreIndex.from_documents', (['nodes'], {}), '(nodes)\n', (2884, 2891), False, 'from llama_index import VectorStoreIndex, ServiceContext, StorageContext\n'), ((6313, 6349), 'streamlit.spinner', 'st.spinner', (['"""Processing Document..."""'], {}), "('Processing Document...')\n", (6323, 6349), True, 'import streamlit as st\n'), ((6693, 6758), 'streamlit.write', 'st.write', (['"""\n                ### Select Insights\n            """'], {}), '("""\n                ### Select Insights\n            """)\n', (6701, 6758), True, 'import streamlit as st\n'), ((8153, 8180), 'streamlit.button', 'st.button', (['"""Analyze Report"""'], {}), "('Analyze Report')\n", (8162, 8180), True, 'import streamlit as st\n'), ((11243, 11364), 'streamlit.tabs', 'st.tabs', (["['Fiscal Year Highlights', 'Strategy Outlook and Future Direction',\n    'Risk Management', 'Innovation and R&D']"], {}), "(['Fiscal Year Highlights', 'Strategy Outlook and Future Direction',\n    'Risk Management', 'Innovation and R&D'])\n", (11250, 11364), True, 'import streamlit as st\n'), ((4450, 4568), 'llama_index.tools.ToolMetadata', 'ToolMetadata', ([], {'name': '"""Annual Report"""', 'description': 'f"""Provides information about the company from its annual report."""'}), "(name='Annual Report', description=\n    f'Provides information about the company from its annual report.')\n", (4462, 4568), False, 'from llama_index.tools import QueryEngineTool, ToolMetadata\n'), ((6789, 6845), 'streamlit.expander', 'st.expander', (['"""**Fiscal Year Highlights**"""'], {'expanded': '(True)'}), "('**Fiscal Year Highlights**', expanded=True)\n", (6800, 6845), True, 'import streamlit as st\n'), ((6888, 6923), 'streamlit.toggle', 'st.toggle', (['"""Performance Highlights"""'], {}), "('Performance Highlights')\n", (6897, 6923), True, 'import streamlit as st\n'), ((6955, 6980), 'streamlit.toggle', 'st.toggle', (['"""Major Events"""'], {}), "('Major Events')\n", (6964, 6980), True, 'import streamlit as st\n'), ((7022, 7057), 'streamlit.toggle', 'st.toggle', (['"""Challenges Encountered"""'], {}), "('Challenges Encountered')\n", (7031, 7057), True, 'import streamlit as st\n'), ((7186, 7257), 'streamlit.expander', 'st.expander', (['"""**Strategy Outlook and Future Direction**"""'], {'expanded': '(True)'}), "('**Strategy Outlook and Future Direction**', expanded=True)\n", (7197, 7257), True, 'import streamlit as st\n'), ((7299, 7333), 'streamlit.toggle', 'st.toggle', (['"""Strategic Initiatives"""'], {}), "('Strategic Initiatives')\n", (7308, 7333), True, 'import streamlit as st\n'), ((7367, 7394), 'streamlit.toggle', 'st.toggle', (['"""Market Outlook"""'], {}), "('Market Outlook')\n", (7376, 7394), True, 'import streamlit as st\n'), ((7429, 7457), 'streamlit.toggle', 'st.toggle', (['"""Product Roadmap"""'], {}), "('Product Roadmap')\n", (7438, 7457), True, 'import streamlit as st\n'), ((7591, 7640), 'streamlit.expander', 'st.expander', (['"""**Risk Management**"""'], {'expanded': '(True)'}), "('**Risk Management**', expanded=True)\n", (7602, 7640), True, 'import streamlit as st\n'), ((7673, 7698), 'streamlit.toggle', 'st.toggle', (['"""Risk Factors"""'], {}), "('Risk Factors')\n", (7682, 7698), True, 'import streamlit as st\n'), ((7733, 7761), 'streamlit.toggle', 'st.toggle', (['"""Risk Mitigation"""'], {}), "('Risk Mitigation')\n", (7742, 7761), True, 'import streamlit as st\n'), ((7852, 7904), 'streamlit.expander', 'st.expander', (['"""**Innovation and R&D**"""'], {'expanded': '(True)'}), "('**Innovation and R&D**', expanded=True)\n", (7863, 7904), True, 'import streamlit as st\n'), ((7943, 7970), 'streamlit.toggle', 'st.toggle', (['"""R&D Activities"""'], {}), "('R&D Activities')\n", (7952, 7970), True, 'import streamlit as st\n'), ((8006, 8035), 'streamlit.toggle', 'st.toggle', (['"""Innovation Focus"""'], {}), "('Innovation Focus')\n", (8015, 8035), True, 'import streamlit as st\n'), ((8313, 8324), 'time.time', 'time.time', ([], {}), '()\n', (8322, 8324), False, 'import time\n'), ((11022, 11088), 'streamlit.write', 'st.write', (['"""Report Analysis Time: """', 'st.session_state.end_time', '"""s"""'], {}), "('Report Analysis Time: ', st.session_state.end_time, 's')\n", (11030, 11088), True, 'import streamlit as st\n'), ((11432, 11469), 'streamlit.write', 'st.write', (['"""## Fiscal Year Highlights"""'], {}), "('## Fiscal Year Highlights')\n", (11440, 11469), True, 'import streamlit as st\n'), ((13138, 13190), 'streamlit.write', 'st.write', (['"""## Strategy Outlook and Future Direction"""'], {}), "('## Strategy Outlook and Future Direction')\n", (13146, 13190), True, 'import streamlit as st\n'), ((14663, 14693), 'streamlit.write', 'st.write', (['"""## Risk Management"""'], {}), "('## Risk Management')\n", (14671, 14693), True, 'import streamlit as st\n'), ((15658, 15691), 'streamlit.write', 'st.write', (['"""## Innovation and R&D"""'], {}), "('## Innovation and R&D')\n", (15666, 15691), True, 'import streamlit as st\n'), ((8224, 8282), 'streamlit.session_state.index.as_query_engine', 'st.session_state.index.as_query_engine', ([], {'similarity_top_k': '(3)'}), '(similarity_top_k=3)\n', (8262, 8282), True, 'import streamlit as st\n'), ((8347, 8383), 'streamlit.status', 'st.status', (['"""**Analyzing Report...**"""'], {}), "('**Analyzing Report...**')\n", (8356, 8383), True, 'import streamlit as st\n'), ((10913, 10950), 'streamlit.toast', 'st.toast', (['"""Report Analysis Complete!"""'], {}), "('Report Analysis Complete!')\n", (10921, 10950), True, 'import streamlit as st\n'), ((8468, 8505), 'streamlit.write', 'st.write', (['"""Fiscal Year Highlights..."""'], {}), "('Fiscal Year Highlights...')\n", (8476, 8505), True, 'import streamlit as st\n'), ((9055, 9107), 'streamlit.write', 'st.write', (['"""Strategy Outlook and Future Direction..."""'], {}), "('Strategy Outlook and Future Direction...')\n", (9063, 9107), True, 'import streamlit as st\n'), ((9678, 9708), 'streamlit.write', 'st.write', (['"""Risk Management..."""'], {}), "('Risk Management...')\n", (9686, 9708), True, 'import streamlit as st\n'), ((10249, 10282), 'streamlit.write', 'st.write', (['"""Innovation and R&D..."""'], {}), "('Innovation and R&D...')\n", (10257, 10282), True, 'import streamlit as st\n'), ((11926, 11973), 'streamlit.error', 'st.error', (['"""This insight has not been generated"""'], {}), "('This insight has not been generated')\n", (11934, 11973), True, 'import streamlit as st\n'), ((12380, 12427), 'streamlit.error', 'st.error', (['"""This insight has not been generated"""'], {}), "('This insight has not been generated')\n", (12388, 12427), True, 'import streamlit as st\n'), ((12883, 12930), 'streamlit.error', 'st.error', (['"""This insight has not been generated"""'], {}), "('This insight has not been generated')\n", (12891, 12930), True, 'import streamlit as st\n'), ((13641, 13688), 'streamlit.error', 'st.error', (['"""This insight has not been generated"""'], {}), "('This insight has not been generated')\n", (13649, 13688), True, 'import streamlit as st\n'), ((14106, 14153), 'streamlit.error', 'st.error', (['"""This insight has not been generated"""'], {}), "('This insight has not been generated')\n", (14114, 14153), True, 'import streamlit as st\n'), ((14575, 14622), 'streamlit.error', 'st.error', (['"""This insight has not been generated"""'], {}), "('This insight has not been generated')\n", (14583, 14622), True, 'import streamlit as st\n'), ((15100, 15147), 'streamlit.error', 'st.error', (['"""This insight has not been generated"""'], {}), "('This insight has not been generated')\n", (15108, 15147), True, 'import streamlit as st\n'), ((15569, 15616), 'streamlit.error', 'st.error', (['"""This insight has not been generated"""'], {}), "('This insight has not been generated')\n", (15577, 15616), True, 'import streamlit as st\n'), ((16120, 16167), 'streamlit.error', 'st.error', (['"""This insight has not been generated"""'], {}), "('This insight has not been generated')\n", (16128, 16167), True, 'import streamlit as st\n'), ((16594, 16641), 'streamlit.error', 'st.error', (['"""This insight has not been generated"""'], {}), "('This insight has not been generated')\n", (16602, 16641), True, 'import streamlit as st\n'), ((10863, 10874), 'time.time', 'time.time', ([], {}), '()\n', (10872, 10874), False, 'import time\n'), ((11638, 11676), 'streamlit.write', 'st.write', (['"""### Performance Highlights"""'], {}), "('### Performance Highlights')\n", (11646, 11676), True, 'import streamlit as st\n'), ((11705, 11757), 'streamlit.write', 'st.write', (["st.session_state['performance_highlights']"], {}), "(st.session_state['performance_highlights'])\n", (11713, 11757), True, 'import streamlit as st\n'), ((11816, 11881), 'streamlit.error', 'st.error', (['"""fiscal Year Highlights insight has not been generated"""'], {}), "('fiscal Year Highlights insight has not been generated')\n", (11824, 11881), True, 'import streamlit as st\n'), ((12122, 12150), 'streamlit.write', 'st.write', (['"""### Major Events"""'], {}), "('### Major Events')\n", (12130, 12150), True, 'import streamlit as st\n'), ((12179, 12221), 'streamlit.write', 'st.write', (["st.session_state['major_events']"], {}), "(st.session_state['major_events'])\n", (12187, 12221), True, 'import streamlit as st\n'), ((12280, 12335), 'streamlit.error', 'st.error', (['"""Major Events insight has not been generated"""'], {}), "('Major Events insight has not been generated')\n", (12288, 12335), True, 'import streamlit as st\n'), ((12595, 12633), 'streamlit.write', 'st.write', (['"""### Challenges Encountered"""'], {}), "('### Challenges Encountered')\n", (12603, 12633), True, 'import streamlit as st\n'), ((12662, 12714), 'streamlit.write', 'st.write', (["st.session_state['challenges_encountered']"], {}), "(st.session_state['challenges_encountered'])\n", (12670, 12714), True, 'import streamlit as st\n'), ((12773, 12838), 'streamlit.error', 'st.error', (['"""Challenges Encountered insight has not been generated"""'], {}), "('Challenges Encountered insight has not been generated')\n", (12781, 12838), True, 'import streamlit as st\n'), ((13356, 13393), 'streamlit.write', 'st.write', (['"""### Strategic Initiatives"""'], {}), "('### Strategic Initiatives')\n", (13364, 13393), True, 'import streamlit as st\n'), ((13422, 13473), 'streamlit.write', 'st.write', (["st.session_state['strategic_initiatives']"], {}), "(st.session_state['strategic_initiatives'])\n", (13430, 13473), True, 'import streamlit as st\n'), ((13532, 13596), 'streamlit.error', 'st.error', (['"""Strategic Initiatives insight has not been generated"""'], {}), "('Strategic Initiatives insight has not been generated')\n", (13540, 13596), True, 'import streamlit as st\n'), ((13841, 13871), 'streamlit.write', 'st.write', (['"""### Market Outlook"""'], {}), "('### Market Outlook')\n", (13849, 13871), True, 'import streamlit as st\n'), ((13900, 13944), 'streamlit.write', 'st.write', (["st.session_state['market_outlook']"], {}), "(st.session_state['market_outlook'])\n", (13908, 13944), True, 'import streamlit as st\n'), ((14003, 14060), 'streamlit.error', 'st.error', (['"""Market Outlook insight has not been generated"""'], {}), "('Market Outlook insight has not been generated')\n", (14011, 14060), True, 'import streamlit as st\n'), ((14308, 14339), 'streamlit.write', 'st.write', (['"""### Product Roadmap"""'], {}), "('### Product Roadmap')\n", (14316, 14339), True, 'import streamlit as st\n'), ((14368, 14413), 'streamlit.write', 'st.write', (["st.session_state['product_roadmap']"], {}), "(st.session_state['product_roadmap'])\n", (14376, 14413), True, 'import streamlit as st\n'), ((14472, 14530), 'streamlit.error', 'st.error', (['"""Product Roadmap insight has not been generated"""'], {}), "('Product Roadmap insight has not been generated')\n", (14480, 14530), True, 'import streamlit as st\n'), ((14842, 14870), 'streamlit.write', 'st.write', (['"""### Risk Factors"""'], {}), "('### Risk Factors')\n", (14850, 14870), True, 'import streamlit as st\n'), ((14899, 14941), 'streamlit.write', 'st.write', (["st.session_state['risk_factors']"], {}), "(st.session_state['risk_factors'])\n", (14907, 14941), True, 'import streamlit as st\n'), ((15000, 15055), 'streamlit.error', 'st.error', (['"""Risk Factors insight has not been generated"""'], {}), "('Risk Factors insight has not been generated')\n", (15008, 15055), True, 'import streamlit as st\n'), ((15302, 15333), 'streamlit.write', 'st.write', (['"""### Risk Mitigation"""'], {}), "('### Risk Mitigation')\n", (15310, 15333), True, 'import streamlit as st\n'), ((15362, 15407), 'streamlit.write', 'st.write', (["st.session_state['risk_mitigation']"], {}), "(st.session_state['risk_mitigation'])\n", (15370, 15407), True, 'import streamlit as st\n'), ((15466, 15524), 'streamlit.error', 'st.error', (['"""Risk Mitigation insight has not been generated"""'], {}), "('Risk Mitigation insight has not been generated')\n", (15474, 15524), True, 'import streamlit as st\n'), ((15852, 15882), 'streamlit.write', 'st.write', (['"""### R&D Activities"""'], {}), "('### R&D Activities')\n", (15860, 15882), True, 'import streamlit as st\n'), ((15911, 15959), 'streamlit.write', 'st.write', (["st.session_state['r_and_d_activities']"], {}), "(st.session_state['r_and_d_activities'])\n", (15919, 15959), True, 'import streamlit as st\n'), ((16018, 16075), 'streamlit.error', 'st.error', (['"""R&D Activities insight has not been generated"""'], {}), "('R&D Activities insight has not been generated')\n", (16026, 16075), True, 'import streamlit as st\n'), ((16324, 16356), 'streamlit.write', 'st.write', (['"""### Innovation Focus"""'], {}), "('### Innovation Focus')\n", (16332, 16356), True, 'import streamlit as st\n'), ((16385, 16431), 'streamlit.write', 'st.write', (["st.session_state['innovation_focus']"], {}), "(st.session_state['innovation_focus'])\n", (16393, 16431), True, 'import streamlit as st\n'), ((16490, 16549), 'streamlit.error', 'st.error', (['"""Innovation Focus insight has not been generated"""'], {}), "('Innovation Focus insight has not been generated')\n", (16498, 16549), True, 'import streamlit as st\n')]