Find answers from the community

s
F
Y
a
P
Updated last month

It looks like GPTSimpleVectorIndex no

It looks like GPTSimpleVectorIndex no longer has set_text so the code doesn't work...
L
G
T
14 comments
This has changed slightly in the new version, see the new guide here:
https://gpt-index.readthedocs.io/en/latest/how_to/index_structs/composability.html
thanks @Logan M so what should set_text be replaced with?
Thanks for your help @Logan M Unfortunately, I run into this error: ----> 1 graph = ComposableGraph.build_from_indices(
2 GPTListIndex,
3 [index_set[y] for y in years],
4 index_summaries=[index_summary[y] for y in years],
5 )

AttributeError: type object 'ComposableGraph' has no attribute 'build_from_indices'
Ah, looks like an error in the docs lol

Just checked the source code, I think the correct function is .from_indices(...)
that worked, thank you
Nice! Ill make a note to update the docs there! 👌
the sec notebook example also needs to be updated
@Logan M What about set_doc_id ? I was setting the doc id of the Index for integration purposes. Is there somewhere else I can set a doc_id to later expose in the query response for integration? Here's the code I use to build each index:

document = SimpleDirectoryReader('',[file_path]).load_data() indices.append(GPTSimpleVectorIndex.from_documents(document,service_context=service_context))
@Logan M it looks like the docs are wrong:
  1. [Optional, Advanced] Building indices on top of other indices
You can build indices on top of other indices!

from llama_index import GPTSimpleVectorIndex, GPTListIndex

index1 = GPTSimpleVectorIndex.from_documents(documents1)
index2 = GPTSimpleVectorIndex.from_documents(documents2)

Set summary text

you can set the summary manually, or you can

generate the summary itself using LlamaIndex

index1.set_text("summary1")
index2.set_text("summary2")

index3 = GPTListIndex([index1, index2])

Since set_text no longer exists, how should this work?
Thanks. I'll get that updated soon.
@Logan M so it looks like there is no way to do this GPTListIndex([index1, index2]), we have to use graphs? I am not getting good results with graphs right now
Add a reply
Sign up and join the conversation on Discord