Hi, I updated to the latest llamaindex and I am having trouble migrating my code. This was my code before migration:
llm_predictor = ChatGPTLLMPredictor(llm=ChatOpenAI(temperature=0, model_name="gpt-3.5-turbo-0613", streaming=False, max_tokens=1000))
service_context = ServiceContext.from_defaults(llm_predictor=llm_predictor, prompt_helper=prompt_helper, callback_manager=callback_manager)
and now this is example code that is giving me an error after migrating to the latest llamaindex version:
llm = OpenAI(temperature=0, model="gpt-3.5-turbo")
service_context = ServiceContext.from_defaults(llm=llm)
storage_context = StorageContext.from_defaults(persist_dir="./storage")
index = load_index_from_storage(storage_context)
query_engine = index.as_query_engine()
response = query_engine.query("hi")
print(response)
The error I get is
AttributeError: 'ServiceContext' object has no attribute 'llm'
What am I doing wrong here please? π
I tried following this guide but unsuccessfully
https://gpt-index.readthedocs.io/en/latest/how_to/customization/llms_migration_guide.html