AttributeError: 'LLMPredictor' object has no attribute '_llm'. Did you mean: 'llm'I am trying to reference the
llm
provided into a
ServiceContext
object but when I reference it from the service context to perform a simple
complete
function I get the following error:
manager.service_context.llm.complete('Hi what is 5+5?')
(Manager is just a class I wrote that wraps over some LI objects, including a
ServiceContext
object.
My service context object: (created in the Manager class where I use type-hints and set a default)
service_context: ServiceContext = ServiceContext.from_defaults(
embed_model= AzureOpenAIEmbedding(
model="text-embedding-ada-002"
, azure_deployment="text-embedding-ada-002"
, azure_endpoint=str(settings.azure_openai_api_base)
, api_version=str(settings.azure_openai_api_version)
, api_key=str(settings.azure_openai_api_key)
)
, llm = AzureOpenAI(
model="gpt-4"
, azure_deployment="gpt-4"
, azure_endpoint=str(settings.azure_openai_api_base)
, api_version=str(settings.azure_openai_api_version)
, api_key=str(settings.azure_openai_api_key)
)
)
Error:
AttributeError: 'LLMPredictor' object has no attribute '_llm'. Did you mean: 'llm'?
I have in the past been able to reference the LLM from a service context.. not sure why all of a sudden its not working now. I am running
llama-index 0.9.39