File ~/miniconda3/lib/python3.10/site-packages/llama_index/indices/query/base.py:34, in BaseQueryEngine.retrieve(self, query_bundle) 33 def retrieve(self, query_bundle: QueryBundle) -> List[NodeWithScore]: ---> 34 raise NotImplementedError( 35 "This query engine does not support retrieve, use query directly" 36 ) NotImplementedError: This query engine does not support retrieve, use query directly
llm_predictor = LLMPredictor(llm=AzureChatOpenAI( openai_api_base=BASE_URL, openai_api_version="2023-03-15-preview", deployment_name=DEPLOYMENT_NAME, openai_api_key=API_KEY, openai_api_type = "azure", )
from langchain.chat_models import AzureChatOpenAI model = AzureChatOpenAI( openai_api_base=API_BASE, openai_api_version="2023-03-15-preview", deployment_name="Sample", openai_api_key=API_KEY, openai_api_type = "azure", ) # LLM for Service Context chat_llm = ChatGPTLLMPredictor(llm=model) # Embedding Model for Service Context embedding_llm = LangchainEmbedding( OpenAIEmbeddings( model="text-embedding-ada-002", deployment=EMBED_DEPLOYMENT, openai_api_key=API_KEY, openai_api_base=API_BASE, openai_api_type = "azure", openai_api_version="2023-03-15-preview", ), embed_batch_size=1, ) service_context = ServiceContext.from_defaults(llm_predictor=chat_llm, embed_model=embedding_llm, chunk_size=1024)
from llama_index import set_global_service_context .... set_global_service_context(service_context)
ServiceContext.from_defaults()
, it will use that service context instead