code: from llama_index.embeddings import OpenAIEmbedding
  from llama_index.llms import OpenAI
  from llama_index.ingestion import IngestionPipeline
  from llama_index.extractors import TitleExtractor, SummaryExtractor
  from llama_index.text_splitter import SentenceSplitter
  from llama_index.schema import MetadataMode
  # from langchain.embeddings.huggingface import HuggingFaceBgeEmbeddings
  # from llama_index.embeddings import *
  from llama_index.embeddings import HuggingFaceEmbedding
  from llm import LLMClient
  from llama_index.llms import Ollama
  from llama_index import ServiceContext
  from llama_index.vector_stores import AstraDBVectorStore
  from llama_index import Document
  from llama_index.text_splitter import TokenTextSplitter
  from llama_index import set_global_service_context
  from llama_index.llms import LangChainLLM
  from langchain_nvidia_ai_endpoints import ChatNVIDIA
  import os
  import asyncio
  
  token = os.environ['token']
  api_endpoint = os.environ['api_endpoint']
  
  def create_pipeline_astra_db(llm_type='nvidia',embed_model='local',collection_name='video_transcript'):
      print("Loading Pipeline")
      if embed_model=='local':
          print("embed_model local")
          embed_model = "BAAI/bge-base-en"
          embed_model_dim = 768
          embed_model = HuggingFaceEmbedding(model_name=embed_model)
      elif embed_model=='nvidia':
          print("embed_model nviida")
          embed_model_dim = 1024
          embed_model = HuggingFaceEmbedding(model_name=embed_model)
      else:
          print("embed_model else")
          embed_model = HuggingFaceEmbedding(model_name=embed_model)
      
      if llm_type=='nvidia':
          print('llm nvidia')
          nvai_llm = ChatNVIDIA(model='llama2_70b')
          llm = LangChainLLM(llm=nvai_llm)
      elif llm_type=='ollama':
          print('llm_ollama')
          llm = Ollama(model='stablelm2', temperature=0.1)
      else:
          print('llm else')
          llm = OpenAI(model="gpt-3.5-turbo-1106", temperature=0.1)
  
  
      service_context = ServiceContext.from_defaults(embed_model=embed_model, llm=llm)
      set_global_service_context(service_context) 
      astra_db_store = AstraDBVectorStore(
          token=token,
          api_endpoint=api_endpoint,
          collection_name=collection_name,
          embedding_dimension=embed_model_dim,
      )
  
      transformations = [
          SentenceSplitter(chunk_size=1024, chunk_overlap=100),
          TitleExtractor(llm=llm, metadata_mode=MetadataMode.EMBED, num_workers=8),
          SummaryExtractor(llm=llm, metadata_mode=MetadataMode.EMBED, num_workers=8),
          embed_model,
      ]
      # text_splitter = TokenTextSplitter(chunk_size=512)
      return IngestionPipeline(transformations=transformations,vector_store=astra_db_store)
      # return IngestionPipeline(
      #     transformations=[text_splitter, embed_model],
      #     vector_store=astra_db_store)
  
  def ingest_pipeline_astra_db(text,metadata=None,_async=False,collection_name=None,run_async=False):
      if collection_name is not None:
          pipeline = create_pipeline_astra_db(llm_type='nvidia',collection_name=collection_name)    
      else:
          pipeline = create_pipeline_astra_db(llm_type='nvidia')
      print('Pipeline_loaded')
      # save
      # pipeline.persist("./pipeline_storage")
  
      # load and restore state
      # will run instantly due to the cache
      if metadata:
          doc = [Document(text=text,metadata=metadata)]
      else:
          doc = [Document(text=text)]
      if run_async:
          pipeline.arun(doc)
      else:
          if _async:
              # loop = asyncio.get_event_loop()
              pipeline.arun(documents=doc,num_workers=4)
          else:
              nodes = pipeline.run(documents=doc,num_workers=1)
  
      
      # pipeline.load("./pipeline_storage")
  
  
  
  if __name__=='__main__':
      ingest_pipeline_astra_db("Can you load this in asstra db, astra db is vector store using llama index")
apis: llama_index.vector_stores.AstraDBVectorStore llama_index.extractors.TitleExtractor llama_index.ServiceContext.from_defaults llama_index.extractors.SummaryExtractor llama_index.llms.Ollama llama_index.llms.OpenAI llama_index.llms.LangChainLLM llama_index.embeddings.HuggingFaceEmbedding llama_index.text_splitter.SentenceSplitter llama_index.set_global_service_context llama_index.Document llama_index.ingestion.IngestionPipeline
extract_api: [((1967, 2029), 'llama_index.ServiceContext.from_defaults', 'ServiceContext.from_defaults', ([], {'embed_model': 'embed_model', 'llm': 'llm'}), '(embed_model=embed_model, llm=llm)\n', (1995, 2029), False, 'from llama_index import ServiceContext\n'), ((2034, 2077), 'llama_index.set_global_service_context', 'set_global_service_context', (['service_context'], {}), '(service_context)\n', (2060, 2077), False, 'from llama_index import set_global_service_context\n'), ((2100, 2233), 'llama_index.vector_stores.AstraDBVectorStore', 'AstraDBVectorStore', ([], {'token': 'token', 'api_endpoint': 'api_endpoint', 'collection_name': 'collection_name', 'embedding_dimension': 'embed_model_dim'}), '(token=token, api_endpoint=api_endpoint, collection_name=\n    collection_name, embedding_dimension=embed_model_dim)\n', (2118, 2233), False, 'from llama_index.vector_stores import AstraDBVectorStore\n'), ((2615, 2694), 'llama_index.ingestion.IngestionPipeline', 'IngestionPipeline', ([], {'transformations': 'transformations', 'vector_store': 'astra_db_store'}), '(transformations=transformations, vector_store=astra_db_store)\n', (2632, 2694), False, 'from llama_index.ingestion import IngestionPipeline\n'), ((1254, 1298), 'llama_index.embeddings.HuggingFaceEmbedding', 'HuggingFaceEmbedding', ([], {'model_name': 'embed_model'}), '(model_name=embed_model)\n', (1274, 1298), False, 'from llama_index.embeddings import HuggingFaceEmbedding\n'), ((1655, 1685), 'langchain_nvidia_ai_endpoints.ChatNVIDIA', 'ChatNVIDIA', ([], {'model': '"""llama2_70b"""'}), "(model='llama2_70b')\n", (1665, 1685), False, 'from langchain_nvidia_ai_endpoints import ChatNVIDIA\n'), ((1700, 1726), 'llama_index.llms.LangChainLLM', 'LangChainLLM', ([], {'llm': 'nvai_llm'}), '(llm=nvai_llm)\n', (1712, 1726), False, 'from llama_index.llms import LangChainLLM\n'), ((2301, 2353), 'llama_index.text_splitter.SentenceSplitter', 'SentenceSplitter', ([], {'chunk_size': '(1024)', 'chunk_overlap': '(100)'}), '(chunk_size=1024, chunk_overlap=100)\n', (2317, 2353), False, 'from llama_index.text_splitter import SentenceSplitter\n'), ((2363, 2435), 'llama_index.extractors.TitleExtractor', 'TitleExtractor', ([], {'llm': 'llm', 'metadata_mode': 'MetadataMode.EMBED', 'num_workers': '(8)'}), '(llm=llm, metadata_mode=MetadataMode.EMBED, num_workers=8)\n', (2377, 2435), False, 'from llama_index.extractors import TitleExtractor, SummaryExtractor\n'), ((2445, 2519), 'llama_index.extractors.SummaryExtractor', 'SummaryExtractor', ([], {'llm': 'llm', 'metadata_mode': 'MetadataMode.EMBED', 'num_workers': '(8)'}), '(llm=llm, metadata_mode=MetadataMode.EMBED, num_workers=8)\n', (2461, 2519), False, 'from llama_index.extractors import TitleExtractor, SummaryExtractor\n'), ((1420, 1464), 'llama_index.embeddings.HuggingFaceEmbedding', 'HuggingFaceEmbedding', ([], {'model_name': 'embed_model'}), '(model_name=embed_model)\n', (1440, 1464), False, 'from llama_index.embeddings import HuggingFaceEmbedding\n'), ((1531, 1575), 'llama_index.embeddings.HuggingFaceEmbedding', 'HuggingFaceEmbedding', ([], {'model_name': 'embed_model'}), '(model_name=embed_model)\n', (1551, 1575), False, 'from llama_index.embeddings import HuggingFaceEmbedding\n'), ((1798, 1840), 'llama_index.llms.Ollama', 'Ollama', ([], {'model': '"""stablelm2"""', 'temperature': '(0.1)'}), "(model='stablelm2', temperature=0.1)\n", (1804, 1840), False, 'from llama_index.llms import Ollama\n'), ((1891, 1942), 'llama_index.llms.OpenAI', 'OpenAI', ([], {'model': '"""gpt-3.5-turbo-1106"""', 'temperature': '(0.1)'}), "(model='gpt-3.5-turbo-1106', temperature=0.1)\n", (1897, 1942), False, 'from llama_index.llms import OpenAI\n'), ((3319, 3357), 'llama_index.Document', 'Document', ([], {'text': 'text', 'metadata': 'metadata'}), '(text=text, metadata=metadata)\n', (3327, 3357), False, 'from llama_index import Document\n'), ((3383, 3402), 'llama_index.Document', 'Document', ([], {'text': 'text'}), '(text=text)\n', (3391, 3402), False, 'from llama_index import Document\n')]