... chat_history = [ ChatMessage(role=MessageRole.SYSTEM, content="You are a helpful QA chatbot that can answer questions about llama-index."), ChatMessage(role=MessageRole.USER, content="How do I create an index?"), ChatMessage(role=MessageRole.ASSISTANT, content="LlamaIndex is a data framework for LLM-based applications which benefit from context augmentation."), ] llm = OpenAI(model="gpt-3.5-turbo", temperature=0) llm.chat(chat_history) # here I try to attach the chat history documents = SimpleDirectoryReader("data").load_data() # this is just my CV in text index = VectorStoreIndex.from_documents(documents) query_engine = index.as_query_engine() response = query_engine.query("What is LlamaIndex ?") print(response)
chat_history = [ ChatMessage(role=MessageRole.SYSTEM, content="You are a helpful QA chatbot that can answer questions about llama-index."), ChatMessage(role=MessageRole.USER, content="How do I create an index?"), ChatMessage(role=MessageRole.ASSISTANT, content="LlamaIndex is a data framework for LLM-based applications which benefit from context augmentation."), ] llm = OpenAI(model="gpt-4", temperature=0) documents = SimpleDirectoryReader("data").load_data() index = VectorStoreIndex.from_documents(documents) engine = index.as_query_engine(llm=llm) chat_engine = CondenseQuestionChatEngine.from_defaults( query_engine=engine, condense_question_prompt=custom_prompt, chat_history=chat_history, # verbose=True, ) response = chat_engine.chat("What is LlamaIndex ? Who's Thiago ?") # response = engine.chat("What is LlamaIndex ?") print(response)
custom_prompt = PromptTemplate( """\ Given a conversation (between Human and Assistant) and a follow up message from Human, \ provide the information needed based on context and general knowledge from documents and LLMs <Chat History> {chat_history} <Follow Up Message> {question} """ )
"What is LlamaIndex ? Who's Thiago ?"
The context does not provide any information about LlamaIndex or its relation to Thiago Ventura. Therefore, I cannot provide any details about Thiago's involvement with LlamaIndex.