Bala Krishna Mamidi
Bala Krishna Mamidi

Reputation: 11

RAG engine error: Can't instantiate abstract class BaseNode

While executing RAG query engine as per the following code

query_engine = RetrieverQueryEngine.from_args(
   retriever,llm=AzureOpenAI(api_key='xxxxxxxxxxxxxxx',
   azure_endpoint="https://xxxxxxxxxxxxxx/",
   engine="openai-gpt35-1106",
   temperature=0.1,
   api_version="2023-09-15-preview"))

   response = query_engine.query("Summary in 2 lines"),
   logger.info(f"RESULT:{response}")

it's throwing below error:

Can't instantiate abstract class BaseNode with abstract methods get_content, get_metadata_str, get_type, hash, set_content (type=type_error)

what could have gone wrong with the code, or the RAG/llm library. please help to resolve the issue at the earliest.

I am trying to implement RAG and query, but failing with the error as described. Did all the necessary libraries imports in the beginning of the code, including following import:

from llama_index.core.schema import TextNode, BaseNode, NodeWithScore

Upvotes: 0

Views: 21

Answers (0)

Related Questions