I wish to access the
additional_kwargs
attribute of
CompletionResponse
object returned by the
complete()
method of the LLM integration when this LLM is used in a simple RAG pipeline.
In a RAG pipeline, the
response
is of type
llama_index.core.base.response.schema.Response
which only stores the
text
attribute of
CompletionResponse
.
Here's an example RAG pipeline that I'm using:
Settings.llm = llm
Settings.embed_model = HuggingFaceEmbedding(model_name="BAAI/bge-small-en-v1.5")
documents = SimpleDirectoryReader("data").load_data()
index = VectorStoreIndex.from_documents(documents)
query_engine = index.as_query_engine()
response = query_engine.query("A random question")
What's the best way to get these
additional_kwargs
?