DocumentSummaryIndex
documents = [Document(doc_id=str(i), text=str(conversation)) for i, conversation in enumerate(messages_history.values())] summary_index = DocumentSummaryIndex.from_documents(documents) # Get model from template model = get_template_content_by_name("summary_model") query_engine = summary_index.as_query_engine(llm=OpenAI(model=model)) summary = query_engine.query(text)
DocumentSummaryIndex.from_documents(documents)