Find answers from the community

Home
Members
Jack2020
J
Jack2020
Offline, last seen 3 months ago
Joined September 25, 2024
my code looks liek this: for text in texts:
if self.find_matching_keyword(text, key_words_for_remove_unneeded_text):
dc = GPTListIndex.from_documents([Document(text)])
tree_index_list.append(dc)
tree_index_summary.append(str(text))

loop_time = time.time()
print("Loop time: {:.6f} seconds".format(loop_time - filter_time))
4 comments
L
J
hello, an error when i use GPTIndexChatMemory:<class 'gpt_index.indices.list.base.GPTListIndex'>
Traceback (most recent call last):
File "/Users/apple/Desktop/AI/chatbot.py", line 107, in <module>
memory = GPTIndexChatMemory(
^^^^^^^^^^^^^^^^^^^
File "pydantic/main.py", line 341, in pydantic.main.BaseModel.init
pydantic.error_wrappers.ValidationError: 1 validation error for GPTIndexChatMemory
index
instance of BaseGPTIndex expected (type=type_error.arbitrary_type; expected_arbitrary_type=BaseGPTIndex)
I am so puzzled, how can i fix it? hope anyone can help...thks
8 comments
J
L
quite puzzling. after query and use str(response), return like this: Response(response='\n\n text text text.', source_nodes=[NodeWithScore(node=Node(text='\ntext text.', doc_id='c9b62c00-6ae3-4dc6-8b9b-cd79c4737f6d', embedding=None, doc_hash='d74157c2912d9c9c386c0a58079c16ab2b94ad50a40275c8bb63640ec94a9a67', extra_info=None, node_info=None, relationships={}), score=None), NodeWithScore(node=Node(text='\ntext text.', doc_id='f35a8c60-5a21-467b-ab78-c19e70e7da29', embedding=None, doc_hash='d74157c2912d9c9c386c0a58079c16ab2b94ad50a40275c8bb63640ec94a9a67', extra_info=None, node_info=None, relationships={}), score=None), NodeWithScore(node=Node(text='BY
6 comments
J
L
j