code: import os, openai
  from dotenv import load_dotenv
  load_dotenv()
  OPENAI_API_KEY = os.environ.get("OPENAI_API_KEY")
  openai.api_key = OPENAI_API_KEY
  
  # pip install google-search-results
  
  from dotenv import load_dotenv
  from fastapi import FastAPI
  from fastapi.middleware.cors import CORSMiddleware
  from pydantic import BaseModel
  
  from Roku_cs_agent import formatter, roku_agent
  
  app = FastAPI()
  
  app.add_middleware(
      CORSMiddleware,
      allow_origins=["https://www.jgmancilla.com"],  # Adjust this to your needs
      allow_credentials=True,
      allow_methods=["*"],
      allow_headers=["*"],
  )
  
  ##############################################################################################################
  
  import llama_index, os
  from llama_index import ServiceContext, StorageContext
  from langchain.chat_models import ChatOpenAI
  from langchain.embeddings import OpenAIEmbeddings
  from llama_index.indices.loading import load_index_from_storage
  
  llm = ChatOpenAI(
      model_name="gpt-3.5-turbo", 
      temperature=0
  )
  
  llm_embeddings = OpenAIEmbeddings()
  
  service_context = ServiceContext.from_defaults(
      llm=llm, embed_model=llm_embeddings
  )
  
  llama_index.set_global_service_context(service_context)
  
  # The other computational tasks
  representative_storage_context = StorageContext.from_defaults(persist_dir="index_representative")
  personal_index = load_index_from_storage(representative_storage_context)
  representative_query_engine = personal_index.as_query_engine()
  
  ##############################################################################################################
  
  class Question(BaseModel):
      question: str
  
  @app.post('/representative')
  def representative(input: Question):
      response = representative_query_engine.query(input.question)
      return response
  
  @app.post('/query_cs')
  def query(input: Question):
      response = roku_agent.run(input.question)
      return response
      
  @app.post('/spotlight')
  def query_spotlight(input: Question):
      response = formatter.query_cs(input.question)
      return response
apis: llama_index.set_global_service_context llama_index.indices.loading.load_index_from_storage llama_index.ServiceContext.from_defaults llama_index.StorageContext.from_defaults
extract_api: [((49, 62), 'dotenv.load_dotenv', 'load_dotenv', ([], {}), '()\n', (60, 62), False, 'from dotenv import load_dotenv\n'), ((80, 112), 'os.environ.get', 'os.environ.get', (['"""OPENAI_API_KEY"""'], {}), "('OPENAI_API_KEY')\n", (94, 112), False, 'import llama_index, os\n'), ((380, 389), 'fastapi.FastAPI', 'FastAPI', ([], {}), '()\n', (387, 389), False, 'from fastapi import FastAPI\n'), ((947, 1000), 'langchain.chat_models.ChatOpenAI', 'ChatOpenAI', ([], {'model_name': '"""gpt-3.5-turbo"""', 'temperature': '(0)'}), "(model_name='gpt-3.5-turbo', temperature=0)\n", (957, 1000), False, 'from langchain.chat_models import ChatOpenAI\n'), ((1030, 1048), 'langchain.embeddings.OpenAIEmbeddings', 'OpenAIEmbeddings', ([], {}), '()\n', (1046, 1048), False, 'from langchain.embeddings import OpenAIEmbeddings\n'), ((1068, 1133), 'llama_index.ServiceContext.from_defaults', 'ServiceContext.from_defaults', ([], {'llm': 'llm', 'embed_model': 'llm_embeddings'}), '(llm=llm, embed_model=llm_embeddings)\n', (1096, 1133), False, 'from llama_index import ServiceContext, StorageContext\n'), ((1141, 1196), 'llama_index.set_global_service_context', 'llama_index.set_global_service_context', (['service_context'], {}), '(service_context)\n', (1179, 1196), False, 'import llama_index, os\n'), ((1263, 1327), 'llama_index.StorageContext.from_defaults', 'StorageContext.from_defaults', ([], {'persist_dir': '"""index_representative"""'}), "(persist_dir='index_representative')\n", (1291, 1327), False, 'from llama_index import ServiceContext, StorageContext\n'), ((1345, 1400), 'llama_index.indices.loading.load_index_from_storage', 'load_index_from_storage', (['representative_storage_context'], {}), '(representative_storage_context)\n', (1368, 1400), False, 'from llama_index.indices.loading import load_index_from_storage\n'), ((1841, 1871), 'Roku_cs_agent.roku_agent.run', 'roku_agent.run', (['input.question'], {}), '(input.question)\n', (1855, 1871), False, 'from Roku_cs_agent import formatter, roku_agent\n'), ((1974, 2008), 'Roku_cs_agent.formatter.query_cs', 'formatter.query_cs', (['input.question'], {}), '(input.question)\n', (1992, 2008), False, 'from Roku_cs_agent import formatter, roku_agent\n')]