Find answers from the community

Home
Members
Ishaan - liteLLM
I
Ishaan - liteLLM
Offline, last seen 3 months ago
Joined September 25, 2024
Hey I'm using a PDF data loader with llama_index and then converting that to GPTSimpleVectorIndex, but get this error:
Invalid document type: <class 'gpt_index.readers.schema.base.Document'>.
it was working fine before, but has been failing with gpt_index, llama_index
cc
11 comments
j
I
Hey I've been getting this error when trying to run GPT index imports

from llama_index import PromptHelper, SimpleWebPageReader, GPTSimpleVectorIndex
File "/usr/local/lib/python3.8/site-packages/llama_index/init.py", line 47, in <module>
from llama_index.langchain_helpers.memory_wrapper import GPTIndexMemory
File "/usr/local/lib/python3.8/site-packages/llama_index/langchain_helpers/memory_wrapper.py", line 5, in <module>
from langchain.chains.base import Memory
ImportError: cannot import name 'Memory' from 'langchain.chains.base' (/usr/local/lib/python3.8/site-packages/langchain/chains/base.py)

I'm on llama_index 0.4.22
1 comment
j
what's the best way to use custom prompts when querying a GPTSImpleVectorIndex?

I've tried doing something like this but it doesn't seem to actually be using the prompt when i do index_with_query.query()

SUMMARY_PROMPT_TMPL = ( "Context information is below. \n" "---------------------\n" "{context_str}" "\n---------------------\n" "Always answer the question in bullet points" ) SUMMARY_PROMPT = SummaryPrompt(SUMMARY_PROMPT_TMPL) # Build GPTTreeIndex: pass in custom prompt index_with_query = GPTTreeIndex(documents, summary_template=SUMMARY_PROMPT)
1 comment
L